Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-06-01 21:05:56 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-06-01 21:05:56 +0400
commit6491fdf413fbd843e9a387c3e17da6f2a56e8546 (patch)
treeccf47a5a7b336e3d28f0a452f88374e49020f724
parent9da25e016f70f6072c0385543ccf44585126d0fb (diff)
Fix #22039: changing simplify recalculates subsurf even if simplifiy is disabled.
Fix crash with simplify and child particles in linked scenes.
-rw-r--r--source/blender/makesrna/intern/rna_scene.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index a18c1021a8a..c7a7576335a 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -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 rna_Scene_editmesh_select_mode_update(Main *bmain, Scene *scene, Poi
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 object_simplify_update(Object *ob)
}
}
-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 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
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");