[Bf-blender-cvs] [72f77598a24] master: Fix T98798: tag collection geometry when changing instance offset

Jacques Lucke noreply at git.blender.org
Tue Jul 26 14:59:54 CEST 2022


Commit: 72f77598a2453afa999046c8092d476a3f412aa1
Author: Jacques Lucke
Date:   Tue Jul 26 14:59:40 2022 +0200
Branches: master
https://developer.blender.org/rB72f77598a2453afa999046c8092d476a3f412aa1

Fix T98798: tag collection geometry when changing instance offset

Changing the instance offset moves the entire "collection geometry".
So other features that depend on the geometry should be reevaluated.

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

M	source/blender/makesrna/intern/rna_collection.c

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

diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c
index 8cd83ddcf12..4657f7e9a9f 100644
--- a/source/blender/makesrna/intern/rna_collection.c
+++ b/source/blender/makesrna/intern/rna_collection.c
@@ -359,6 +359,14 @@ static void rna_Collection_color_tag_update(Main *UNUSED(bmain),
   WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, scene);
 }
 
+static void rna_Collection_instance_offset_update(Main *UNUSED(bmain),
+                                                  Scene *UNUSED(scene),
+                                                  PointerRNA *ptr)
+{
+  Collection *collection = (Collection *)ptr->data;
+  DEG_id_tag_update(&collection->id, ID_RECALC_GEOMETRY);
+}
+
 #else
 
 /* collection.objects */
@@ -433,7 +441,7 @@ void RNA_def_collections(BlenderRNA *brna)
   RNA_def_property_ui_text(
       prop, "Instance Offset", "Offset from the origin to use when instancing");
   RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, RNA_TRANSLATION_PREC_DEFAULT);
-  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Collection_instance_offset_update");
 
   prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
   RNA_def_property_struct_type(prop, "Object");



More information about the Bf-blender-cvs mailing list