Commit Graph

1122 Commits

Author SHA1 Message Date
Alexander Gavrilov
e5b18390fa Shrinkwrap: implement the use of smooth normals in constraint & modifier.
- Use smooth normals to displace in Above Surface mode.
- Add an option to align an axis to the normal in the constraint.

I've seen people request the alignment feature, and it seems useful.
For the actual aligning I use the damped track logic.

In order to conveniently keep mesh data needed for normal
computation together, a new data structure is introduced.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D3762
2018-10-17 17:55:34 +03:00
Alexander Gavrilov
cd48d4576b Depsgraph: Add proper API functions for CustomDataMask dependencies.
There were a few copies of the same few lines in depsgraph build code,
so it seems to be logical to introduce a function for it, and make it
accessible from C code for completeness.

As an example, register the mask needs of the Data Transfer modifier.
2018-10-14 20:48:39 +03:00
Campbell Barton
1b910082a0 Edit Mesh: replace DerivedMesh w/ Mesh
DerivedMesh is now removed from edit-mesh modifier evaluation.
2018-10-09 17:48:28 +11:00
Sergey Sharybin
89264d8c40 Make struct initialization happy for CLang 2018-09-28 10:13:56 +02:00
Sebastian Parborg
a16e5b8efa Cleanup: remove unused DerivedMesh code.
Differential Revision: https://developer.blender.org/D3736
2018-09-27 20:19:28 +02:00
Sergey Sharybin
c0b9a4a86e Depsgraph: Add missing relation for spline IK
Solver should clearly depend on initializaiton.
2018-09-26 18:16:55 +02:00
Ray Molenkamp
3e86cfa1ff depsgraph: re-Fix 32 bit shift bug in get_visible_components_mask.
1UL << n still results in a 32 bit result, 1ULL << n actually retains all 64 bits.

fixes stupid typo in rBbd51cada8db64e45cabca66cd61438c1ae2bdf25
2018-09-25 10:12:58 -06:00
Ray Molenkamp
bd51cada8d depsgraph: Fix 32 bit shift bug in get_visible_components_mask.
1 << n results in a 32 bit result, 1UL << n retains all 64 bits.
2018-09-25 09:23:00 -06:00
Ray Molenkamp
2f00f5b98f despgraph: Use regular iterators for erase, fixes build error on centOS
CentOS7 ships with gcc 4.8.2 which does not support the const_iterator for erase.
2018-09-25 08:35:31 -06:00
Brecht Van Lommel
342e73f90f Spelling fixes in comments and descriptions (2.8 changes), patch by luzpaz.
Differential Revision: https://developer.blender.org/D3719
2018-09-24 18:48:29 +02:00
Brecht Van Lommel
253dce07d7 Merge branch 'master' into blender2.8 2018-09-24 17:42:52 +02:00
Brecht Van Lommel
0cff044d84 Spelling fixes in comments and descriptions, patch by luzpaz.
Differential Revision: https://developer.blender.org/D3719
2018-09-24 17:28:40 +02:00
Sergey Sharybin
29602bbd62 Depsgraph: Always respect visibility flag when building object
Before it was only doing this for directly linked objects. This was
initially needed to solve fps issues in some of the shots. Now this
fps drop i can no longer reproduce. Was likely needed prior to
modifiers dependencies "inheriting" visibility from the "parent".

This commit makes it so objects which are linked indirectly to the
scene via collections are properly considered visible (or, rather,
evaluatable) by dependency graph.

Solves missing eyelashes and braids issues with 01_035_A.
2018-09-24 15:57:43 +02:00
Sergey Sharybin
736f91ad01 Depsgraph: Tweak to visibility flush
Make flush ready for component forced to be affecting visible things
from builder.
2018-09-24 15:55:02 +02:00
Sergey Sharybin
65c71fc410 Depsgraph: Provide more information about component 2018-09-24 15:55:02 +02:00
Sergey Sharybin
8008cdac2e Depsgraph: Cleanup, spelling in comment 2018-09-24 15:55:02 +02:00
Sergey Sharybin
a7c96a7aa6 Cleanup: Spelling 2018-09-24 15:55:02 +02:00
Brecht Van Lommel
06dc059f48 Depsgraph: update frame in scene on frame change.
Normally the time can be read from DEG_get_ctime(depsgraph), but this is a
bit more forgiving for e.g. addons that don't care too much about the details
of the COW depsgraph.
2018-09-21 14:15:27 +02:00
Campbell Barton
87b628db2a Cleanup: style 2018-09-20 07:15:45 +10:00
Sergey Sharybin
a7d43eb1c6 Depsgraph: Another followup to the previous commit
Apparently, only mesh objects has SHADING component.
2018-09-19 18:03:15 +02:00
Sergey Sharybin
93d4752dbe Depsgraph: Correction for the previous commit 2018-09-19 17:49:38 +02:00
Sergey Sharybin
828c0e9813 Depsgraph: Ensure shading update order
Previously it was possible to have geometry component to
tag batch for DIRTY_ALL and shading to tag with SHADING_UPDATE.

Now there is a relation between uber eval and shading, which
solves this issue.
2018-09-19 17:16:03 +02:00
Sergey Sharybin
09d3c907e7 Depsgraph: Always assume scene camera is visible
Allows to disable camera collection to make objects to go out of
the way, but still be able to animate.
2018-09-19 16:43:59 +02:00
Sergey Sharybin
749d5c033c Depsgraph: Make visible update to operate on per-component level 2018-09-19 16:10:12 +02:00
Sergey Sharybin
afb4da6650 Despgraph: Keep track of per-component visibility
The idea of those flags is to avoid evaluation of operations
which are not needed to bring visible objects to an up to date
state.

Previously, dependency graph attempted to do combine those
into an ID level flag. In practice it proved to be rather
tricky, since there could be dependency cycles on ID level
which will not exist on component level.
2018-09-19 16:10:12 +02:00
Sergey Sharybin
cc061d349b Depsgraph: Connect duplicating geometry to duplicator
This allows to force duplicated object to be fully evaluated for
display/draw.

Previously only transform component of duplicated object was
forced to become evaluated.
2018-09-19 16:10:12 +02:00
Sergey Sharybin
1b98fff713 Depsgraph: Make geoemtry to tag function more reusable 2018-09-19 16:10:12 +02:00
Sergey Sharybin
34c361db5a Depsgraph: Correct early output in collections
Need to ensure objects from collection which was built but
is became visible in the new "context" are poked for re-built.

This should be rather cheap, since this only will update
their visibility flag.

Can not rely on visibility flush here, since there is no
relations between collection and its objects.
2018-09-19 16:10:12 +02:00
Sergey Sharybin
3714c83441 Depsgraph: Handle text datablock in ID builder
Just silence the assert/print, we do not add text data blocks
to dependency graph.
2018-09-19 16:10:12 +02:00
Sergey Sharybin
dc1e03b4a2 Depsgraph: Cleanup, indentation 2018-09-17 11:19:42 +02:00
Sergey Sharybin
f87fbf9cce Depsgraph: Gnuplot, put heaviest objects at the top 2018-09-17 11:19:42 +02:00
Sergey Sharybin
d15928c234 Depsgraph: Use default visibility of false
Avoids invisible objects from being considered visible when they
are used as driver variables.

If those cases are actually coming from a visible object, then
deg_graph_build_flush_visibility() will ensure visibility is
properly flushed there.
2018-09-14 14:43:56 +02:00
Sergey Sharybin
d7fdd505da Depsgraph: Respect parent object visibility in more places
Mainly coverts object->parent and pose constraints.
2018-09-14 14:43:56 +02:00
Sergey Sharybin
95f257395e Depsgraph: Make indirectly linked objects inherit visibility from parent
This way objects which are pulled into dependency graph via modifier
stack from an invisible object will be invisible.
2018-09-14 14:43:56 +02:00
Sergey Sharybin
06c0febe70 Depsgraph: Use explicit argument values 2018-09-14 14:43:56 +02:00
Campbell Barton
aa6c9ca899 Cleanup: style 2018-09-08 07:03:14 +10:00
Sergey Sharybin
2f3311ed30 Depsgraph: Cleanup, naming
If something is a list of data, it is to be called list, and data
is to be called data. No need to call list a data and data a weird
two letter abbreviation.

Clarity is our friend!
2018-09-07 15:10:24 +02:00
Campbell Barton
246aed8847 Merge branch 'master' into blender2.8 2018-09-05 14:48:18 +10:00
Campbell Barton
1be265afc0 Cleanup: style 2018-09-05 14:46:54 +10:00
Sergey Sharybin
2580399498 Fix T56593: Crash when enabling collection with curves
Was missing update of ID blocks which are becoming visible.
2018-09-03 15:36:20 +02:00
Sergey Sharybin
d57cb8fa22 Depsgraph: Use more meaningful name for flags storage 2018-09-03 15:20:06 +02:00
Sergey Sharybin
3451cb56db Depsgraph: Cleanup, make it more obvious what ID references 2018-09-03 12:57:04 +02:00
Sergey Sharybin
6690816fe5 Depsgraph: Cleanup, make it more clear what function does 2018-09-03 12:55:26 +02:00
Sergey Sharybin
6ba5dc9147 Depsgraph: Generalize storage for already existing ID nodes
Currently no functional changes, just allows to store mo information.
2018-09-03 12:39:56 +02:00
Sergey Sharybin
73a474dd8b Depsgraph: Cleanup, indentation level 2018-09-03 12:11:11 +02:00
Campbell Barton
ae57383648 Cleanup: comment blocks 2018-09-02 18:28:27 +10:00
Brecht Van Lommel
42f7767dab Cleanup: rename files from group to collection to match contents. 2018-08-29 16:25:50 +02:00
Brecht Van Lommel
871b7ba892 Merge branch 'master' into blender2.8 2018-08-28 19:15:08 +02:00
Brecht Van Lommel
e20ed59037 Fix T56530, T56523: collection visiblity toggling wrong after recent changes. 2018-08-28 12:49:36 +02:00
Brecht Van Lommel
12622ce2f7 Cleanup: remove debug code. 2018-08-28 12:49:36 +02:00