Fix material/lamp drivers not working sometimes when they were used by multiple
objects, found while looking into another bug.
This commit is contained in:
@@ -372,8 +372,8 @@ static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Mat
|
||||
*/
|
||||
if (ma->id.flag & LIB_DOIT)
|
||||
return;
|
||||
else
|
||||
ma->id.flag |= LIB_DOIT;
|
||||
|
||||
ma->id.flag |= LIB_DOIT;
|
||||
|
||||
/* material itself */
|
||||
if (ma->adt)
|
||||
@@ -386,6 +386,8 @@ static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Mat
|
||||
/* material's nodetree */
|
||||
if (ma->nodetree)
|
||||
dag_add_shader_nodetree_driver_relations(dag, node, ma->nodetree);
|
||||
|
||||
ma->id.flag &= ~LIB_DOIT;
|
||||
}
|
||||
|
||||
/* recursive handling for lamp drivers */
|
||||
@@ -397,8 +399,8 @@ static void dag_add_lamp_driver_relations(DagForest *dag, DagNode *node, Lamp *l
|
||||
*/
|
||||
if (la->id.flag & LIB_DOIT)
|
||||
return;
|
||||
else
|
||||
la->id.flag |= LIB_DOIT;
|
||||
|
||||
la->id.flag |= LIB_DOIT;
|
||||
|
||||
/* lamp itself */
|
||||
if (la->adt)
|
||||
@@ -411,6 +413,8 @@ static void dag_add_lamp_driver_relations(DagForest *dag, DagNode *node, Lamp *l
|
||||
/* lamp's nodetree */
|
||||
if (la->nodetree)
|
||||
dag_add_shader_nodetree_driver_relations(dag, node, la->nodetree);
|
||||
|
||||
la->id.flag &= ~LIB_DOIT;
|
||||
}
|
||||
|
||||
static void dag_add_collision_field_relation(DagForest *dag, Scene *scene, Object *ob, DagNode *node, int skip_forcefield, bool no_collision)
|
||||
|
||||
@@ -258,8 +258,8 @@ void lamp_drivers_update(Scene *scene, Lamp *la, float ctime)
|
||||
* in the meantime... [#32017] */
|
||||
if (la->id.flag & LIB_DOIT)
|
||||
return;
|
||||
else
|
||||
la->id.flag |= LIB_DOIT;
|
||||
|
||||
la->id.flag |= LIB_DOIT;
|
||||
|
||||
/* lamp itself */
|
||||
if (la->adt && la->adt->drivers.first)
|
||||
@@ -268,5 +268,7 @@ void lamp_drivers_update(Scene *scene, Lamp *la, float ctime)
|
||||
/* nodes */
|
||||
if (la->nodetree)
|
||||
lamp_node_drivers_update(scene, la->nodetree, ctime);
|
||||
|
||||
la->id.flag &= ~LIB_DOIT;
|
||||
}
|
||||
|
||||
|
||||
@@ -1133,8 +1133,8 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime)
|
||||
*/
|
||||
if (ma->id.flag & LIB_DOIT)
|
||||
return;
|
||||
else
|
||||
ma->id.flag |= LIB_DOIT;
|
||||
|
||||
ma->id.flag |= LIB_DOIT;
|
||||
|
||||
/* material itself */
|
||||
if (ma->adt && ma->adt->drivers.first) {
|
||||
@@ -1145,6 +1145,8 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime)
|
||||
if (ma->nodetree) {
|
||||
material_node_drivers_update(scene, ma->nodetree, ctime);
|
||||
}
|
||||
|
||||
ma->id.flag &= ~LIB_DOIT;
|
||||
}
|
||||
|
||||
/* ****************** */
|
||||
|
||||
Reference in New Issue
Block a user