Commit Graph

51791 Commits

Author SHA1 Message Date
Sergey Sharybin 08981f3a91 Fix T37886: Material does no update when changing keyframes in dopesheet
It was a missing fcurve evaluation in scene update function which lead to
materials only being updated on frame change.

Added the same exception as we've got for the scene animation. It only
runs when there're materials tagged for the update, so wouldn't expect
speed regressions or so.
2014-01-13 19:02:23 +06:00
Sergey Sharybin b1bb7d2ee0 Fix T38040: Crash after loading big image file in compositor
Issue was caused by cache limitor removing viewer image buffer
from the memory during compositing. Now made it so all viewer
images are persistent in the memory.

This solves the crash mentioned above and also makes it so
render/compo results are never lost.

Further tweaks are possible, but pretty much happy now, at
least no stoppers for work are there.
2014-01-13 18:47:15 +06:00
Campbell Barton daedf5be8c UI Icons: use a python script rather then a shell (for non unix systems) 2014-01-13 23:18:25 +11:00
Sergey Sharybin 2ebe4f69a9 Compilation error fix and strict warning silence for previous commits 2014-01-13 16:33:18 +06:00
Sergey Sharybin a8b3abc7fc Remove direct lattice modifiers calc from the drawing code
Same as mballs and curves it was only to work around DAG stupidness
which hopefully was fixed in one of the previous commits.

From quick tests everything works fine, if something is broken now
poke me to find a proper solution.
2014-01-13 16:29:07 +06:00
Sergey Sharybin d01bb0b8b6 Avoid memcpy to self when validating UV layer name 2014-01-13 16:27:05 +06:00
Sergey Sharybin 63095e492b Remove direct mball creation from object conversion
Same as previous commit, mball shall be visible before conversion
meaning it is to be evaluated already.
2014-01-13 16:20:20 +06:00
Sergey Sharybin b82cce04d6 Remove direct mball creation from the drawing code
This is the same case as curves, and really this is now
totally up to DAG, If something fails, poke me to fix the DAG.
2014-01-13 16:18:08 +06:00
Sergey Sharybin 881fb43878 Make bvhutil safe for multi-threaded usage
There were couple of reasons why it wasn't safe for usage from
multiple threads.

First of all, it was trying to cache BVH in derived mesh, which
wasn't safe because multiple threads might have requested BVH
tree and simultaneous reading and writing to the cache became a
big headache.

Solved this with RW lock so now access to BVH cache is safe.

Another issue is causes by the fact that it's not guaranteed
DM to have vert/edge/face arrays pre-allocated and when one
was calling functions like getVertDataArray() array could
have been allocated and marked as temporary. This is REALLY
bad, because NO ONE is ever allowed to modify data which
doesn't belong to him. This lead to situations when multiple
threads were using BVH tree and they run into race condition
with this temporary allocated arrays.

Now bvhtree owns allocated arrays and keeps track of them, so
no race condition happens with temporary data stored in the
derived mesh. This solved threading issues and likely wouldn't
introduce noticeable slowdown. Even when DM was keeping track
of this arrays, they were re-allocated on every BVH creation
anyway, because those arrays were temporary and were freed
with dm->release() call.

We might re-consider this a bit and make it so BVH trees are
allocated when DM itself is being allocated based on the DAG
layout, but that i'd consider an optimization and not something
we need to do 1st priority.

Fixes crash happening with 05_4g_track.blend from Mango after
the threaded object update landed to master.
2014-01-13 15:57:52 +06:00
Sergey Sharybin bc989497de Fix T38139: Objects which are in cyclic dependency are not updated
Graph traversal which is based on counting parents which are still
to be updated fails in cases there are cycles in the graph.

If there are cyclic dependencies in the scene all the objects from
the cycles will be updated in a single thread now one by one. This
makes blender behave the same way as it was before multi-threaded
DAG landed to master.

This needed to tweak depsgraph a bit so now dag_check_cycle() sets
is_acyclic field of DAG forest if there are cycles in the graph.

TODO: It might be possible to save some time on evaluation when
      all the tagged objects were updated in multi-threaded DAG
      traversal.
2014-01-13 15:57:51 +06:00
Sergey Sharybin e618d8238e Fix T38054: High CPU usage with many objects
This is a regression since threaded dependency graph landed to master.
Root of the issue goes to the loads of graph preparation being done
even if there's nothing to be updated.

The idea of this change is to use ID type recalc bits to determine
whether there're objects to be updated. Generally speaking, we now
check object and object data datablocks with DAG_id_type_tagged()
and if there's no such IDs tagged we skip the whole task pool creation
and so,

The only difficult aspect was that in some circumstances it was possible
that there are tagged objects but nothing in ID recalc bit fields.

There were several different circumstances when it was possible:

* When one assigns object->recalc flag directly DAG flush didn't
  set corresponding bits to ID recalc bits. Partially it is fixed
  by making it so flush will set bitfield, but also for object
  types there's no reason to assign recalc flag directly. Using
  generic DAG_id_type_tag works almost the same fast as direct
  assignment, ensures all the bitflags are set properly and for the
  long run it seems it's what we would actually want to.

* DAG_on_visible_update() didn't set recalc bits at all.

* Some areas were checking for object->recalc != 0, however it is was
  possible that object recalc flag contains PSYS_RECALC_CHILD which
  was never cleaned from there.

  No idea why would we need to assign such a flag when enabling
  scene simplification, this is to be investigated separately.

* It is possible that scene_update_post and frame_update_post handlers
  will modify objects. The issue is that DAG_ids_clear_recalc is called
  just after callbacks, which leaves objects with recalc flags but no
  corresponding bit in ID recalc bitfield. This leads to some kind of
  regression when using ID type tag fields to check whether there objects
  to be updated internally comparing threaded DAG with legacy one.

  For now let's have a workaround which will preserve tag for ID_OB
  if there're objects with OB_RECALC_ALL bits. This keeps behavior
  unchanged comparing with 2.69 release.
2014-01-13 15:57:51 +06:00
Sergey Sharybin ac077f016d Remove direct displist creation from array modifier
First of all, it was needed to have that set scenes fix which
was done recently so curve is being evaluated properly on file
load.

And last but not least, also needed to tag DAG node to evaluate
path regardless to curve datablock settings so curve length is
always known.
2014-01-13 15:57:51 +06:00
Sergey Sharybin ce7e6cebf2 Remove direct displist creation from constraints
Since recent DAG commit for set scenes in DAG_on_visible_update()
it seems there're no longer issues with missing curve_cache after
file load.
2014-01-13 15:57:51 +06:00
Sergey Sharybin f00f959d52 Remove direct displist creation from curve deform
This solves threading conflict which happens when having
multiple objects using Curve Deform modifier with the same
curve datablock. This conflict was caused by the fact that
curve_deform_verts() used to temporary override curve's
flags to make it path is there.

Actually, it was setting CU_FOLLOW flag temporary which
was only used where_on_path() (only in terms that this
temporary assignment only affected this function) but it
is now commented out for a while, so no reason to set
this flag temporary, If it's ever to be done, we'll need
to pass flags as an additional function argument.

For the path creation i've extended DegNode structure
which now holds extra bits which indicates what additional
data depending on the graph topology is to be evaluated.

Currently this is only used to indicate that curve needs
path to be evaluated regardless to cu->flag state. This
is so Curve Deform modifier is always happy.

In the future this flag might also be used to indicate
whether bmesh verts are to update (see recent commit to
3-vertex parent crash fix) or to indicate that the object
is the motherball etc.
2014-01-13 15:57:51 +06:00
Sergey Sharybin f86fbc4ea3 Remove direct displist creation from BKE_vfont_to_curve_ex()
This goes back to ancient era again and such a call isn't
safe for threading and really DAG is to make it sure display
list for dependencies is always there.
2014-01-13 15:57:51 +06:00
Sergey Sharybin 9d88203101 Code cleanup: no need to check display list elements in texture space match 2014-01-13 15:57:51 +06:00
Sergey Sharybin 405cab9663 Remove direct displist creation from object conversion
If the object is visible and editable it means there's no
way DAG to fail to create needed display lists.
2014-01-13 15:57:50 +06:00
Sergey Sharybin b5592d86d6 Remove direct displist creation from bevel code
BKE_curve_bevel_make() is only used from object_handle_update()
friends and never called directly. This means if there's no
display list ready for the bevel object it's something wrong
happened with DAG.

In fact, this check goes back to ancient era and from tests
it appears this check is no longer needed.
2014-01-13 15:57:50 +06:00
Sergey Sharybin ba15dd595f Remove direct displist creation from drawing code
It was some kind of workaround for DAG glitch in 2009
(commit hash 8c5c7ebb0) and according to the comment
was needed to make select outline show immediately.

After some tests it appears DAG behaves almost fine now
(just needed to make it so layer is flushed properly to
the set scene) and no reason to have rather confusing
call in the code.
2014-01-13 15:57:50 +06:00
Andrew Buttery 9386559db0 UI: remove create new directory popup for button in file browser header.
We do keep it when typing an new directory name in the directory text field.

Reviewed By: brecht, billrey

Differential Revision: https://developer.blender.org/D188
2014-01-13 10:45:14 +01:00
Campbell Barton 7ae1949517 Select Random: add option to de-select
also made metaball operator behave like the others.

Path originally from Walid Shouman, with own edits.
2014-01-13 20:39:12 +11:00
Marcus von Appen f0fb60f8c9 Fix cycles standalone compile on some systems, CMAKE_DL_LIBS should be enough.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D205
2014-01-13 10:36:02 +01:00
Campbell Barton 61ff3dfdda Code Cleanup: spelling 2014-01-13 15:31:57 +11:00
Antony Riakiotakis 717bf85545 Fix some harmless warnings that mostly appeared on MinGW64 2014-01-13 04:28:51 +02:00
Howard Trickey c925b5bbb2 Bevel fixes for profiles: better way to calculate.
It is better to keep the profile as it is perpedicular
to the edge, and then project it onto a given plane
at the corners. Also fixed the interpolation to a
different number of segments when the profile is not
round.
2014-01-12 14:10:39 -05:00
Bastien Montagne d785c64397 Fix T38124: Grease Pencil Line thickness
Issue was in GP draw code: line thickness was not initiated properly (and a null one makes OGL draw a unity-width line).

Also tweaked threshold (when to start a new, width-different OGL linestrip), to make it inversaly proportional to thickness
(so that now, it's 0.2 for a thickness of 1, 0.1 for a thickness of 2, etc.), avoids too big steps when using large thickness.
2014-01-12 19:03:38 +01:00
Bastien Montagne 190809d8ab UIList tweak: make active item visible when it changes somehow (useful e.g. when weight-paintings a rigged mesh). 2014-01-12 15:59:04 +01:00
Sv. Lockal d6c022d6d7 Fix compilation for OpenCL (and small stype fixes) 2014-01-12 18:18:43 +04:00
Sv. Lockal 47c5898fa1 Cycles: SSE for Voronoi textures (targeted for Haswell CPUs)
Gives up to 15% speedup scenes with voronoi-based textures (up to 25% with volumes) on Haswell. The performance change for other CPUs is much smaller: 1-2%.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D203
2014-01-12 18:14:00 +04:00
Campbell Barton fc39e895e9 Style Cleanup: whitespace 2014-01-12 22:27:55 +11:00
Campbell Barton 62aa004c25 Style Cleanup: whitespace 2014-01-12 22:05:24 +11:00
Thomas Dinges 74216cfdce UI: More consistency for T/N sidebars. Logic Editor Properties are on the right now as well, and File Browser Bookmark sidebar uses "T" key, as its on the right. 2014-01-12 01:00:16 +01:00
Andrew Buttery dc9fff74cc Fix T38160, N and T sidebars in Image Editor are swapped. Now the Properties are on the right side, which is consistent with other editors.
Differential Revision: https://developer.blender.org/D201
2014-01-12 00:50:43 +01:00
Andrew Buttery 9151f5d227 UI: Add a "New" button for the particle system, consistent to other areas like materials, world and textures.
Differential Revision: https://developer.blender.org/D171
2014-01-12 00:39:39 +01:00
Sv. Lockal da3fdf0b4b Code Cleanup: in Cycles SSE replace macros with templates, skip unused code with preprocessor, simplify casts 2014-01-11 22:20:03 +04:00
Sv. Lockal b886c26d1f Cycles: mix hair minimum width code with SSE intersection code
Gives 6.5% speedup for hair.blend from testsuite.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D197
2014-01-11 20:47:30 +04:00
Campbell Barton 5fc2fe9fad Code Cleanup: move MOUSEX/Y to BGE, describe INBETWEEN_MOUSEMOVE 2014-01-12 01:59:17 +11:00
Campbell Barton 50650e28ea Events: support for buttons 6 & 7 (some trackballs have these) X11 only
Patch by Marcus von Appen

Note: this patch makes ISMOUSE accept INBETWEEN_MOUSEMOVE as a mouse
event where before it didnt.
2014-01-12 00:40:23 +11:00
Campbell Barton 1a0c5eb83a Events: Use INBETWEEN_MOUSEMOVE for inactive windows too. 2014-01-12 00:30:16 +11:00
Campbell Barton 1bfa64895e Ghost: update multitest for changes in BLF 2014-01-11 23:53:23 +11:00
Bastien Montagne 8952f58375 Add tangent space computation/access from RNA (i.e. python).
This simply mimics code used for loopnormals, to enable py scripts to generate and access (temporary)
a tangent 3D vector and bitangent sign for each loop. Together with the split normals, this allow
to recreate a complete tangent space for normal mapping (bitangent = bitangent_sign * cross(normal, tangent)).

Expects all faces to be tri or quads.

Reviewed By: Brecht, campbellbarton

Differential Revision: https://developer.blender.org/D185
2014-01-11 11:51:19 +01:00
Campbell Barton 274b2590fb Image API: add frame argument to gl_load(), gl_touch()
patch D103 by Krantz Geoffroy
2014-01-11 21:25:20 +11:00
Campbell Barton c2508b6e1b Fix T38150: correct fix this time
also use fixed size lists for list creation.
2014-01-11 21:03:21 +11:00
Campbell Barton 3072d817d8 Scons: disable player along with game-engine. 2014-01-11 14:55:56 +11:00
Brecht Van Lommel 6d6bb2d130 Fix T38145: python error popup when pressing shift+Z in blender game mode. 2014-01-11 00:59:22 +01:00
Brecht Van Lommel 4d72a5e34a Fix T38129: cycles viewport render display with very bright colors turning black.
This happened when exceeding the maximum value representable by half floats.
2014-01-11 00:50:53 +01:00
Brecht Van Lommel 241fccaf6a Fix T37817: cycles CUDA detection problem on Windows with non-ascii paths. 2014-01-11 00:47:58 +01:00
Brecht Van Lommel 9e1ca28589 Fix T38149: crash adding metaball with zero radius.
This incorrectly use abs(), that's for integers, not floats.
2014-01-10 20:53:39 +01:00
Brecht Van Lommel bbab2ecd43 Fix clang warning for (harmless) use of uninitialized variable. 2014-01-10 19:43:31 +01:00
Brecht Van Lommel 79e040ba95 Fix T38143: pressing F12 key in the text editor on OS X would type an invalid character. 2014-01-10 19:41:01 +01:00