diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-24 17:48:10 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-24 17:48:10 +0300 |
commit | faec4309147988fbab7b7d7ec661f5130358d169 (patch) | |
tree | 0c839f8f88fe80f4a3762980adb5efe729ce1b44 /source/blender/makesdna | |
parent | f85745b17bfe68673bf5f799e98c617d9471ddf1 (diff) | |
parent | e1dd83b399d46d81ea51f6c41725eec5c1a1db7a (diff) |
Merge branch 'master' into blender2.8
Conflicts:
intern/cycles/blender/blender_curves.cpp
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenloader/intern/versioning_270.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/transform/transform_snap_object.c
source/blender/editors/util/undo.c
source/blender/makesrna/intern/rna_object_force.c
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_action_types.h | 46 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_armature_types.h | 14 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_camera_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_constraint_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_customdata_types.h | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_types.h | 19 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_node_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_view3d_types.h | 7 | ||||
-rw-r--r-- | source/blender/makesdna/intern/makesdna.c | 37 |
10 files changed, 114 insertions, 32 deletions
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 96d7ec3128c..4d82e4528d6 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -199,7 +199,8 @@ typedef struct bPoseChannel { char constflag; /* for quick detecting which constraints affect this channel */ char selectflag; /* copy of bone flag, so you can work with library armatures, not for runtime use */ char drawflag; - char pad0[5]; + char bboneflag; + char pad0[4]; struct Bone *bone; /* set on read file or rebuild pose */ struct bPoseChannel *parent; /* set on read file or rebuild pose */ @@ -242,7 +243,16 @@ typedef struct bPoseChannel { float ikstretch; float ikrotweight; /* weight of joint rotation constraint */ float iklinweight; /* weight of joint stretch constraint */ - + + /* curved bones settings - these are for animating, and are applied on top of the copies in pchan->bone */ + float roll1, roll2; + float curveInX, curveInY; + float curveOutX, curveOutY; + float scaleIn, scaleOut; + + struct bPoseChannel *bbone_prev; /* next/prev bones to use as handle references when calculating bbones (optional) */ + struct bPoseChannel *bbone_next; + void *temp; /* use for outliner */ } bPoseChannel; @@ -253,17 +263,17 @@ typedef enum ePchan_Flag { POSE_LOC = (1 << 0), POSE_ROT = (1 << 1), POSE_SIZE = (1 << 2), - /* old IK/cache stuff... */ -#if 0 - POSE_IK_MAT = (1 << 3), - POSE_UNUSED2 = (1 << 4), - POSE_UNUSED3 = (1 << 5), - POSE_UNUSED4 = (1 << 6), - POSE_UNUSED5 = (1 << 7), - /* has Standard IK */ - POSE_HAS_IK = (1 << 8), -#endif - /* IK/Pose solving*/ + + /* old IK/cache stuff + * - used to be here from (1 << 3) to (1 << 8) + * but has been repurposed since 2.77.2 + * as they haven't been used in over 10 years + */ + + /* has BBone deforms */ + POSE_BBONE_SHAPE = (1 << 3), + + /* IK/Pose solving */ POSE_CHAIN = (1 << 9), POSE_DONE = (1 << 10), /* visualization */ @@ -318,6 +328,16 @@ typedef enum ePchan_DrawFlag { #define PCHAN_CUSTOM_DRAW_SIZE(pchan) \ (pchan)->custom_scale * (((pchan)->drawflag & PCHAN_DRAW_NO_CUSTOM_BONE_SIZE) ? 1.0f : (pchan)->bone->length) +/* PoseChannel->bboneflag */ +typedef enum ePchan_BBoneFlag { + /* Use custom reference bones (for roll and handle alignment), instead of immediate neighbours */ + PCHAN_BBONE_CUSTOM_HANDLES = (1 << 1), + /* Evaluate start handle as being "relative" */ + PCHAN_BBONE_CUSTOM_START_REL = (1 << 2), + /* Evaluate end handle as being "relative" */ + PCHAN_BBONE_CUSTOM_END_REL = (1 << 3), +} ePchan_BBoneFlag; + /* PoseChannel->rotmode and Object->rotmode */ typedef enum eRotationModes { /* quaternion rotations (default, and for older Blender versions) */ diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index b995e6917a9..cda6441f0ae 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -68,11 +68,18 @@ typedef struct Bone { float xwidth, length, zwidth; /* width: for block bones. keep in this order, transform! */ float ease1, ease2; /* length of bezier handles */ float rad_head, rad_tail; /* radius for head/tail sphere, defining deform as well, parent->rad_tip overrides rad_head */ - + + float roll1, roll2; /* curved bones settings - these define the "restpose" for a curved bone */ + float curveInX, curveInY; + float curveOutX, curveOutY; + float scaleIn, scaleOut; + float size[3]; /* patch for upward compat, UNUSED! */ int layer; /* layers that bone appears on */ short segments; /* for B-bones */ - short pad[1]; + + short pad1; + } Bone; typedef struct bArmature { @@ -204,7 +211,8 @@ typedef enum eBone_Flag { BONE_TRANSFORM_CHILD = (1 << 20), /* Indicates that a parent is also being transformed */ BONE_UNSELECTABLE = (1 << 21), /* bone cannot be selected */ BONE_NO_LOCAL_LOCATION = (1 << 22), /* bone location is in armature space */ - BONE_RELATIVE_PARENTING = (1 << 23) /* object child will use relative transform (like deform) */ + BONE_RELATIVE_PARENTING = (1 << 23), /* object child will use relative transform (like deform) */ + BONE_ADD_PARENT_END_ROLL = (1 << 24) /* it will add the parent end roll to the inroll */ } eBone_Flag; diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h index 7f2e1aaadf9..68741578f27 100644 --- a/source/blender/makesdna/DNA_camera_types.h +++ b/source/blender/makesdna/DNA_camera_types.h @@ -53,6 +53,10 @@ typedef struct CameraStereoSettings { short pivot; short flag; short pad; + /* Cut-off angle at which interocular distance start to fade down. */ + float pole_merge_angle_from; + /* Cut-off angle at which interocular distance stops to fade down. */ + float pole_merge_angle_to; } CameraStereoSettings; typedef struct Camera { @@ -152,6 +156,7 @@ enum { /* stereo->flag */ enum { CAM_S3D_SPHERICAL = (1 << 0), + CAM_S3D_POLE_MERGE = (1 << 1), }; #ifdef __cplusplus diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 86991245068..5fcd374b21f 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -516,7 +516,9 @@ typedef enum eBConstraint_Flags { /* indicates that constraint was added locally (i.e. didn't come from the proxy-lib) */ CONSTRAINT_PROXY_LOCAL = (1<<8), /* indicates that constraint is temporarily disabled (only used in GE) */ - CONSTRAINT_OFF = (1<<9) + CONSTRAINT_OFF = (1<<9), + /* use bbone curve shape when calculating headtail values */ + CONSTRAINT_BBONE_SHAPE = (1<<10), } eBConstraint_Flags; /* bConstraint->ownspace/tarspace */ diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index 3807bb296fd..2d1ffaa53eb 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -75,6 +75,12 @@ typedef struct CustomData { /* CustomData.type */ typedef enum CustomDataType { + /* Used by GLSL attributes in the cases when we need a delayed CD type + * assignment (in the cases when we don't know in advance which layer + * we are addressing). + */ + CD_AUTO_FROM_NAME = -1, + CD_MVERT = 0, #ifdef DNA_DEPRECATED CD_MSTICKY = 1, /* DEPRECATED */ diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index e5e193d479b..41f53f9f51c 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -57,6 +57,14 @@ typedef enum eGPDspoint_Flag { GP_SPOINT_TAG = (1 << 1), } eGPSPoint_Flag; +/* Grease-Pencil Annotations - 'Triangle' + * -> A triangle contains the index of three vertices for filling the stroke + * This is only used if high quality fill is enabled + */ +typedef struct bGPDtriangle { + int v1, v2, v3; /* indices for tesselated triangle used for GP Fill */ +} bGPDtriangle; + /* Grease-Pencil Annotations - 'Stroke' * -> A stroke represents a (simplified version) of the curve * drawn by the user in one 'mousedown'->'mouseup' operation @@ -69,6 +77,10 @@ typedef struct bGPDstroke { short thickness; /* thickness of stroke (currently not used) */ short flag; /* various settings about this stroke */ + + bGPDtriangle *triangles;/* tesselated triangles for GP Fill */ + int tot_triangles; /* number of triangles in array */ + int pad1, *pad2; double inittime; /* Init time of stroke */ } bGPDstroke; @@ -83,6 +95,8 @@ typedef enum eGPDstroke_Flag { GP_STROKE_2DIMAGE = (1 << 2), /* stroke is selected */ GP_STROKE_SELECT = (1 << 3), + /* Recalculate triangulation for high quality fill (when true, force a new recalc) */ + GP_STROKE_RECALC_CACHES = (1 << 4), /* only for use with stroke-buffer (while drawing eraser) */ GP_STROKE_ERASER = (1 << 15) } eGPDstroke_Flag; @@ -132,8 +146,9 @@ typedef struct bGPDlayer { * this is used for the name of the layer too and kept unique. */ float draw_smoothfac; /* amount of smoothing to apply to newly created strokes */ + short draw_smoothlvl; /* number of times to apply smooth factor to new strokes */ short sublevel; /* number of times to subdivide new strokes */ - short pad[5]; /* padding for compiler error */ + short pad[4]; /* padding for compiler error */ } bGPDlayer; /* bGPDlayer->flag */ @@ -160,6 +175,8 @@ typedef enum eGPDlayer_Flag { GP_LAYER_GHOST_NEXTCOL = (1 << 9), /* "volumetric" strokes (i.e. GLU Quadric discs in 3D) */ GP_LAYER_VOLUMETRIC = (1 << 10), + /* Use high quality fill (instead of buggy legacy OpenGL Fill) */ + GP_LAYER_HQ_FILL = (1 << 11) } eGPDlayer_Flag; /* Grease-Pencil Annotations - 'DataBlock' */ diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index c75a019a28e..6cba3322135 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -689,6 +689,8 @@ typedef struct NodeColorBalance { float slope[3]; float offset[3]; float power[3]; + float offset_basis; + char _pad[4]; /* LGG parameters */ float lift[3]; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index b0b113272c8..8066eabdffc 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1242,7 +1242,7 @@ typedef struct CurvePaintSettings { int error_threshold; float radius_min, radius_max; float radius_taper_start, radius_taper_end; - float radius_offset; + float surface_offset; float corner_angle; } CurvePaintSettings; @@ -1251,6 +1251,7 @@ enum { CURVE_PAINT_FLAG_CORNERS_DETECT = (1 << 0), CURVE_PAINT_FLAG_PRESSURE_RADIUS = (1 << 1), CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS = (1 << 2), + CURVE_PAINT_FLAG_DEPTH_STROKE_OFFSET_ABS = (1 << 3), }; /* CurvePaintSettings.depth_mode */ @@ -1677,9 +1678,10 @@ typedef struct Scene { #define R_STAMP_RENDERTIME 0x0400 #define R_STAMP_CAMERALENS 0x0800 #define R_STAMP_STRIPMETA 0x1000 +#define R_STAMP_MEMORY 0x2000 #define R_STAMP_ALL (R_STAMP_TIME|R_STAMP_FRAME|R_STAMP_DATE|R_STAMP_CAMERA|R_STAMP_SCENE| \ R_STAMP_NOTE|R_STAMP_MARKER|R_STAMP_FILENAME|R_STAMP_SEQSTRIP| \ - R_STAMP_RENDERTIME|R_STAMP_CAMERALENS) + R_STAMP_RENDERTIME|R_STAMP_CAMERALENS|R_STAMP_MEMORY) /* alphamode */ #define R_ADDSKY 0 diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 0ef8f2616c4..321ff26f68f 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -237,6 +237,13 @@ typedef struct View3D { float stereo3d_convergence_factor; float stereo3d_volume_alpha; float stereo3d_convergence_alpha; + + /* Previous viewport draw type. + * Runtime-only, set in the rendered viewport otggle operator. + */ + short prev_drawtype; + short pad1; + float pad2; } View3D; diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index a714518c32f..d714587d7ab 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -718,6 +718,28 @@ static int arraysize(const char *str) return mul; } +static bool check_field_alignment(int firststruct, int structtype, int type, int len, + const char *name, const char *detail) +{ + bool result = true; + if (type < firststruct && typelens_native[type] > 4 && (len % 8)) { + fprintf(stderr, "Align 8 error (%s) in struct: %s %s (add %d padding bytes)\n", + detail, types[structtype], name, len % 8); + result = false; + } + if (typelens_native[type] > 3 && (len % 4) ) { + fprintf(stderr, "Align 4 error (%s) in struct: %s %s (add %d padding bytes)\n", + detail, types[structtype], name, len % 4); + result = false; + } + if (typelens_native[type] == 2 && (len % 2) ) { + fprintf(stderr, "Align 2 error (%s) in struct: %s %s (add %d padding bytes)\n", + detail, types[structtype], name, len % 2); + result = false; + } + return result; +} + static int calculate_structlens(int firststruct) { int unknown = nr_structs, lastunknown; @@ -813,20 +835,11 @@ static int calculate_structlens(int firststruct) } } - /* 2-4-8 aligned/ */ - if (type < firststruct && typelens_native[type] > 4 && (len_native % 8)) { - fprintf(stderr, "Align 8 error in struct: %s %s (add %d padding bytes)\n", - types[structtype], cp, len_native % 8); - dna_error = 1; - } - if (typelens_native[type] > 3 && (len_native % 4) ) { - fprintf(stderr, "Align 4 error in struct: %s %s (add %d padding bytes)\n", - types[structtype], cp, len_native % 4); + /* Check 2-4-8 aligned. */ + if (!check_field_alignment(firststruct, structtype, type, len_32, cp, "32 bit")) { dna_error = 1; } - else if (typelens_native[type] == 2 && (len_native % 2) ) { - fprintf(stderr, "Align 2 error in struct: %s %s (add %d padding bytes)\n", - types[structtype], cp, len_native % 2); + if (!check_field_alignment(firststruct, structtype, type, len_64, cp, "64 bit")) { dna_error = 1; } |