From 4df0c46f838f7c316b10a6667705c093f067cadd Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 18 Apr 2013 08:58:21 +0000 Subject: Make freestyle use local Main for temporary objects This means main database is no longer pollutes with temporary scene and objects needed for freestyle render. Actually, there're few of separated temporary mains now. Ideally it's better to use single one, but it's not so much trivial to pass it to all classes. Not so big deal actually. Required some changes to blender kernel, to make it possible to add object to a given main, also to check on mesh materials for objects in given main. This is all straightforward changes. As an additional, solved issue with main database being infinitely polluted with text blocks created by create_lineset_handler function. This fixes: - #35003: Freestyle crashes if user expands objects in FRS1_Scene - #35012: ctrl+f12 rendering crashes when using Freestyle --- source/blender/editors/object/object_modifier.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to '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 e89c581a7b6..7d9feec6d78 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -464,7 +464,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene * if (totvert == 0) return 0; /* add new mesh */ - obn = BKE_object_add(scene, OB_MESH); + obn = BKE_object_add(bmain, scene, OB_MESH); me = obn->data; me->totvert = totvert; @@ -1721,8 +1721,7 @@ static void skin_armature_bone_create(Object *skin_ob, } } -static Object *modifier_skin_armature_create(struct Scene *scene, - Object *skin_ob) +static Object *modifier_skin_armature_create(Main *bmain, Scene *scene, Object *skin_ob) { BLI_bitmap edges_visited; DerivedMesh *deform_dm; @@ -1745,7 +1744,7 @@ static Object *modifier_skin_armature_create(struct Scene *scene, NULL, me->totvert); - arm_ob = BKE_object_add(scene, OB_ARMATURE); + arm_ob = BKE_object_add(bmain, scene, OB_ARMATURE); BKE_object_transform_copy(arm_ob, skin_ob); arm = arm_ob->data; arm->layer = 1; @@ -1815,7 +1814,7 @@ static int skin_armature_create_exec(bContext *C, wmOperator *op) } /* create new armature */ - arm_ob = modifier_skin_armature_create(scene, ob); + arm_ob = modifier_skin_armature_create(bmain, scene, ob); /* add a modifier to connect the new armature to the mesh */ arm_md = (ArmatureModifierData *)modifier_new(eModifierType_Armature); -- cgit v1.2.3