[Bf-blender-cvs] [54ebbe15349] blender2.8: Depsgraph: Cleanup, remove legacy material/lamp driver update functions

Sergey Sharybin noreply at git.blender.org
Wed Oct 25 15:50:42 CEST 2017


Commit: 54ebbe15349cd9a111c000f703cfb6a7fcbd43f5
Author: Sergey Sharybin
Date:   Wed Oct 25 15:48:23 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB54ebbe15349cd9a111c000f703cfb6a7fcbd43f5

Depsgraph: Cleanup, remove legacy material/lamp driver update functions

===================================================================

M	source/blender/blenkernel/BKE_lamp.h
M	source/blender/blenkernel/BKE_material.h
M	source/blender/blenkernel/intern/lamp.c
M	source/blender/blenkernel/intern/material.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_lamp.h b/source/blender/blenkernel/BKE_lamp.h
index b68da654520..56b72282513 100644
--- a/source/blender/blenkernel/BKE_lamp.h
+++ b/source/blender/blenkernel/BKE_lamp.h
@@ -50,8 +50,6 @@ struct Lamp *localize_lamp(struct Lamp *la) ATTR_WARN_UNUSED_RESULT;
 void BKE_lamp_make_local(struct Main *bmain, struct Lamp *la, const bool lib_local);
 void BKE_lamp_free(struct Lamp *la);
 
-void lamp_drivers_update(struct Scene *scene, struct Lamp *la, float ctime);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index 49fb128417e..cb4ee9c2543 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -110,9 +110,6 @@ bool material_in_material(struct Material *parmat, struct Material *mat);
 
 void ramp_blend(int type, float r_col[3], const float fac, const float col[3]);
 
-/* driver update hacks */
-void material_drivers_update(struct Scene *scene, struct Material *mat, float ctime);
-
 /* copy/paste */
 void clear_matcopybuf(void);
 void free_matcopybuf(void);
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index 42596e3f33a..d8b9b14d755 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -224,41 +224,3 @@ void BKE_lamp_free(Lamp *la)
 	BKE_icon_id_delete(&la->id);
 	la->id.icon_id = 0;
 }
-
-/* Calculate all drivers for lamps, see material_drivers_update for why this is a bad hack */
-
-static void lamp_node_drivers_update(Scene *scene, bNodeTree *ntree, float ctime)
-{
-	bNode *node;
-
-	/* nodetree itself */
-	if (ntree->adt && ntree->adt->drivers.first)
-		BKE_animsys_evaluate_animdata(scene, &ntree->id, ntree->adt, ctime, ADT_RECALC_DRIVERS);
-	
-	/* nodes */
-	for (node = ntree->nodes.first; node; node = node->next)
-		if (node->id && node->type == NODE_GROUP)
-			lamp_node_drivers_update(scene, (bNodeTree *)node->id, ctime);
-}
-
-void lamp_drivers_update(Scene *scene, Lamp *la, float ctime)
-{
-	/* Prevent infinite recursion by checking (and tagging the lamp) as having been visited already
-	 * (see BKE_scene_update_tagged()). This assumes la->id.tag & LIB_TAG_DOIT isn't set by anything else
-	 * in the meantime... [#32017] */
-	if (la->id.tag & LIB_TAG_DOIT)
-		return;
-
-	la->id.tag |= LIB_TAG_DOIT;
-	
-	/* lamp itself */
-	if (la->adt && la->adt->drivers.first)
-		BKE_animsys_evaluate_animdata(scene, &la->id, la->adt, ctime, ADT_RECALC_DRIVERS);
-	
-	/* nodes */
-	if (la->nodetree)
-		lamp_node_drivers_update(scene, la->nodetree, ctime);
-
-	la->id.tag &= ~LIB_TAG_DOIT;
-}
-
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index d37c7a392ee..81042c4eef2 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1156,61 +1156,6 @@ bool material_in_material(Material *parmat, Material *mat)
 
 /* ****************** */
 
-/* Update drivers for materials in a nodetree */
-static void material_node_drivers_update(Scene *scene, bNodeTree *ntree, float ctime)
-{
-	bNode *node;
-
-	/* nodetree itself */
-	if (ntree->adt && ntree->adt->drivers.first) {
-		BKE_animsys_evaluate_animdata(scene, &ntree->id, ntree->adt, ctime, ADT_RECALC_DRIVERS);
-	}
-	
-	/* nodes */
-	for (node = ntree->nodes.first; node; node = node->next) {
-		if (node->id) {
-			if (GS(node->id->name) == ID_MA) {
-				material_drivers_update(scene, (Material *)node->id, ctime);
-			}
-			else if (node->type == NODE_GROUP) {
-				material_node_drivers_update(scene, (bNodeTree *)node->id, ctime);
-			}
-		}
-	}
-}
-
-/* Calculate all drivers for materials 
- * FIXME: this is really a terrible method which may result in some things being calculated
- * multiple times. However, without proper despgraph support for these things, we are forced
- * into this sort of thing...
- */
-void material_drivers_update(Scene *scene, Material *ma, float ctime)
-{
-	//if (G.f & G_DEBUG)
-	//	printf("material_drivers_update(%s, %s)\n", scene->id.name, ma->id.name);
-	
-	/* Prevent infinite recursion by checking (and tagging the material) as having been visited already
-	 * (see BKE_scene_update_tagged()). This assumes ma->id.tag & LIB_TAG_DOIT isn't set by anything else
-	 * in the meantime... [#32017]
-	 */
-	if (ma->id.tag & LIB_TAG_DOIT)
-		return;
-
-	ma->id.tag |= LIB_TAG_DOIT;
-	
-	/* material itself */
-	if (ma->adt && ma->adt->drivers.first) {
-		BKE_animsys_evaluate_animdata(scene, &ma->id, ma->adt, ctime, ADT_RECALC_DRIVERS);
-	}
-	
-	/* nodes */
-	if (ma->nodetree) {
-		material_node_drivers_update(scene, ma->nodetree, ctime);
-	}
-
-	ma->id.tag &= ~LIB_TAG_DOIT;
-}
-
 bool BKE_object_material_slot_remove(Object *ob)
 {
 	Material *mao, ***matarar;



More information about the Bf-blender-cvs mailing list