[Bf-blender-cvs] [835f9742e6] render-layers: Depsgraph hack: DEG_OBJECT_ITER and base_flag

Dalai Felinto noreply at git.blender.org
Tue Jan 31 15:19:44 CET 2017


Commit: 835f9742e6c5635fb0bcc47662c99fccb1598734
Author: Dalai Felinto
Date:   Tue Jan 31 14:52:46 2017 +0100
Branches: render-layers
https://developer.blender.org/rB835f9742e6c5635fb0bcc47662c99fccb1598734

Depsgraph hack: DEG_OBJECT_ITER and base_flag

This is a temporary iterator that flushes the base flag to the object

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

M	source/blender/blenkernel/BKE_layer.h
M	source/blender/makesdna/DNA_object_types.h

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

diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h
index 8841113210..e74cfbe9a1 100644
--- a/source/blender/blenkernel/BKE_layer.h
+++ b/source/blender/blenkernel/BKE_layer.h
@@ -169,6 +169,19 @@ void BKE_visible_bases_Iterator_end(Iterator *iter);
 	ITER_END                                                                  \
 }
 
+/* temporary hacky solution waiting for final depsgraph evaluation */
+#define DEG_OBJECT_ITER(sl_, ob_)                                             \
+{                                                                             \
+	/* flush all the data to objects*/                                        \
+	ObjectBase *base_;					                                      \
+	for (base_ = sl->object_bases.first; base_; base_ = base_->next) {        \
+	    ob_ = base_->object;			                                      \
+	    ob_->base_flag = base_->flag;
+
+#define DEG_OBJECT_ITER_END                                                   \
+    }                                                                         \
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index d24c7faa9f..60aaa4ace2 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -223,7 +223,10 @@ typedef struct Object {
 	float jump_speed;
 	float fall_speed;
 	unsigned char max_jumps;
-	char pad2[3];
+	char pad2;
+
+	/* Depsgraph */
+	short base_flag; /* used by depsgraph, flushed from base */
 
 	/** Collision mask settings */
 	unsigned short col_group, col_mask;




More information about the Bf-blender-cvs mailing list