diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-09-15 04:06:49 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-09-15 04:06:49 +0400 |
commit | f24255b5a03f68a2ef4e09eb55d93dc21a1f44c0 (patch) | |
tree | 55e57ce12ac10b554c39001b84abe0de89a4e075 /source | |
parent | 7ae9a81323cf7a12356831e4a2ed4df06f924581 (diff) |
Fix for the Link/Append commands not working when scenes had line styles.
The problem was reported by mato.sus304, thank you!
Diffstat (limited to 'source')
5 files changed, 19 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c index bb84a2148f8..21ea2c1d222 100644 --- a/source/blender/blenkernel/intern/idcode.c +++ b/source/blender/blenkernel/intern/idcode.c @@ -63,7 +63,7 @@ static IDType idtypes[]= { { ID_KE, "Key", "keys", 0}, { ID_LA, "Lamp", "lamps", IDTYPE_FLAGS_ISLINKABLE}, { ID_LI, "Library", "libraries", 0}, - { ID_LS, "FreestyleLineStyle", "linestyles", 0}, + { ID_LS, "FreestyleLineStyle", "linestyles", IDTYPE_FLAGS_ISLINKABLE}, { ID_LT, "Lattice", "lattices", IDTYPE_FLAGS_ISLINKABLE}, { ID_MA, "Material", "materials", IDTYPE_FLAGS_ISLINKABLE}, { ID_MB, "Metaball", "metaballs", IDTYPE_FLAGS_ISLINKABLE}, diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a22a2cb8d9d..156683dd274 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -13188,6 +13188,7 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce) { Base *base; SceneRenderLayer *srl; + FreestyleLineSet *lineset; for(base= sce->base.first; base; base= base->next) { expand_doit(fd, mainvar, base->object); @@ -13208,6 +13209,12 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce) for(srl= sce->r.layers.first; srl; srl= srl->next) { expand_doit(fd, mainvar, srl->mat_override); expand_doit(fd, mainvar, srl->light_override); + + for (lineset= srl->freestyleConfig.linesets.first; lineset; lineset= lineset->next) { + if (lineset->group) + expand_doit(fd, mainvar, lineset->group); + expand_doit(fd, mainvar, lineset->linestyle); + } } if(sce->r.dometext) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 1e09063c74f..689634bed3b 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2040,8 +2040,6 @@ static void write_scenes(WriteData *wd, ListBase *scebase) for(fls= srl->freestyleConfig.linesets.first; fls; fls = fls->next) { writestruct(wd, DATA, "FreestyleLineSet", 1, fls); - writestruct(wd, DATA, "FreestyleLineStyle", 1, fls->linestyle); - writestruct(wd, DATA, "Group", 1, fls->group); } } diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index c7ada4a5801..86be1538f1e 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1105,7 +1105,7 @@ void filelist_from_main(struct FileList *filelist) if( filelist->dir[0]==0) { /* make directories */ - filelist->numfiles= 24; + filelist->numfiles= 25; filelist->filelist= (struct direntry *)malloc(filelist->numfiles * sizeof(struct direntry)); for(a=0; a<filelist->numfiles; a++) { @@ -1136,6 +1136,7 @@ void filelist_from_main(struct FileList *filelist) filelist->filelist[21].relname= BLI_strdup("Action"); filelist->filelist[22].relname= BLI_strdup("NodeTree"); filelist->filelist[23].relname= BLI_strdup("Speaker"); + filelist->filelist[24].relname= BLI_strdup("FreestyleLineStyle"); filelist_sort(filelist, FILE_SORT_ALPHA); } else { diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp index 2a82f4ab812..ec3bd9f5c5b 100644 --- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp @@ -16,6 +16,7 @@ extern "C" { #include "DNA_camera_types.h" #include "DNA_text_types.h" +#include "DNA_group_types.h" #include "DNA_freestyle_types.h" #include "BKE_global.h" @@ -418,6 +419,10 @@ extern "C" { FreestyleLineSet *lineset; for(lineset=(FreestyleLineSet *)srl->freestyleConfig.linesets.first; lineset; lineset=lineset->next) { + if (lineset->group) { + lineset->group->id.us--; + lineset->group = NULL; + } lineset->linestyle->id.us--; lineset->linestyle = NULL; } @@ -479,6 +484,10 @@ extern "C" { FreestyleLineSet *lineset = FRS_get_active_lineset(config); if (lineset) { + if (lineset->group) { + lineset->group->id.us--; + lineset->group = NULL; + } lineset->linestyle->id.us--; lineset->linestyle = NULL; BLI_remlink(&config->linesets, lineset); |