Commit: 3d8bea03b263466f04355d7c7574d3f03708d198
Author: Kévin Dietrich
Date:   Thu Jul 28 19:46:53 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB3d8bea03b263466f04355d7c7574d3f03708d198

Merge branch 'master' into alembic_basic_io

Conflicts:
        source/blender/blenkernel/intern/library.c
        source/blender/makesdna/DNA_ID.h

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



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

diff --cc source/blender/blenkernel/intern/library.c
index a1d0a54,eb0aec9..af932fb
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@@ -426,9 -414,21 +417,24 @@@ bool id_make_local(Main *bmain, ID *id
                case ID_LS:
                        if (!test) BKE_linestyle_make_local(bmain, 
(FreestyleLineStyle *)id, lib_local);
                        return true;
+               case ID_PAL:
+                       if (!test) BKE_palette_make_local(bmain, (Palette *)id, 
lib_local);
+                       return true;
+               case ID_PC:
+                       if (!test) BKE_paint_curve_make_local(bmain, 
(PaintCurve *)id, lib_local);
+                       return true;
+               case ID_MC:
+                       return false;  /* TODO missing implementation */
 +              case ID_CF:
 +                      if (!test) BKE_cachefile_make_local(bmain, (CacheFile 
*)id, lib_local);
 +                      return true;
+               case ID_SCR:
+               case ID_LI:
+               case ID_KE:
+               case ID_WM:
+                       return false; /* can't be linked */
+               case ID_IP:
+                       return false; /* deprecated */
        }
  
        return false;
@@@ -531,9 -517,23 +523,26 @@@ bool id_copy(Main *bmain, ID *id, ID **
                case ID_LS:
                        if (!test) *newid = (ID *)BKE_linestyle_copy(bmain, 
(FreestyleLineStyle *)id);
                        return true;
+               case ID_PAL:
+                       if (!test) *newid = (ID *)BKE_palette_copy(bmain, 
(Palette *)id);
+                       return true;
+               case ID_PC:
+                       if (!test) *newid = (ID *)BKE_paint_curve_copy(bmain, 
(PaintCurve *)id);
+                       return true;
 +              case ID_CF:
-                       if (!test) *newid = (ID *)BKE_cachefile_copy(G.main, 
(CacheFile *)id);
++                      if (!test) *newid = (ID *)BKE_cachefile_copy(bmain, 
(CacheFile *)id);
 +                      return true;
+               case ID_SCE:
+               case ID_LI:
+               case ID_SCR:
+               case ID_WM:
+                       return false;  /* can't be copied from here */
+               case ID_VF:
+               case ID_SO:
+               case ID_MC:
+                       return false;  /* not implemented */
+               case ID_IP:
+                       return false;  /* deprecated */
        }
        
        return false;
@@@ -1055,9 -1036,21 +1051,24 @@@ void BKE_libblock_init_empty(ID *id
                case ID_LS:
                        BKE_linestyle_init((FreestyleLineStyle *)id);
                        break;
 +              case ID_CF:
 +                      /* Nothing to do. */
 +                      break;
+               case ID_KE:
+                       /* Shapekeys are a complex topic too - they depend on 
their 'user' data type...
+                        * They are not linkable, though, so it should never 
reach here anyway. */
+                       BLI_assert(0);
+                       break;
+               case ID_WM:
+                       /* We should never reach this. */
+                       BLI_assert(0);
+                       break;
+               case ID_IP:
+                       /* Should not be needed - animation from lib pre-2.5 is 
broken anyway. */
+                       BLI_assert(0);
+                       break;
+               default:
+                       BLI_assert(0);  /* Should never reach this point... */
        }
  }
  
diff --cc source/blender/makesdna/DNA_ID.h
index 3ad87b9,07df94e..0f8cc8f
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@@ -213,44 -213,49 +213,50 @@@ typedef struct PreviewImage 
   * Written to #BHead.code (for file IO)
   * and the first 2 bytes of #ID.name (for runtime checks, see #GS macro).
   */
- #define ID_SCE                MAKE_ID2('S', 'C') /* Scene */
- #define ID_LI         MAKE_ID2('L', 'I') /* Library */
- #define ID_OB         MAKE_ID2('O', 'B') /* Object */
- #define ID_ME         MAKE_ID2('M', 'E') /* Mesh */
- #define ID_CU         MAKE_ID2('C', 'U') /* Curve */
- #define ID_MB         MAKE_ID2('M', 'B') /* MetaBall */
- #define ID_MA         MAKE_ID2('M', 'A') /* Material */
- #define ID_TE         MAKE_ID2('T', 'E') /* Tex (Texture) */
- #define ID_IM         MAKE_ID2('I', 'M') /* Image */
- #define ID_LT         MAKE_ID2('L', 'T') /* Lattice */
- #define ID_LA         MAKE_ID2('L', 'A') /* Lamp */
- #define ID_CA         MAKE_ID2('C', 'A') /* Camera */
- #define ID_IP         MAKE_ID2('I', 'P') /* Ipo (depreciated, replaced by 
FCurves) */
- #define ID_KE         MAKE_ID2('K', 'E') /* Key (shape key) */
- #define ID_WO         MAKE_ID2('W', 'O') /* World */
- #define ID_SCR                MAKE_ID2('S', 'R') /* Screen */
- #define ID_SCRN               MAKE_ID2('S', 'N') /* (depreciated?) */
- #define ID_VF         MAKE_ID2('V', 'F') /* VFont (Vector Font) */
- #define ID_TXT                MAKE_ID2('T', 'X') /* Text */
- #define ID_SPK                MAKE_ID2('S', 'K') /* Speaker */
- #define ID_SO         MAKE_ID2('S', 'O') /* Sound */
- #define ID_GR         MAKE_ID2('G', 'R') /* Group */
- #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_NT         MAKE_ID2('N', 'T') /* bNodeTree */
- #define ID_BR         MAKE_ID2('B', 'R') /* Brush */
- #define ID_PA         MAKE_ID2('P', 'A') /* ParticleSettings */
- #define ID_GD         MAKE_ID2('G', 'D') /* bGPdata, (Grease Pencil) */
- #define ID_WM         MAKE_ID2('W', 'M') /* WindowManager */
- #define ID_MC         MAKE_ID2('M', 'C') /* MovieClip */
- #define ID_MSK                MAKE_ID2('M', 'S') /* Mask */
- #define ID_LS         MAKE_ID2('L', 'S') /* FreestyleLineStyle */
- #define ID_PAL                MAKE_ID2('P', 'L') /* Palette */
- #define ID_PC         MAKE_ID2('P', 'C') /* PaintCurve  */
- #define ID_CF         MAKE_ID2('C', 'F') /* CacheFile */
- 
-       /* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */
+ typedef enum ID_Type {
+       ID_SCE  = MAKE_ID2('S', 'C'), /* Scene */
+       ID_LI   = MAKE_ID2('L', 'I'), /* Library */
+       ID_OB   = MAKE_ID2('O', 'B'), /* Object */
+       ID_ME   = MAKE_ID2('M', 'E'), /* Mesh */
+       ID_CU   = MAKE_ID2('C', 'U'), /* Curve */
+       ID_MB   = MAKE_ID2('M', 'B'), /* MetaBall */
+       ID_MA   = MAKE_ID2('M', 'A'), /* Material */
+       ID_TE   = MAKE_ID2('T', 'E'), /* Tex (Texture) */
+       ID_IM   = MAKE_ID2('I', 'M'), /* Image */
+       ID_LT   = MAKE_ID2('L', 'T'), /* Lattice */
+       ID_LA   = MAKE_ID2('L', 'A'), /* Lamp */
+       ID_CA   = MAKE_ID2('C', 'A'), /* Camera */
+       ID_IP   = MAKE_ID2('I', 'P'), /* Ipo (depreciated, replaced by FCurves) 
*/
+       ID_KE   = MAKE_ID2('K', 'E'), /* Key (shape key) */
+       ID_WO   = MAKE_ID2('W', 'O'), /* World */
+       ID_SCR  = MAKE_ID2('S', 'R'), /* Screen */
+       ID_VF   = MAKE_ID2('V', 'F'), /* VFont (Vector Font) */
+       ID_TXT  = MAKE_ID2('T', 'X'), /* Text */
+       ID_SPK  = MAKE_ID2('S', 'K'), /* Speaker */
+       ID_SO   = MAKE_ID2('S', 'O'), /* Sound */
+       ID_GR   = MAKE_ID2('G', 'R'), /* Group */
+       ID_AR   = MAKE_ID2('A', 'R'), /* bArmature */
+       ID_AC   = MAKE_ID2('A', 'C'), /* bAction */
+       ID_NT   = MAKE_ID2('N', 'T'), /* bNodeTree */
+       ID_BR   = MAKE_ID2('B', 'R'), /* Brush */
+       ID_PA   = MAKE_ID2('P', 'A'), /* ParticleSettings */
+       ID_GD   = MAKE_ID2('G', 'D'), /* bGPdata, (Grease Pencil) */
+       ID_WM   = MAKE_ID2('W', 'M'), /* WindowManager */
+       ID_MC   = MAKE_ID2('M', 'C'), /* MovieClip */
+       ID_MSK  = MAKE_ID2('M', 'S'), /* Mask */
+       ID_LS   = MAKE_ID2('L', 'S'), /* FreestyleLineStyle */
+       ID_PAL  = MAKE_ID2('P', 'L'), /* Palette */
+       ID_PC   = MAKE_ID2('P', 'C'), /* PaintCurve  */
++      ID_CF   = MAKE_ID2('C', 'F'), /* CacheFile */
+ } ID_Type;
+ 
+ /* Only used as 'placeholder' in .blend files for directly linked datablocks. 
*/
+ #define ID_ID       MAKE_ID2('I', 'D') /* (internal use only) */
+ 
+ /* Deprecated. */
+ #define ID_SCRN           MAKE_ID2('S', 'N')
+ 
+ /* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */
  #define ID_SEQ                MAKE_ID2('S', 'Q')
                        /* constraint */
  #define ID_CO         MAKE_ID2('C', 'O')

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

Reply via email to