Commit Graph

1060 Commits

Author SHA1 Message Date
Campbell Barton
9536f920e3 Cleanup: style 2018-07-10 09:29:30 +02:00
Sergey Sharybin
5a56e4997f Depsgraph: Fix non-working drivers after recent relations change 2018-07-09 17:42:36 +02:00
Sergey Sharybin
d37929c85b Depsgraph: Force modifier stack update when mesh is copied
Modifier stack might reference arrays from mesh, so if any of sub-data
pointer changed, modifier stack is to be re-evaluated.
2018-07-09 14:42:56 +02:00
Sergey Sharybin
f84956738b Depsgraph: Forbid flush from copy-on-write operations down the road
Old behavior: tagging ID with DEG_TAG_COPY_ON_WRITE will do copy-on-write
(as requested), but will also flush changes to all operations with depends
on it. This means, for example, tagging object for copy-on-write will force
its modifier stack to be evaluated.

This was needed in the earlier days of copy-on-write when things were not
well defined and when lots of areas were not doing proper tagging.

New behavior: tagging ID with DEG_TAG_COPY_ON_WRITE will only ensure copy
of the dadatblock is up to date, without flushing updates to any dependencies.

This means following things:

- We can update parts of ID without invoking heavy computation of other
  parts of same ID. For example, tagging object for COPY_ON_WRITE update
  on mode change will not force modifiers stack to update.

- If some dependent datablock is dependent on pointers which are invalidated
  by copy-on-write (like, evaluated mesh referencing custom data layers from
  original mesh), this will either require explicit tag or explicit relation
  in the dependency graph.

  Currently can not find a faulty case since tagging of mesh happens with
  either 0 (which means, everything) or with GEOMETRY, which also forces
  all dependent modifier stacks to be re-evaluated.

This fixes missing PBVH when going into sculpt mode (sculpt mode toggle
was tagging object for COPY_ON_WRITE update, which was forcing modifier
stack to be updated, which was freeing PBVH.

Some other operations might also become faster with this change.
2018-07-09 14:42:56 +02:00
Brecht Van Lommel
74fd17e9d7 UI/Python: rename Lamps to Lights, to follow more standard terminology.
Internally it's still mostly named lamps, though some modules like Cycles
were already calling them lights.
2018-07-06 20:06:09 +02:00
Sergey Sharybin
15f4aa182f Depsgraph: Relations builder should not tag ID in all depsgraphs 2018-07-06 14:46:35 +02:00
Sergey Sharybin
5db711fdd9 Depsgraph: Preserve engine data when doing object copy on write update 2018-07-05 16:56:47 +02:00
Sergey Sharybin
7c47b338c0 Depsgraph: Don't force copy-on-write when shading changes
Shading is supposed to be dealing with draw manager batch cached
thingamajigs, but was causing full object update.

This was causing both flickering in sculpt mode (PBVH was removed,
why it was SOMETIMES restored before draw is a mystery), and was
also causing things to be really slow.
2018-07-04 16:44:44 +02:00
Sergey Sharybin
56ace4b209 Depsgraph: Log entry operations which are directly modified and tagged 2018-07-04 16:44:44 +02:00
Campbell Barton
39678442e1 Cleanup: typos 2018-07-03 09:22:02 +02:00
Sybren A. Stüvel
4626ca47b9 Prevented depsgraph errors when RigidBody Constraint is incomplete 2018-06-28 14:20:11 +02:00
Sergey Sharybin
08b105654d Depsgraph: Move time dependency to animation of action
This way we guarantee that animation component on the datablock will
totally wait for action to be fully evaluated before attempting to
evaluate f-curves.

Fixes T55642: Inconsistent result on animated DoF file
2018-06-27 16:35:06 +02:00
Sergey Sharybin
3766b93853 Depsgraph: Add missing relation to pose init
Pose init initializes inversed object matrix, which means it does
need to have proper object transform.
2018-06-27 16:35:06 +02:00
Sergey Sharybin
05bcb2d5f5 Depsgraph: Fix missing relation from action to animation when it's shared 2018-06-27 16:35:06 +02:00
Campbell Barton
29182dd570 Cleanup: style 2018-06-26 08:35:35 +02:00
Brecht Van Lommel
c2110213ca Physics: update softbody and dynamic paint to get colliders from depsgraph.
Because looping over the scene is unsafe and slow.
2018-06-25 17:15:07 +02:00
Brecht Van Lommel
2c9b32949b Cleanup: refactor depsgraph physics API functions. 2018-06-25 17:15:07 +02:00
Brecht Van Lommel
817bf582c2 Cleanup: rename object base flags to be more clear. 2018-06-25 14:09:17 +02:00
Brecht Van Lommel
a99dcab148 Depsgraph: cache collision relations, for performance and stability.
Same reasoning as effector relations in earlier commit.
2018-06-25 13:35:41 +02:00
Campbell Barton
29c1069244 Cleanup: code style 2018-06-25 12:06:51 +02:00
Sergey Sharybin
7a4d5b78ea Depsgraph: Add missing nodes and relations for speaker 2018-06-25 11:54:12 +02:00
Brecht Van Lommel
cc4dc2dce2 Depsgraph: cache effector relations, for performance and stability.
To find all effectors in the scene, we need to loop over all objects.
Doing this during depsgraph evaluation caused crashes because not all
objects are guaranteed to be evaluated yet.

To fix this, we now cache the relations as part of the dependency graph
build. As a bonus this also makes evaluation faster for big scenes,
since looping over all objects for each particle system is slow.

Fixes T55156.
2018-06-22 17:57:22 +02:00
Brecht Van Lommel
991d4f1c6b Fix incorrect use of G.is_rendering for particles in some places. 2018-06-21 17:08:42 +02:00
Sergey Sharybin
b350edc207 Depsgraph: Add missing relation from proxy group
Transform evaluation does depend on that matrix, but relation was never
in dependency graph. It was not even in the old dependency graph, which
makes me wonder how this thing worked reliably to begin with.

Should fix flickering issue in the render farm.
2018-06-21 15:57:24 +02:00
Sergey Sharybin
a0f1bd8ed1 Depsgraph: Re-hook duplicgroup relation to final transform operation
Transform evaluation doesn't not depend on objects which are being duplicated,
so should not be any regressions here.

The whole relation should probably be gone as it's kind of rooting back to
legacy times, but that would need more clear research and investigation and
regression testing.
2018-06-21 15:57:24 +02:00
Sergey Sharybin
ad42c358f8 Depsgraph: Walk into dupli_group object
That will help with cases when dupli_group object is not linked
directly to the scene.
2018-06-21 15:57:24 +02:00
Brecht Van Lommel
40e1e8ebed Despgraph: don't tag for transform/geometry update on relations rebuild.
This should already be happening elsewhere and was causing depsgraph
rebuild to be slower than it should.
2018-06-20 18:12:48 +02:00
Brecht Van Lommel
984a78e763 Fix crash opening some files, after recent changes. 2018-06-20 13:42:23 +02:00
Brecht Van Lommel
5e968a996a Objects: restore per object restrict view/render/select.
Note this is now separate from H key hiding, and meant for more persistent
ways to define which objects are relevant to the viewport or render.

This avoids some cases where you'd have to create collection specifically
to hide objects for viewport/render.
2018-06-20 12:35:25 +02:00
Sergey Sharybin
4330027895 Depsgraph: Cleamup, reduce indentation level 2018-06-18 10:23:03 +02:00
Sybren A. Stüvel
ed3d693cb1 Dependency graph fixes for RigidBodyWorld
- rbw->group added to the depsgraph.
- Mesh evaluation added when necessary.
- Prevent of double-free by freeing the scene before objects.
2018-06-15 17:15:42 +02:00
Sergey Sharybin
00eeb05f4c Depsgraph: Make certain components NOT tag copy-on-write when they are tagged
Currently done for mesh batch cache update, and for base flags sync.
Those components do not need anything from original object, and hence
can skip CoW tag and have faster update after them used.
2018-06-14 16:04:09 +02:00
Sergey Sharybin
42d8872014 Depsgraph: Use dedicated ocmponent for object's base flags flush 2018-06-14 16:04:09 +02:00
Sergey Sharybin
64aadc7c7d Depsgraph: Avoid use of 0 tag flag on build finish
Use all the explicit tagging. Solves characters being in T-pose after
opening specific scene files.
2018-06-13 09:49:14 +02:00
Brecht Van Lommel
77879ac038 Fix T55376: instanced collection render visibility ignored.
For physics simulation it's still fuzzy though, but this needs bigger
design for how it works with view layers and visibility.
2018-06-12 22:36:43 +02:00
Sergey Sharybin
39e050af40 Fix T55409: Can't animated keyframed material node value after moving keyframe on timeline
Completely ignore animation for legacy zero update tag.

If one needs animation to be evaluated, tag with proper update tag, stop relying
on direct assignment of adt->>recalc with zero update tag for DEG.

This commit might cause missing updates when needed, those needs to be looked
into once they happen.
2018-06-12 15:39:11 +02:00
Sergey Sharybin
0d817e68ef Depsgraph: Add debug option to invalidate data tagged for update
See comment for INVALIDATE_ON_FLUSH.
2018-06-12 14:30:50 +02:00
Sergey Sharybin
3263e5e881 Depsgraph: Set temp object to invalid state as soon as it becomes inaccessible 2018-06-12 14:30:50 +02:00
Sergey Sharybin
abdea5754e Depsgraph: Cleanup, wrap private functions to an anonymous namespace 2018-06-12 14:30:50 +02:00
Brecht Van Lommel
05111d79d0 Cleanup: remove unused DAG_EVAL_PREVIEW mode. 2018-06-11 17:06:28 +02:00
Dalai Felinto
df72101631 Revert unintended changes to depsgraph
This partially reverts f8d7df6f16.
I committed this bit by mistake.
2018-06-11 11:33:09 +02:00
Campbell Barton
5159ce640f Cleanup: style 2018-06-09 16:39:40 +02:00
Dalai Felinto
f8d7df6f16 Depsgraph: Remove no longer needed nodetree values copying on eval
Note: Depsgraph still calls the nodetree eval function that doesn't
nothing in turn. We can remove it, but it is harmless though.
2018-06-08 17:52:49 +02:00
Sergey Sharybin
1f1e26f1ab Depsgraph: Fix missing relations when camera has drivers 2018-06-08 12:04:53 +02:00
Sergey Sharybin
d38c7db5e1 Depsgraph: Cleanup, make conditions more clear and less indented 2018-06-08 11:57:16 +02:00
Sergey Sharybin
4017b48331 Depsgraph: Don't optimize out collections used by duplication system
This makes evaluated objects to point to a non-evaluated collection,
which is already really bad. What is even more worse, objects in those
collections are not evaluated either.

Proper solution would be to implement visibility flag for nodes, which
will be set to 0 for transform/geometry components, but which will be
1 for copy-on-write components.

This way we will guarantee consistency of dependency graph.

For now this change is good enough and unlocks production.

Fixes T55375: Crash when changing visibility of instanced collection
Fixes T55357: Particle geometry crash
2018-06-08 11:57:16 +02:00
Sergey Sharybin
378e42e119 Depsgraph: Cleanup, indentation 2018-06-08 11:57:16 +02:00
Sergey Sharybin
9600c7cb05 Depsgraph: Cleanup, make conditions more clear and less indented 2018-06-08 11:57:16 +02:00
Sergey Sharybin
30ec94561c Depsgraph: Use more proper relations for scene relation 2018-06-07 14:41:29 +02:00
Campbell Barton
ba80d8440f Cleanup: style 2018-06-06 22:17:06 +02:00