[Bf-blender-cvs] [98caf93] hair_immediate_fixes: Fixed RNA update callbacks to ensure the hair path cache is rebuilt.

Lukas Tönne noreply at git.blender.org
Fri Oct 3 16:49:23 CEST 2014


Commit: 98caf9331df92135497fc3ceb6badac5c1acc80a
Author: Lukas Tönne
Date:   Fri Oct 3 14:54:21 2014 +0200
Branches: hair_immediate_fixes
https://developer.blender.org/rB98caf9331df92135497fc3ceb6badac5c1acc80a

Fixed RNA update callbacks to ensure the hair path cache is rebuilt.

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

M	source/blender/makesrna/intern/rna_key.c
M	source/blender/makesrna/intern/rna_particle.c

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

diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index 4922fc5..9691308 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -32,6 +32,7 @@
 #include "DNA_key_types.h"
 #include "DNA_lattice_types.h"
 #include "DNA_mesh_types.h"
+#include "DNA_particle_types.h"
 
 #include "BLI_utildefines.h"
 
@@ -376,11 +377,29 @@ static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *p
 	Key *key = ptr->id.data;
 	Object *ob;
 
-	for (ob = bmain->object.first; ob; ob = ob->id.next) {
-		if (BKE_key_from_object(ob) == key) {
-			DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
-			WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob);
+	switch (key->owner.type) {
+	case KEY_OWNER_MESH:
+	case KEY_OWNER_CURVE:
+	case KEY_OWNER_LATTICE:
+		for (ob = bmain->object.first; ob; ob = ob->id.next) {
+			if (BKE_key_from_object(ob) == key) {
+				DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+				WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob);
+			}
+		}
+		break;
+	case KEY_OWNER_PARTICLES:
+		for (ob = bmain->object.first; ob; ob = ob->id.next) {
+			ParticleSystem *psys;
+			for (psys = ob->particlesystem.first; psys; psys = psys->next) {
+				if (psys->key == key) {
+					psys->recalc |= PSYS_RECALC_REDO;
+					DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+					WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, ob);
+				}
+			}
 		}
+		break;
 	}
 }
 
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index b80513a..0dd08d9 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -777,9 +777,9 @@ static void rna_Particle_active_shape_update(Main *bmain, Scene *scene, PointerR
 				break;
 		}
 	}
-
-	rna_Object_internal_update_data(bmain, scene, ptr);
 #endif
+	
+	rna_Particle_redo(bmain, scene, ptr);
 }
 
 static void rna_Particle_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max,




More information about the Bf-blender-cvs mailing list