Go to file
Joshua Leung c960d1692f Bugfix [#31834] Cycles materials cannot be manipulated using drivers
Until now, there was never any code for making drivers on materials get
recalculated when their dependencies were changed. However, since changing
material colors with drivers is something that is quite common, a workaround was
introduced to ensure that materials could still be driven (albeit with the
relevant drivers rooted at object level). This worked well enough so far with
traditional materials - though it was sometimes clunky and confusing for some
users - and would have been ok to tide us over until the depsgraph refactor.

The introduction of Cycles changed this, as it has in many other ways. Now that
people use Cycles to render, they'll need to drive the material colors through
the nested nodetree (and other things nested deeply within that). However, this
is much more difficult to generate hacks to create the relevant paths needed to
work around the problem.

== This Commit... ==
* Adds a recursive driver calculation step to the BKE_object_handle_update()
(which gets called whenever the depsgraph has finished tagging object datablocks
for updates), which goes through calculating the drivers attached to the object
(and the materials/nodetrees attached to that). This case gets handled everytime
the object is tagged as needing updates to its "data" (OB_RECALC_DATA)

* When building the depsgraph, every dependency that the drivers there have are
treated as if they were attached to object.data instead. This should trick the
depsgraph into tagging OB_RECALC_DATA to force recalculation of drivers, at the
expense perhaps of modifiers getting recalculated again.

== Todo ==
* The old workarounds noted are still in place (will be commented out in the
next commit). This fix renders at least the material case redundant, although
the textures case still needs a bit more work.

* Check on whether similar hacks can be done for other datablock combinations

* So far, only simple test cases have been tested. There is probably some
performance penalty for heavy setups still (due to need to traverse down all
parts of material/node hierarchy to find things that need updates). If there
really is a problem here, we could try introducing some tags to limit this
traversal (which get added at depsgraph build time).  <--- USER TESTING
NEEDED!!!
2012-07-03 05:11:37 +00:00
build_files Scons: 2012-06-30 22:44:36 +00:00
doc document calling operators with undo enabled. 2012-06-28 08:17:28 +00:00
extern add cmake option WITH_SYSTEM_OPENJPEG so linux can build cycles without having libopenjpeg installed. 2012-06-23 14:23:44 +00:00
intern Smoke Bugfix: Turbulence was removed. 2012-07-02 13:41:51 +00:00
release Nice update to xgettext replacement, now finds 608 strings, think this covers all cases... 2012-07-03 01:11:59 +00:00
source Bugfix [#31834] Cycles materials cannot be manipulated using drivers 2012-07-03 05:11:37 +00:00
CMakeLists.txt don't disable cycles when OIIO isnt found, instead throw an error, annoying when full build is done and later find cycles isn't on. 2012-07-01 15:26:25 +00:00
COPYING == docs == 2010-10-13 14:44:22 +00:00
GNUmakefile cmake edits 2012-05-27 10:03:13 +00:00
SConstruct option to disable feather, since its so slow - for interactively editing masks its useful to be able to disable. 2012-06-21 12:27:57 +00:00