Commit Graph

49339 Commits

Author SHA1 Message Date
Campbell Barton
c2cfec64e3 Cleanup: unused warning 2015-08-06 16:52:28 +10:00
Campbell Barton
fdc8b12726 Cleanup: whitespace, unused var 2015-08-06 13:03:07 +10:00
Campbell Barton
5af7257309 Cleanup: whitespace 2015-08-06 13:03:07 +10:00
Antony Riakiotakis
89edddb26c Fix T45691 crash on material view
Call glProgramUniform1i only when OpenSubdiv is requested and only when
the GPU supports it.
2015-08-06 01:09:07 +02:00
Sergey Sharybin
4140312c36 OpenSubdiv: Make sure normals passed to OSD are all up to date
Solves shading artifacts with animated characters.
2015-08-05 19:19:05 +02:00
Sergey Sharybin
02f553cc7a OpenSubdiv: Changes to texturing
Use first material slot for until multiple materials are fully supported.

Also respect setMaterial()'s return value to avoid drawing unnecessary
geometry.
2015-08-05 18:29:43 +02:00
Sergey Sharybin
9a995c11d3 OpenSubdiv: Initial OsdMesh construction missed clearing out-of-date coords flag 2015-08-05 16:07:32 +02:00
Campbell Barton
5fe5118845 Cleanup: unused warning 2015-08-05 23:50:22 +10:00
Campbell Barton
5e050918d8 Fix dereference before NULL check 2015-08-05 23:47:13 +10:00
Sergey Sharybin
11bfeb45ce OpenSubdiv: Completely avoid possible access to non-existing CPU data
Make it so CCGDM reports 0 number of geometry when it uses GPU backend for
drawing. This screws up a bit statistics in info header and requires to have
some special handle of CCGDM in the drawing code, but makes it so non of the
areas will try to access non-existing geometry.
2015-08-05 15:11:50 +02:00
Sergey Sharybin
6146fdc7b0 OpenSubdiv: Edit mode was not checking for Use OpenSubdiv flag 2015-08-05 14:51:08 +02:00
Sergey Sharybin
0208c95986 OpenSubdiv: Correction to previous commit 2015-08-05 14:46:27 +02:00
Sergey Sharybin
6cba20a8e6 OpenSubdiv: Tweaks to AABB calculation when using opensubdiv for subsurf
Use coarse coordinates to calculate AABB which gives much better approximation
of AABB than using unity AABB size.
2015-08-05 14:43:51 +02:00
Sergey Sharybin
5b76f72904 Mirror modifier: Fix for wrong dependency relations
Mirror modifier was reporting that it depends on geometry of the object
used for mirror center which is incorrect -- only object matrix is needed
for modifier evaluation.
2015-08-05 14:29:18 +02:00
Sergey Sharybin
8d179e3c1f OpenSubdiv: Resolve regression with unity AABB for CCGDM calculated on CPU 2015-08-05 14:20:40 +02:00
Sergey Sharybin
0ea45676d0 OpenSubdiv: Fix crash happening when disabling Use OpenSubdiv option
The issue was caused by the changes from this morning.
2015-08-05 14:15:46 +02:00
Campbell Barton
c54df2ad47 Remove files from recent-files list on failed open 2015-08-05 21:26:10 +10:00
Campbell Barton
cae25ff240 Fix T45647: Incorrect results w/ color spill node 2015-08-05 21:26:10 +10:00
Sybren A. Stüvel
d4a9da28e8 Doc fix: rather then -> rather than 2015-08-05 12:48:04 +02:00
Campbell Barton
7853cb3c5a Remove redundant addition in BKE_mesh_calc_volume 2015-08-05 20:26:52 +10:00
Campbell Barton
a7442bef59 Fix selecting linked edges 2015-08-05 20:24:27 +10:00
Campbell Barton
25f381a9b2 Fix T45641: crash cutting meta-strips 2015-08-05 20:18:57 +10:00
Sergey Sharybin
80c50a1d49 OpenSubdiv: Make subsurf behavior closer to original one when built with OpenSubdiv but without enabling option 2015-08-05 11:55:06 +02:00
Julian Eisel
d39e18853f Nodes: Link lines & link arrows not scaling to DPI/pixelsize correctly 2015-08-04 21:56:43 +02:00
Sergey Sharybin
687a321be3 OpenSubdiv: Modifiers module missed WITH_OPENSUBDIV define 2015-08-04 18:32:21 +02:00
Sergey Sharybin
dfc672f8bb SCons: Fix for really nasty bug with polluting configuration environment
The issue was caused by the following construction:

  def = env['SOMETHING']
  defs.append('SOMETHING_MORE')

Since first assignment was actually referencing environment option it was totally
polluted hawing weird and wonderful side effects on all other areas of Blender.
2015-08-04 18:06:28 +02:00
Antony Riakiotakis
1fc32249f5 Fix fast navigate winding being incorrect (apparent when backface
culling was on)
2015-08-04 16:03:20 +02:00
Julian Eisel
4041e654cd Nodes: Make method to detect hovered link during transform more predictable/responsive
The old method:
The "old" method used the node dimensions to get a number of lines and checked if they intersect with the node link. Issue with this is that only a small part of the actual node surface is checked, making the method a bit unpredictable or unresponsive.

The new method:
The new method checks for intersections within the entire node surface. If multiple links are intersected, the node with the smallest distance from the *upper left corner* to the link is chosen.

Reviewed by @campbellbarton (tm)
2015-08-04 15:25:19 +02:00
Campbell Barton
07b525ffe2 Remove alloc checks in laplaciansmooth
These arrays aren't especially big or likely to fail.
2015-08-04 22:34:29 +10:00
Campbell Barton
4b6fba355c Remesh modifier has unnecessary MFace calculation 2015-08-04 22:11:43 +10:00
Campbell Barton
ae9ccec7c4 Missed from last commit 2015-08-04 22:08:21 +10:00
Campbell Barton
f1a9a8cbfd Remove MFace use w/ laplacian smooth
Use polygons for calculation
2015-08-04 21:58:35 +10:00
Sergey Sharybin
c1938eb127 OpenSubdiv: Report when OSD can't be enabled due to dependencies
Should be useful for debugging cases when enabling the option doesn't
cause any performance improvements.
2015-08-04 12:23:53 +02:00
Campbell Barton
cff288cf3a Use PyC_ParseBool to parse bools
This could cause problems since they could be any int,
then passed directly to internal functions that assume bools.
2015-08-04 18:49:42 +10:00
Campbell Barton
62c8f46ab6 Docs: comment functions in BLI & Py API 2015-08-05 02:09:03 +10:00
Mateo de Mayo
23f54076db BGE: Added getActionName() function to KX_GameObject()
It works similar to getActionFrame(), you have to give a layer or not (for layer 0) as the argument and it returns the name of the animation that the object is currently playing.

Example:

```
import bge
own = bge.logic.getCurrentController().owner
own.playAction("SomeAction",0,20)
print(own.getActionName())
```
>> SomeAction

Here is an example file, just open the blend file with the terminal opened
and press P, you can see how the current animation is being printed:
{F217484}

Reviewers: moguri, hg1, panzergame, campbellbarton

Reviewed By: panzergame

Subscribers: campbellbarton, hg1, #game_engine

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1443
2015-08-04 00:10:33 +02:00
Sergey Sharybin
73522e1157 OpenSubdiv: Fix/workaround for missing generated coordinates in viewport
This actually requires some bigger work to make it fully supported but
for now at least avoid breaking shading with OpenSundiv option disabled.
2015-08-03 20:39:00 +02:00
Sergey Sharybin
c2dc6aa946 OpenSubdiv: Smooth shading became broken in recent commit 2015-08-03 19:47:40 +02:00
Antony Riakiotakis
9b51a9e885 Sculpt: Fix tiling with brushes that use a locked plane
Patch by Tilman Blumhagen, thanks!
2015-08-03 19:41:34 +02:00
Antony Riakiotakis
2411027a79 Multires sculpting drawing optimization:
Use OpenGL 3.2 extension ARB_draw_elements_base_vertex, which allows us
to add offset in index buffer indices automatically. This should reduce
the number of draw calls significantly.

We may have some errors on the Mac with VBO setting off.
OSX OpenGL extensions don't play well with vertex arrays.
Will test that more later.

We might also use a full element buffer here, like we do when hiding
some quads, but this approach keeps the memory savings intended
originally.
2015-08-03 19:09:21 +02:00
Sergey Sharybin
7667ad2d4e OpenSubdiv: Made it a modifier option to enable OSD for viewport
The idea of this commit is to make it so we can enable OpenSubdiv by default
for the release builds but keep it limited to the viewport only for a specific
meshes. This is a temporary solution for until all the needed features are
supported on the OpenSubdiv side.

Flag itself is done as a dedicated field in modifier DNA so we can easily
remove it in the future without ending up with some temporary flag hanging
around forever.
2015-08-03 17:51:18 +02:00
Antony Riakiotakis
e90fea72c1 Fix T45654 fast navigate artifacts.
Was overdrawing the buffer, in case of fast drawing just use one
draw call. Should also make performance quite smoother.

Note:
Just discovered we are doing one draw call - per grid - in multires
apparently to keep reusing the same element buffer.
This is horribly, dreadfully slow and will check about fixing it later.
2015-08-03 17:47:03 +02:00
Sergey Sharybin
e5f7b0f330 OpenSubdiv: Avoid crashes when GPU subsurf is tried to be used on CPU
The issue was caused by CCG code being confused by number of geometry returned
by utility functions in the case of the skipped grids.

Made it so that code is always only working with CCG data and handled drawing
code in a bit special way now.

This solves such crashes as i.e. snapping.
2015-08-03 16:44:46 +02:00
Sergey Sharybin
4a0f3bece3 OpenSubdiv: Make new geometry relations ensures dependent data exists on CPU 2015-08-03 16:04:33 +02:00
Sergey Sharybin
7cfb05dcb0 OpenSubdiv: Resolve crashes when other object depends on subsurf-ed object
Cases like using subsurfed object as a boolean operand can't be evaluated
on GPU and needs to have all the CCG on CPU.

This commit resolves existing configuration to survive, but new configurations
would need to have some sort of forced object update so all the data is being
moved on CPU if it was previously on GPU.
2015-08-03 15:57:22 +02:00
Sergey Sharybin
b4e1b7b18c OpenSubdiv: Remove workaround for simple subdivision mode
This case is now supposed to be supported by OpenSubdiv.
2015-08-03 15:30:25 +02:00
Sergey Sharybin
b26eb47961 OpenSubdiv: Corrections to GLSL version
Was own mistake in the last minute fixes, now matcaps should
work just fine.
2015-08-03 15:27:42 +02:00
Campbell Barton
9036fa6b2e Fix buffer overrun lofting nurbs 2015-08-03 23:18:09 +10:00
Campbell Barton
1d549530d8 Fix own mistake in curve refactor 2015-08-03 23:06:03 +10:00
Sergey Sharybin
8d945bf3cb OpenSubdiv: More proper loop for UV map evaluation on CPU
This is just updating code from our side, actual evaluation is still
disabled because it doesn't support face farying data evaluation.
2015-08-03 14:50:31 +02:00