[Bf-blender-cvs] [a4fd3f7cc4a] functions: store pointer to node tree in modifier data

Jacques Lucke noreply at git.blender.org
Tue Jul 2 16:11:46 CEST 2019


Commit: a4fd3f7cc4ae975deaa050a8f55fb08e46183fac
Author: Jacques Lucke
Date:   Tue Jul 2 12:51:26 2019 +0200
Branches: functions
https://developer.blender.org/rBa4fd3f7cc4ae975deaa050a8f55fb08e46183fac

store pointer to node tree in modifier data

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

M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/intern/MOD_nodeparticles.c

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

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 98ec91dfd63..1aa828a35fb 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1668,6 +1668,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         layout.prop(md, "control2")
         layout.prop(md, "emitter_object")
         layout.prop(md, "collision_object")
+        layout.prop(md, "bparticles_tree")
 
 
 class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index a0a06feea49..399df9f936d 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1970,6 +1970,7 @@ typedef struct NodeParticlesModifierData {
   struct Object *emitter_object;
   struct Object *collision_object;
   float last_emitter_transforms[4][4];
+  struct bNodeTree *bparticles_tree;
 } NodeParticlesModifierData;
 
 #endif /* __DNA_MODIFIER_TYPES_H__ */
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index f92b77ded63..843b60ee041 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -5998,6 +5998,11 @@ static void rna_def_modifier_node_particles(BlenderRNA *brna)
   RNA_def_property_flag(prop, PROP_EDITABLE);
   RNA_def_property_ui_text(prop, "Collision Object", "Object to collide with");
   RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
+
+  prop = RNA_def_property(srna, "bparticles_tree", PROP_POINTER, PROP_NONE);
+  RNA_def_property_flag(prop, PROP_EDITABLE);
+  RNA_def_property_ui_text(prop, "BParticles Tree", "BParticles node tree");
+  RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
 }
 
 void RNA_def_modifier(BlenderRNA *brna)
diff --git a/source/blender/modifiers/intern/MOD_nodeparticles.c b/source/blender/modifiers/intern/MOD_nodeparticles.c
index d616dc5b57a..32d06e75dee 100644
--- a/source/blender/modifiers/intern/MOD_nodeparticles.c
+++ b/source/blender/modifiers/intern/MOD_nodeparticles.c
@@ -231,8 +231,9 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk,
 static void foreachIDLink(ModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
 {
   NodeParticlesModifierData *npmd = (NodeParticlesModifierData *)md;
-  walk(userData, ob, (ID **)&npmd->emitter_object, IDWALK_CB_NOP);
-  walk(userData, ob, (ID **)&npmd->collision_object, IDWALK_CB_NOP);
+  walk(userData, ob, (ID **)&npmd->bparticles_tree, IDWALK_CB_NOP);
+
+  foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData);
 }
 
 ModifierTypeInfo modifierType_NodeParticles = {



More information about the Bf-blender-cvs mailing list