diff options
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readblenentry.c | 70 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 23 |
2 files changed, 61 insertions, 32 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 0b2d6100964..6424829c12a 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -70,41 +70,44 @@ typedef struct { unsigned short code; - char *name; + char *name, *plural; int flags; #define IDTYPE_FLAGS_ISLINKABLE (1<<0) } IDType; +/* plural need to match rna_main.c's MainCollectionDef */ static IDType idtypes[]= { - { ID_AC, "Action", IDTYPE_FLAGS_ISLINKABLE}, - { ID_AR, "Armature", IDTYPE_FLAGS_ISLINKABLE}, - { ID_BR, "Brush", IDTYPE_FLAGS_ISLINKABLE}, - { ID_CA, "Camera", IDTYPE_FLAGS_ISLINKABLE}, - { ID_CU, "Curve", IDTYPE_FLAGS_ISLINKABLE}, - { ID_GD, "GPencil", IDTYPE_FLAGS_ISLINKABLE}, - { ID_GR, "Group", IDTYPE_FLAGS_ISLINKABLE}, - { ID_ID, "ID", 0}, - { ID_IM, "Image", IDTYPE_FLAGS_ISLINKABLE}, - { ID_IP, "Ipo", IDTYPE_FLAGS_ISLINKABLE}, - { ID_KE, "Key", 0}, - { ID_LA, "Lamp", IDTYPE_FLAGS_ISLINKABLE}, - { ID_LI, "Library", 0}, - { ID_LT, "Lattice", IDTYPE_FLAGS_ISLINKABLE}, - { ID_MA, "Material", IDTYPE_FLAGS_ISLINKABLE}, - { ID_MB, "Metaball", IDTYPE_FLAGS_ISLINKABLE}, - { ID_ME, "Mesh", IDTYPE_FLAGS_ISLINKABLE}, - { ID_NT, "NodeTree", IDTYPE_FLAGS_ISLINKABLE}, - { ID_OB, "Object", IDTYPE_FLAGS_ISLINKABLE}, - { ID_SCE, "Scene", IDTYPE_FLAGS_ISLINKABLE}, - { ID_SCR, "Screen", 0}, - { ID_SEQ, "Sequence", 0}, - { ID_SO, "Sound", IDTYPE_FLAGS_ISLINKABLE}, - { ID_TE, "Texture", IDTYPE_FLAGS_ISLINKABLE}, - { ID_TXT, "Text", IDTYPE_FLAGS_ISLINKABLE}, - { ID_VF, "VFont", IDTYPE_FLAGS_ISLINKABLE}, - { ID_WO, "World", IDTYPE_FLAGS_ISLINKABLE}, - { ID_WV, "Wave", 0}, + { ID_AC, "Action", "actions", IDTYPE_FLAGS_ISLINKABLE}, + { ID_AR, "Armature", "armatures", IDTYPE_FLAGS_ISLINKABLE}, + { ID_BR, "Brush", "brushes", IDTYPE_FLAGS_ISLINKABLE}, + { ID_CA, "Camera", "cameras", IDTYPE_FLAGS_ISLINKABLE}, + { ID_CU, "Curve", "curves", IDTYPE_FLAGS_ISLINKABLE}, + { ID_GD, "GPencil", "gpencil", IDTYPE_FLAGS_ISLINKABLE}, /* rename gpencil */ + { ID_GR, "Group", "groups", IDTYPE_FLAGS_ISLINKABLE}, + { ID_ID, "ID", "ids", 0}, /* plural is fake */ + { ID_IM, "Image", "images", IDTYPE_FLAGS_ISLINKABLE}, + { ID_IP, "Ipo", "ipos", IDTYPE_FLAGS_ISLINKABLE}, /* deprecated */ + { ID_KE, "Key", "keys", 0}, + { ID_LA, "Lamp", "lamps", IDTYPE_FLAGS_ISLINKABLE}, + { ID_LI, "Library", "libraries", 0}, + { ID_LT, "Lattice", "lattices", IDTYPE_FLAGS_ISLINKABLE}, + { ID_MA, "Material", "materials", IDTYPE_FLAGS_ISLINKABLE}, + { ID_MB, "Metaball", "metaballs", IDTYPE_FLAGS_ISLINKABLE}, + { ID_ME, "Mesh", "meshes", IDTYPE_FLAGS_ISLINKABLE}, + { ID_NT, "NodeTree", "node_groups", IDTYPE_FLAGS_ISLINKABLE}, + { ID_OB, "Object", "objects", IDTYPE_FLAGS_ISLINKABLE}, + { ID_PA, "ParticleSettings", "particles", 0}, + { ID_SCE, "Scene", "scenes", IDTYPE_FLAGS_ISLINKABLE}, + { ID_SCR, "Screen", "screens", 0}, + { ID_SEQ, "Sequence", "sequences", 0}, /* not actually ID data */ + { ID_SO, "Sound", "sounds", IDTYPE_FLAGS_ISLINKABLE}, + { ID_TE, "Texture", "textures", IDTYPE_FLAGS_ISLINKABLE}, + { ID_TXT, "Text", "texts", IDTYPE_FLAGS_ISLINKABLE}, + { ID_VF, "VFont", "fonts", IDTYPE_FLAGS_ISLINKABLE}, + { ID_WO, "World", "worlds", IDTYPE_FLAGS_ISLINKABLE}, + { ID_WM, "WindowManager", "window_managers", 0}, + { ID_WV, "Wave", "waves", 0}, /* deprecated */ }; static int nidtypes= sizeof(idtypes)/sizeof(idtypes[0]); @@ -156,7 +159,14 @@ int BLO_idcode_from_name(char *name) return idt?idt->code:0; } + +char *BLO_idcode_to_name_plural(int code) +{ + IDType *idt= idtype_from_code(code); + return idt?idt->plural:NULL; +} + /* Access routines used by filesel. */ BlendHandle *BLO_blendhandle_from_file(char *file) @@ -283,7 +293,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype) LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh) { FileData *fd= (FileData*) bh; - GHash *gathered= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); + GHash *gathered= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "linkable_groups gh"); LinkNode *names= NULL; BHead *bhead; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index aeb4c2f08d7..eab41243000 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8458,8 +8458,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ima->flag |= IMA_FIELDS; if(tex->imaflag & TEX_STD_FIELD_) ima->flag |= IMA_STD_FIELD; - if(tex->imaflag & TEX_ANTIALI_) - ima->flag |= IMA_ANTIALI; } tex->iuser.frames= tex->frames; tex->iuser.fie_ima= tex->fie_ima; @@ -10753,6 +10751,27 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } /* sequencer changes */ } + + if (main->versionfile <= 251) { /* 2.5.1 had no subversions */ + bScreen *sc; + + /* Blender 2.5.2 - subversion 0 introduced a new setting: V3D_RENDER_OVERRIDE. + * This bit was used in the past for V3D_TRANSFORM_SNAP, which is now deprecated. + * Here we clear it for old files so they don't come in with V3D_RENDER_OVERRIDE set, + * which would cause cameras, lamps, etc to become invisible */ + for(sc= main->screen.first; sc; sc= sc->id.next) { + ScrArea *sa; + for(sa= sc->areabase.first; sa; sa= sa->next) { + SpaceLink *sl; + for (sl= sa->spacedata.first; sl; sl= sl->next) { + if(sl->spacetype==SPACE_VIEW3D) { + View3D* v3d = (View3D *)sl; + v3d->flag2 &= ~V3D_RENDER_OVERRIDE; + } + } + } + } + } if (main->versionfile < 252 || (main->versionfile == 252 && main->subversionfile < 1)) { Brush *brush; |