Commit Graph

420 Commits

Author SHA1 Message Date
Sergey Sharybin
fbcf05f443 Depsgraph: Copy-on-write component does not depend on itself 2017-08-30 11:15:58 +02:00
Sergey Sharybin
d34dac1070 Depsgraph: Fix crash when ungrouping node group
We shouldn't tag both COW and shading parameters ocmponents for update at
the same time.
2017-08-29 17:12:43 +02:00
Sergey Sharybin
9deccce07d Depsgraph: Fix missing material update when driving property in a group 2017-08-29 17:03:07 +02:00
Sergey Sharybin
852d702da0 Fix possibly missing flushes back to copy-on-write operation
Could have happened if multiple tags per object happens.
2017-08-29 16:28:06 +02:00
Sergey Sharybin
f846846941 Depsgraph: Fix missing updates when tweaking node tree parameters
The is following: split copy on write update for node trees, and if we are only
tagging for uniform buffer update we skip whole datablock copy and only invoke
copy default_values form original nodetree to a copied one.

Thing which i'm not sure is: whether we need to use different branches in graph
itself to control such a conditional behavior, or whether we need to store tag
somewhere in the dependency graph. There are obviously cons and pros in both
approaches, and need to think about this. Maybe with more examples it becomes
more obvious which way is better.

This only fixes manual tweaks for now, animation support is coming.
2017-08-29 12:58:55 +02:00
Sergey Sharybin
83ea224a7f Depsgraph: Fix missing updates when changing node tree topology
There were two issues here:

1. material_update did not do anything, because DEG_id_tag_update was storing
   update tags in original IDs, which had nothing evaluated. Even more, material
   update should have been called with evaluated version of material, Solved
   this by copying update tag from original ID to a copied one.

   However, perhaps DEG_id_tag_update should tag both original and copied ID,
   so updates are never gets lots if some depsgraph is not visible.

2. Tagging material for update should ensure it's copied version of node tree is
   up to date, otherwise material will still use old node tree.

This solves missing material updates when changing topology. Tweaking values is
still broken, because of GPUMaterial using pointer to original node's socket
value, which gets broken after copy-on-write of the node tree (pointers of nodes
are changing).
2017-08-29 11:32:25 +02:00
Sergey Sharybin
156c0ab255 Depsgraph: Don't case ID_Type to short 2017-08-28 11:51:53 +02:00
Sergey Sharybin
52dd5c5fcf Merge branch 'master' into blender2.8 2017-08-28 11:44:39 +02:00
Sergey Sharybin
b4b1397ad9 Depsgraph: Don't cast ID_Type to short 2017-08-28 11:43:36 +02:00
Sergey Sharybin
49e7b77b19 Depsgraph: Pass copy-on-write pointer to material update
Unfortunately, there is something else wrong going on here, which makes objects
black after tweaking material settings.
2017-08-28 11:00:42 +02:00
Sergey Sharybin
33f9b6d016 Depsgraph: Fix crash editing mesh in edit mode 2017-08-24 16:01:08 +02:00
Sergey Sharybin
97fadb7b59 Depsgraph: Cleanup typo 2017-08-24 15:52:52 +02:00
Sergey Sharybin
a679457263 Fix T51907: New Depsgraph - Camera constraint is not evaluated properly
This is more a workaround for until we've got proper visibility flush, which
will likely happen in blender2.8 branch.
2017-08-24 14:35:48 +02:00
Sergey Sharybin
9cfb72ff81 Merge branch 'master' into blender2.8 2017-08-22 16:31:33 +02:00
Sergey Sharybin
9f40153094 Fix T52209: New Depsgraph - animated follow curve constraint sometimes freaks out when the curve has a parent 2017-08-22 16:27:33 +02:00
Sergey Sharybin
f3e02eb32e Depsgraph: Cleanup, make code friendlier to be edited in columns 2017-08-22 16:24:58 +02:00
Sergey Sharybin
c80ab62aee Depsgraph: Remove placeholder for path evaluation
Wasn't used in years, if it really needs to be dedicated operation it needs to
be revisited anyway.
2017-08-22 16:12:01 +02:00
Sergey Sharybin
1155fc94fd Fix T52454: Crash in DEG_graph_on_visible_update when activating scene layer
Most likely needs in 2.79 final release.
2017-08-22 12:53:34 +02:00
Dalai Felinto
2b95617b15 Update code comments from DAG_id_tag_update to DEG_id_tag_update 2017-08-16 12:00:45 +02:00
Dalai Felinto
18ce2bfac6 Depsgraph/Layers: Keep original visibility when doing full scene copy
Originally we were not respecting the original visibility flags of the
collections. However this is required for Copy-on-write (CoW).

Remember to update the svn lib tests folder. I had to update some of the
json files there.

Also adding a new unittest for this particular issue:
Test render_layer_scene_copy_f
2017-08-16 10:35:26 +02:00
Campbell Barton
ac17f29b2f Cleanup: quiet warnings 2017-08-12 14:07:26 +10:00
Campbell Barton
ccb8e78d6c Cleanup: whitespace 2017-08-12 13:43:40 +10:00
Bastien Montagne
e8b6bcd65c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/editors/object/object_add.c
	source/blender/python/intern/bpy_app_handlers.c
2017-08-08 16:43:25 +02:00
Sergey Sharybin
90b3dba515 Fix T52255: New Depsgraph - Constraint and Drivers not working together when the driver references itself 2017-08-08 15:27:25 +02:00
Sergey Sharybin
126830b56c Depsgraph: Cleanup, make it easier to debug on laptop 2017-08-08 15:27:25 +02:00
Bastien Montagne
e673c9dc93 Merge again... 2017-08-07 20:48:22 +02:00
Sergey Sharybin
c27446b5a0 Depsgraph: Fix wrong data type used for armature tag
Spotted by Ray aka LazyDodo, thanks!
2017-08-03 08:19:13 +02:00
Sergey Sharybin
50cc0aa0d1 Depsgraph: Re-use evaluated mesh across frames and remove time dependency from all CoW components
This commit is a work forward having less updates during playback, which speeds
things up a lot here. The idea is simple: stop update all copy-on-write
datablocks (which implies full re-evaluation actually) on frame change and
re-use existing evaluated meshes as much as possible.

This brings playback speed to 24 fps on the dino test scene here. Performance
drops down a lot when armature is animated tho, but that's because of need of
tangent space calculation which we can't do much about from just a dependency
graph.

Hopefully this doesn't make copy-on-write too unstable, quick tests here are
surviving fine.
2017-07-28 12:27:34 +02:00
Sergey Sharybin
549f43e928 Depsgraph: Attempt to keep evaluated mesh when possible
Currently wouldn't make any difference, but required for upcoming work of
getting rid of time dependency for copy-on-write component.
2017-07-27 15:19:37 +02:00
Sergey Sharybin
6ef34525a1 Depsgraph: Cleanup, variable name 2017-07-27 15:19:37 +02:00
Sergey Sharybin
e90468e5a3 Depsgraph: Cleanup, use some utility functions to shorten construction code
Still some cleanup is possible.
2017-07-27 15:19:36 +02:00
Sergey Sharybin
cf38371155 Depsgraph: Create ID nodes on build-time expansion using node builder
This will allow us to do some builder-specific trickery when ID nodes are
requested to be created from build-time expansion.
2017-07-27 15:19:36 +02:00
Sergey Sharybin
55527d83e2 Depsgraph: Allow stealing copy-on-written pointer
This will become handy when we'll be re-using evaluated meshes for
objects after relations are updated.
2017-07-27 15:19:36 +02:00
Sergey Sharybin
3441af49bd Depsgraph: Fix possibly missing lamp update when lamp data changes 2017-07-27 15:19:36 +02:00
Sergey Sharybin
41a3aafd48 Depsgraph: Make it possible to use given pre-allocated ID as a copy 2017-07-27 15:19:36 +02:00
Sergey Sharybin
2b8f50e1d4 Depsgraph: Fix crash happening in copy-on-write of images
Was a threading conflict or so in the cache limiter, and in fact
we don't even want images to be copied.
2017-07-27 13:26:21 +02:00
Sergey Sharybin
f8bd6adee2 Depsgraph: Skip iterating over all ntree users on node tree parameter update
Also make sure drivers on node tree properties will work correctly for viewport.
2017-07-27 11:50:14 +02:00
Sergey Sharybin
a01c1849e9 Depsgraph: Add utility function to initialize evaluation context from scene and layer 2017-07-26 16:33:44 +02:00
Sergey Sharybin
80e03e7709 Depsgraph: Support changing scene's render engine 2017-07-25 15:11:51 +02:00
Sergey Sharybin
f7636f0ef2 Depsgraph: Make sure armature mode is properly changed in all copied versions 2017-07-25 14:53:19 +02:00
Sergey Sharybin
6a7d7586e5 Depsgraph: Initial support of pose mode for copy-on-write armature
Some basic code, makes it possible to pose existing armature.

Probably still lots of corner cases to cover, but need to start somewhere.
2017-07-25 14:38:10 +02:00
Sergey Sharybin
762fa7bee3 Depsgraph: Remove unsued node flag 2017-07-25 14:06:36 +02:00
Sergey Sharybin
ff6e8b0b50 Depsgraph: Avoid assert failure in some harmless cases 2017-07-24 17:41:29 +02:00
Sergey Sharybin
34b248b746 Depsgraph: Synchronize collection visibility after copy
BKE_scene_copy explicitly ignores visibility of "source" collections make all
collections visible. This is also tested by regression tests.

While it seems more logical to simply preserve all possible visibility flags
and overrides, don't feel like submitting to a behavior-changes without talking
to author of those guards first.

This commit fixes cycles material preview.
2017-07-24 17:03:53 +02:00
Sergey Sharybin
b3466921b8 Depsgraph: Fix typo in comment 2017-07-24 16:32:07 +02:00
Sergey Sharybin
b11926487f Depsgraph: Fix crash when trying to create full copy of scene 2017-07-24 16:24:41 +02:00
Sergey Sharybin
1ddb3c953d Depsgraph: Textures and images are actually covered by depsgraph
Might be missing relation links tho.
2017-07-24 16:24:41 +02:00
Sergey Sharybin
deecfb5476 Depsgraph: Avoid creating ID nodes for objects which are coming from collections and not layers
If object is only listed in collection but not added to any of layers we shouldn't create
placeholder for it, because otherwise we'll leave lots of placeholder ID nodes.

Question: can we make this exception to be more reliable?
2017-07-24 16:24:41 +02:00
Sergey Sharybin
7b420e1908 Depsgraph: Be consistent about id type variable name 2017-07-24 16:24:41 +02:00
Sergey Sharybin
7721f8a269 Depsgraph: Cleanup, use utility function to clear lists 2017-07-24 16:24:41 +02:00