[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29132] trunk/blender/source/blender/ makesrna/intern/rna_scene.c: Fix #22039: changing simplify recalculates subsurf even if simplifiy is disabled.

Brecht Van Lommel brecht at blender.org
Tue Jun 1 19:05:56 CEST 2010


Revision: 29132
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29132
Author:   blendix
Date:     2010-06-01 19:05:56 +0200 (Tue, 01 Jun 2010)

Log Message:
-----------
Fix #22039: changing simplify recalculates subsurf even if simplifiy is disabled.
Fix crash with simplify and child particles in linked scenes.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_scene.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_scene.c	2010-06-01 17:05:22 UTC (rev 29131)
+++ trunk/blender/source/blender/makesrna/intern/rna_scene.c	2010-06-01 17:05:56 UTC (rev 29132)
@@ -31,6 +31,7 @@
 
 #include "DNA_group_types.h"
 #include "DNA_modifier_types.h"
+#include "DNA_particle_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_userdef_types.h"
 
@@ -798,10 +799,14 @@
 static void object_simplify_update(Object *ob)
 {
 	ModifierData *md;
+	ParticleSystem *psys;
 
 	for(md=ob->modifiers.first; md; md=md->next)
 		if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
-			ob->recalc |= OB_RECALC_DATA;
+			ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
+
+	for(psys=ob->particlesystem.first; psys; psys=psys->next)
+		psys->recalc |= PSYS_RECALC_CHILD;
 	
 	if(ob->dup_group) {
 		GroupObject *gob;
@@ -811,17 +816,24 @@
 	}
 }
 
-static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
+	Scene *sce;
 	Base *base;
 
-	for(base= scene->base.first; base; base= base->next)
+	for(SETLOOPER(scene, base))
 		object_simplify_update(base->object);
 	
 	DAG_ids_flush_update(0);
 	WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
 }
 
+static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+	if(scene->r.mode & R_SIMPLIFY)
+		rna_Scene_use_simplify_update(bmain, scene, ptr);
+}
+
 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
 {
 	Scene *scene= (Scene*)ptr->data;
@@ -2726,7 +2738,7 @@
 	prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
 	RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
-	RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
+	RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
 
 	prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
 	RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");





More information about the Bf-blender-cvs mailing list