Commit: 8fd4a8ab5db10757801a6aadc03f8248bcad73ed
Author: Bastien Montagne
Date:   Wed Aug 10 15:06:40 2016 +0200
Branches: blender2.8
https://developer.blender.org/rB8fd4a8ab5db10757801a6aadc03f8248bcad73ed

Merge branch 'master' into blender2.8

Conflicts:
        source/blender/blenkernel/intern/library.c
        source/blender/blenkernel/intern/particle.c

===================================================================



===================================================================

diff --cc source/blender/blenkernel/intern/idcode.c
index ddc4fb3,70d037d..c76d072
--- a/source/blender/blenkernel/intern/idcode.c
+++ b/source/blender/blenkernel/intern/idcode.c
@@@ -259,6 -262,56 +259,55 @@@ short BKE_idcode_from_idfilter(const in
  }
  
  /**
+  * Convert an idcode into an index (e.g. ID_OB -> INDEX_ID_OB).
+  */
+ int BKE_idcode_to_index(const short idcode)
+ {
+ #define CASE_IDINDEX(_id) case ID_##_id: return INDEX_ID_##_id
+ 
+       switch ((ID_Type)idcode) {
+               CASE_IDINDEX(AC);
+               CASE_IDINDEX(AR);
+               CASE_IDINDEX(BR);
+               CASE_IDINDEX(CA);
+               CASE_IDINDEX(CF);
+               CASE_IDINDEX(CU);
+               CASE_IDINDEX(GD);
+               CASE_IDINDEX(GR);
+               CASE_IDINDEX(IM);
+               CASE_IDINDEX(KE);
+               CASE_IDINDEX(IP);
+               CASE_IDINDEX(LA);
+               CASE_IDINDEX(LI);
+               CASE_IDINDEX(LS);
+               CASE_IDINDEX(LT);
+               CASE_IDINDEX(MA);
+               CASE_IDINDEX(MB);
+               CASE_IDINDEX(MC);
+               CASE_IDINDEX(ME);
+               CASE_IDINDEX(MSK);
+               CASE_IDINDEX(NT);
+               CASE_IDINDEX(OB);
 -              CASE_IDINDEX(PA);
+               CASE_IDINDEX(PAL);
+               CASE_IDINDEX(PC);
+               CASE_IDINDEX(SCE);
+               CASE_IDINDEX(SCR);
+               CASE_IDINDEX(SPK);
+               CASE_IDINDEX(SO);
+               CASE_IDINDEX(TE);
+               CASE_IDINDEX(TXT);
+               CASE_IDINDEX(VF);
+               CASE_IDINDEX(WM);
+               CASE_IDINDEX(WO);
+       }
+ 
+       BLI_assert(0);
+       return -1;
+ 
+ #undef CASE_IDINDEX
+ }
+ 
+ /**
   * Convert an idcode into a name (plural).
   *
   * \param idcode: The code to convert.
diff --cc source/blender/blenkernel/intern/library.c
index 933622e,6d94cd2..ca98f5d
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@@ -764,39 -771,38 +762,37 @@@ int set_listbasepointers(Main *main, Li
         * the specific data should be inserted here 
         */
  
-       lb[a++] = &(main->armature);
- 
-       lb[a++] = &(main->cachefiles);
-       lb[a++] = &(main->mesh);
-       lb[a++] = &(main->curve);
-       lb[a++] = &(main->mball);
- 
-       lb[a++] = &(main->latt);
-       lb[a++] = &(main->lamp);
-       lb[a++] = &(main->camera);
- 
-       lb[a++] = &(main->text);
-       lb[a++] = &(main->sound);
-       lb[a++] = &(main->group);
-       lb[a++] = &(main->palettes);
-       lb[a++] = &(main->paintcurves);
-       lb[a++] = &(main->brush);
-       lb[a++] = &(main->speaker);
- 
-       lb[a++] = &(main->world);
-       lb[a++] = &(main->movieclip);
-       lb[a++] = &(main->screen);
-       lb[a++] = &(main->object);
-       lb[a++] = &(main->linestyle); /* referenced by scenes */
-       lb[a++] = &(main->scene);
-       lb[a++] = &(main->wm);
-       lb[a++] = &(main->mask);
+       lb[INDEX_ID_AR] = &(main->armature);
+ 
+       lb[INDEX_ID_CF] = &(main->cachefiles);
+       lb[INDEX_ID_ME] = &(main->mesh);
+       lb[INDEX_ID_CU] = &(main->curve);
+       lb[INDEX_ID_MB] = &(main->mball);
+ 
+       lb[INDEX_ID_LT] = &(main->latt);
+       lb[INDEX_ID_LA] = &(main->lamp);
+       lb[INDEX_ID_CA] = &(main->camera);
+ 
+       lb[INDEX_ID_TXT] = &(main->text);
+       lb[INDEX_ID_SO]  = &(main->sound);
+       lb[INDEX_ID_GR]  = &(main->group);
+       lb[INDEX_ID_PAL] = &(main->palettes);
+       lb[INDEX_ID_PC]  = &(main->paintcurves);
+       lb[INDEX_ID_BR]  = &(main->brush);
 -      lb[INDEX_ID_PA]  = &(main->particle);
+       lb[INDEX_ID_SPK] = &(main->speaker);
+ 
+       lb[INDEX_ID_WO]  = &(main->world);
+       lb[INDEX_ID_MC]  = &(main->movieclip);
+       lb[INDEX_ID_SCR] = &(main->screen);
+       lb[INDEX_ID_OB]  = &(main->object);
+       lb[INDEX_ID_LS]  = &(main->linestyle); /* referenced by scenes */
+       lb[INDEX_ID_SCE] = &(main->scene);
+       lb[INDEX_ID_WM]  = &(main->wm);
+       lb[INDEX_ID_MSK] = &(main->mask);
        
-       lb[a] = NULL;
- 
-       BLI_assert(a + 1 == MAX_LIBARRAY);
+       lb[INDEX_ID_NULL] = NULL;
  
-       return a;
+       return (MAX_LIBARRAY - 1);
  }
  
  /* *********** ALLOC AND FREE *****************
diff --cc source/blender/makesdna/DNA_ID.h
index 725eefe,5c1bfc2..45eb312
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@@ -376,9 -377,50 +376,48 @@@ enum 
        FILTER_ID_TXT       = (1 << 24),
        FILTER_ID_VF        = (1 << 25),
        FILTER_ID_WO        = (1 << 26),
 -      FILTER_ID_PA        = (1 << 27),
 -      FILTER_ID_CF        = (1 << 28),
 +      FILTER_ID_CF        = (1 << 27),
  };
  
+ /* IMPORTANT: this enum matches the order currently use in 
set_lisbasepointers,
+  * keep them in sync! */
+ enum {
+       INDEX_ID_LI = 0,
+       INDEX_ID_IP,
+       INDEX_ID_AC,
+       INDEX_ID_KE,
+       INDEX_ID_GD,
+       INDEX_ID_NT,
+       INDEX_ID_IM,
+       INDEX_ID_TE,
+       INDEX_ID_MA,
+       INDEX_ID_VF,
+       INDEX_ID_AR,
+       INDEX_ID_CF,
+       INDEX_ID_ME,
+       INDEX_ID_CU,
+       INDEX_ID_MB,
+       INDEX_ID_LT,
+       INDEX_ID_LA,
+       INDEX_ID_CA,
+       INDEX_ID_TXT,
+       INDEX_ID_SO,
+       INDEX_ID_GR,
+       INDEX_ID_PAL,
+       INDEX_ID_PC,
+       INDEX_ID_BR,
 -      INDEX_ID_PA,
+       INDEX_ID_SPK,
+       INDEX_ID_WO,
+       INDEX_ID_MC,
+       INDEX_ID_SCR,
+       INDEX_ID_OB,
+       INDEX_ID_LS,
+       INDEX_ID_SCE,
+       INDEX_ID_WM,
+       INDEX_ID_MSK,
+       INDEX_ID_NULL,
+ };
+ 
  #ifdef __cplusplus
  }
  #endif

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to