Cleanup: remove script ID-types
authorCampbell Barton <ideasman42@gmail.com>
Thu, 22 Oct 2015 14:20:01 +0000 (01:20 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 22 Oct 2015 14:20:01 +0000 (01:20 +1100)
Unused since 2.4x and unlikely to be reintroduced as ID-types.

source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_main.h
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/library.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_legacy.c
source/blender/blenloader/intern/writefile.c
source/blender/makesdna/DNA_ID.h
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_main_api.c

index f46ae5617ac1b1872a8b1465d74dc5eec9627128..e11e9496b2166f186c7fd799fcda5f7d52d2052b 100644 (file)
@@ -76,7 +76,7 @@ void id_clear_lib_data(struct Main *bmain, struct ID *id);
 
 struct ListBase *which_libbase(struct Main *mainlib, short type);
 
-#define MAX_LIBARRAY    35
+#define MAX_LIBARRAY    34
 int set_listbasepointers(struct Main *main, struct ListBase *lb[MAX_LIBARRAY]);
 
 void BKE_libblock_free(struct Main *bmain, void *idv);
index 6a00961fbb3c329a3d0901db020c317805dfaabd..44e4da4e0a3c16da77ba3bd18d88e75c4fc061e1 100644 (file)
@@ -85,7 +85,6 @@ typedef struct Main {
        ListBase key;
        ListBase world;
        ListBase screen;
-       ListBase script;
        ListBase vfont;
        ListBase text;
        ListBase speaker;
index f1300697b85bc823bce960b105344012a3dae440..fc76c29880282ae7b00f836c409e45a94ab7be74 100644 (file)
@@ -256,7 +256,6 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
                /* comes from readfile.c */
                SWAP(ListBase, G.main->wm, bfd->main->wm);
                SWAP(ListBase, G.main->screen, bfd->main->screen);
-               SWAP(ListBase, G.main->script, bfd->main->script);
                
                /* we re-use current screen */
                curscreen = CTX_wm_screen(C);
index f8f928254792b911682e56671760a0016951ca0b..d9439b5363970d8dde98e7802b74adbabe392422 100644 (file)
@@ -264,8 +264,6 @@ bool id_make_local(ID *id, bool test)
                        return false; /* not implemented */
                case ID_TXT:
                        return false; /* not implemented */
-               case ID_SCRIPT:
-                       return false; /* deprecated */
                case ID_SO:
                        return false; /* not implemented */
                case ID_GR:
@@ -360,8 +358,6 @@ bool id_copy(ID *id, ID **newid, bool test)
                case ID_TXT:
                        if (!test) *newid = (ID *)BKE_text_copy(G.main, (Text *)id);
                        return true;
-               case ID_SCRIPT:
-                       return false;  /* deprecated */
                case ID_SO:
                        return false;  /* not implemented */
                case ID_GR:
@@ -496,8 +492,6 @@ ListBase *which_libbase(Main *mainlib, short type)
                        return &(mainlib->vfont);
                case ID_TXT:
                        return &(mainlib->text);
-               case ID_SCRIPT:
-                       return &(mainlib->script);
                case ID_SPK:
                        return &(mainlib->speaker);
                case ID_SO:
@@ -614,7 +608,6 @@ int set_listbasepointers(Main *main, ListBase **lb)
        lb[a++] = &(main->palettes);
        lb[a++] = &(main->paintcurves);
        lb[a++] = &(main->brush);
-       lb[a++] = &(main->script);
        lb[a++] = &(main->particle);
        lb[a++] = &(main->speaker);
 
@@ -708,9 +701,6 @@ void *BKE_libblock_alloc_notest(short type)
                case ID_TXT:
                        id = MEM_callocN(sizeof(Text), "text");
                        break;
-               case ID_SCRIPT:
-                       //XXX id = MEM_callocN(sizeof(Script), "script");
-                       break;
                case ID_SPK:
                        id = MEM_callocN(sizeof(Speaker), "speaker");
                        break;
@@ -858,9 +848,6 @@ void BKE_libblock_init_empty(ID *id)
                case ID_TXT:
                        BKE_text_init((Text *)id);
                        break;
-               case ID_SCRIPT:
-                       BLI_assert(0);
-                       break;
                case ID_SO:
                        /* Another fuzzy case, think NULLified content is OK here... */
                        break;
@@ -1135,9 +1122,6 @@ void BKE_libblock_free_ex(Main *bmain, void *idv, bool do_id_user)
                case ID_TXT:
                        BKE_text_free((Text *)id);
                        break;
-               case ID_SCRIPT:
-                       /* deprecated */
-                       break;
                case ID_SPK:
                        BKE_speaker_free((Speaker *)id);
                        break;
index 6545a3b0e6734642248f5cd67834208e07e8afb3..b112f3d43d6dfb50e511da4e5e1ecb859029b81f 100644 (file)
@@ -2220,14 +2220,6 @@ static void direct_link_paint_curve(FileData *fd, PaintCurve *pc)
        pc->points = newdataadr(fd, pc->points);
 }
 
-
-static void direct_link_script(FileData *UNUSED(fd), Script *script)
-{
-       script->id.us = 1;
-       SCRIPT_SET_NULL(script);
-}
-
-
 /* ************ READ PACKEDFILE *************** */
 
 static PackedFile *direct_link_packedfile(FileData *fd, PackedFile *oldpf)
@@ -8035,9 +8027,6 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
                case ID_PA:
                        direct_link_particlesettings(fd, (ParticleSettings*)id);
                        break;
-               case ID_SCRIPT:
-                       direct_link_script(fd, (Script*)id);
-                       break;
                case ID_GD:
                        direct_link_gpencil(fd, (bGPdata *)id);
                        break;
index 12069fd80dd881c326f15a5f0d5f19fce0f62a23..635df922c11e51446c6ea75b561717609652d942 100644 (file)
@@ -3246,7 +3246,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
                idproperties_fix_group_lengths(main->key);
                idproperties_fix_group_lengths(main->world);
                idproperties_fix_group_lengths(main->screen);
-               idproperties_fix_group_lengths(main->script);
                idproperties_fix_group_lengths(main->vfont);
                idproperties_fix_group_lengths(main->text);
                idproperties_fix_group_lengths(main->sound);
index d320274ef965b94894520283c11d8c7205aa6899..4449db14c50d9a7e21710dd6be05597910ea03f3 100644 (file)
@@ -3214,18 +3214,6 @@ static void write_paintcurves(WriteData *wd, ListBase *idbase)
        }
 }
 
-static void write_scripts(WriteData *wd, ListBase *idbase)
-{
-       Script *script;
-       
-       for (script=idbase->first; script; script= script->id.next) {
-               if (script->id.us>0 || wd->current) {
-                       writestruct(wd, ID_SCRIPT, "Script", 1, script);
-                       if (script->id.properties) IDP_WriteProperty(script->id.properties, wd);
-               }
-       }
-}
-
 static void write_movieTracks(WriteData *wd, ListBase *tracks)
 {
        MovieTrackingTrack *track;
@@ -3762,7 +3750,6 @@ static int write_file_handle(
        write_brushes  (wd, &mainvar->brush);
        write_palettes (wd, &mainvar->palettes);
        write_paintcurves (wd, &mainvar->paintcurves);
-       write_scripts  (wd, &mainvar->script);
        write_gpencils (wd, &mainvar->gpencil);
        write_linestyles(wd, &mainvar->linestyle);
        write_libraries(wd,  mainvar->next);
index c2901b8b9a5b5f5e21332354e9ba00121ea84ffe..9aff8d74e30a20bc177a0b443e2875a906affb19 100644 (file)
@@ -232,7 +232,6 @@ typedef struct PreviewImage {
 #define ID_ID          MAKE_ID2('I', 'D') /* (internal use only) */
 #define ID_AR          MAKE_ID2('A', 'R') /* bArmature */
 #define ID_AC          MAKE_ID2('A', 'C') /* bAction */
-#define ID_SCRIPT      MAKE_ID2('P', 'Y') /* Script (depreciated) */
 #define ID_NT          MAKE_ID2('N', 'T') /* bNodeTree */
 #define ID_BR          MAKE_ID2('B', 'R') /* Brush */
 #define ID_PA          MAKE_ID2('P', 'A') /* ParticleSettings */
index 348fa3c8302dfb6f8c0848881f0ecc79a3087e3d..e0538d1c05bdbd613d32e4edc0c3518e52115c1f 100644 (file)
@@ -185,12 +185,6 @@ static void rna_Main_screen_begin(CollectionPropertyIterator *iter, PointerRNA *
        rna_iterator_listbase_begin(iter, &bmain->screen, NULL);
 }
 
-static void rna_Main_script_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
-{
-       Main *bmain = (Main *)ptr->data;
-       rna_iterator_listbase_begin(iter, &bmain->script, NULL);
-}
-
 static void rna_Main_font_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
 {
        Main *bmain = (Main *)ptr->data;
@@ -349,7 +343,6 @@ void RNA_def_main(BlenderRNA *brna)
                {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks", RNA_def_main_worlds},
                {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks", RNA_def_main_groups},
                {"shape_keys", "Key", "rna_Main_key_begin", "Shape Keys", "Shape Key datablocks", NULL},
-               {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED)", NULL},
                {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks", RNA_def_main_texts},
                {"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker datablocks", RNA_def_main_speakers},
                {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks", RNA_def_main_sounds},
index 5a0da0b76517fa9c2ac9f010d1c27c908703fabb..029766c09f3b740557942cc7162cceba7db09c94 100644 (file)
@@ -790,7 +790,6 @@ static void rna_Main_brushes_tag(Main *bmain, int value) { BKE_main_id_tag_listb
 static void rna_Main_worlds_tag(Main *bmain, int value) { BKE_main_id_tag_listbase(&bmain->world, value); }
 static void rna_Main_groups_tag(Main *bmain, int value) { BKE_main_id_tag_listbase(&bmain->group, value); }
 // static void rna_Main_shape_keys_tag(Main *bmain, int value) { BKE_main_id_tag_listbase(&bmain->key, value); }
-// static void rna_Main_scripts_tag(Main *bmain, int value) { BKE_main_id_tag_listbase(&bmain->script, value); }
 static void rna_Main_texts_tag(Main *bmain, int value) { BKE_main_id_tag_listbase(&bmain->text, value); }
 static void rna_Main_speakers_tag(Main *bmain, int value) { BKE_main_id_tag_listbase(&bmain->speaker, value); }
 static void rna_Main_sounds_tag(Main *bmain, int value) { BKE_main_id_tag_listbase(&bmain->sound, value); }