diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-04-18 12:58:21 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-04-18 12:58:21 +0400 |
commit | 4df0c46f838f7c316b10a6667705c093f067cadd (patch) | |
tree | 9620cb8dbe215e30a3738509bed50408bca2452d /source/blender/blenkernel/intern/material.c | |
parent | 093f95afaa4a08d2cf194b88803a35ef16cfec58 (diff) |
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
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index a4f147a4fac..7e70b9d9cd5 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -568,7 +568,7 @@ void material_append_id(ID *id, Material *ma) (*matar)[(*totcol)++] = ma; id_us_plus((ID *)ma); - test_object_materials(id); + test_object_materials(G.main, id); } } @@ -601,7 +601,7 @@ Material *material_pop_id(ID *id, int index_i, int remove_material_slot) MEM_freeN(*matar); *matar = mat; - test_object_materials(id); + test_object_materials(G.main, id); } /* decrease mat_nr index */ @@ -712,7 +712,7 @@ void resize_object_material(Object *ob, const short totcol) if (ob->actcol > ob->totcol) ob->actcol = ob->totcol; } -void test_object_materials(ID *id) +void test_object_materials(Main *bmain, ID *id) { /* make the ob mat-array same size as 'ob->data' mat-array */ Object *ob; @@ -722,7 +722,7 @@ void test_object_materials(ID *id) return; } - for (ob = G.main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { if (ob->data == id) { resize_object_material(ob, *totcol); } @@ -768,7 +768,7 @@ void assign_material_id(ID *id, Material *ma, short act) if (ma) id_us_plus((ID *)ma); - test_object_materials(id); + test_object_materials(G.main, id); } void assign_material(Object *ob, Material *ma, short act, int assign_type) @@ -855,7 +855,7 @@ void assign_material(Object *ob, Material *ma, short act, int assign_type) if (ma) id_us_plus((ID *)ma); - test_object_materials(ob->data); + test_object_materials(G.main, ob->data); } /* XXX - this calls many more update calls per object then are needed, could be optimized */ |