Depsgraph hack: DEG_OBJECT_ITER and base_flag
authorDalai Felinto <dfelinto@gmail.com>
Tue, 31 Jan 2017 13:52:46 +0000 (14:52 +0100)
committerDalai Felinto <dfelinto@gmail.com>
Tue, 31 Jan 2017 14:06:34 +0000 (15:06 +0100)
This is a temporary iterator that flushes the base flag to the object

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

index 884111321066c494a139caa52599c816dfd616d8..e74cfbe9a11ae273f74884cce7d36da679cf2b02 100644 (file)
@@ -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
index d24c7faa9f55a0221381382f78d5c2a51e637072..60aaa4ace20c4adeeb5cf8d17963f279776a6634 100644 (file)
@@ -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;