[Bf-blender-cvs] [126e443] fracture_modifier: crash fix for starting sim after convert to objects in external mode
Martin Felke
noreply at git.blender.org
Sat Jun 11 15:57:01 CEST 2016
Commit: 126e44303533baac009511aede514d14e15f2d28
Author: Martin Felke
Date: Sat Jun 11 15:56:28 2016 +0200
Branches: fracture_modifier
https://developer.blender.org/rB126e44303533baac009511aede514d14e15f2d28
crash fix for starting sim after convert to objects in external mode
stale data was around in depsgraph, missed a relations update tag call
===================================================================
M source/blender/editors/object/object_modifier.c
===================================================================
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index bb547e3..c83e58d 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -2727,7 +2727,7 @@ static Object* do_convert_meshisland_to_object(MeshIsland *mi, Scene* scene, Gro
//BKE_group_object_add(rbw->group, ob_new, scene, NULL);
do_add_group_unchecked(rbw->group, ob_new, *base);
- DAG_id_tag_update(&ob_new->id, OB_RECALC_OB);
+ DAG_id_tag_update(&ob_new->id, OB_RECALC_ALL);
}
//}
@@ -3056,6 +3056,8 @@ static void convert_modifier_to_objects(ReportList *reports, Scene* scene, Objec
MEM_freeN(objs);
BLI_kdtree_free(objtree);
+
+
/*argh, need to trigger a world rebuild, by all means */
/*if (rbw)
BKE_rigidbody_rebuild_world(scene, rbw->pointcache->startframe+1);*/
@@ -3118,24 +3120,22 @@ static int rigidbody_convert_exec(bContext *C, wmOperator *op)
/* delete has to handle all open scenes, copied from delete operator */
BKE_main_id_flag_listbase(&bmain->scene, LIB_TAG_DOIT, 1);
for (win = wm->windows.first; win; win = win->next) {
- scene = win->screen->scene;
+ Scene* sc = win->screen->scene;
- if (scene->id.flag & LIB_TAG_DOIT) {
- scene->id.flag &= ~LIB_TAG_DOIT;
+ if (sc->id.flag & LIB_TAG_DOIT) {
+ sc->id.flag &= ~LIB_TAG_DOIT;
DAG_relations_tag_update(bmain);
- WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
- WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, sc);
+ WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, sc);
}
}
}
- else
- {
- //DAG_relations_tag_update(bmain);
- WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
- WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
- }
+
+ DAG_relations_tag_update(bmain);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
return OPERATOR_FINISHED;
}
More information about the Bf-blender-cvs
mailing list