diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-01-02 07:14:17 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-01-02 07:14:17 +0300 |
commit | a7d268d38e348722977a9fcf72624af691e724cd (patch) | |
tree | 36b8374679b46ce301a301226326dcd3605a0557 | |
parent | bbac520987e68492d27c12a2b863c7839309008b (diff) |
Cessen Rigging Request: "Copy Transforms" Constraint
This constraint simply copies the transformation matrix of the target, and assigns it to the owner.
-rw-r--r-- | release/scripts/ui/properties_data_armature.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/properties_object_constraint.py | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 57 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 13 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_constraint_types.h | 23 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 174 |
7 files changed, 194 insertions, 82 deletions
diff --git a/release/scripts/ui/properties_data_armature.py b/release/scripts/ui/properties_data_armature.py index 28cf215fa62..e751aaf772c 100644 --- a/release/scripts/ui/properties_data_armature.py +++ b/release/scripts/ui/properties_data_armature.py @@ -89,6 +89,7 @@ class DATA_PT_display(DataButtonsPanel): def draw(self, context): layout = self.layout + ob = context.object arm = context.armature wide_ui = context.region.width > narrowui @@ -108,6 +109,7 @@ class DATA_PT_display(DataButtonsPanel): col = split.column() col.prop(arm, "draw_group_colors", text="Colors") col.prop(arm, "delay_deform", text="Delay Refresh") + col.prop(ob, "x_ray", text="X-Ray (Object)") class DATA_PT_bone_groups(DataButtonsPanel): diff --git a/release/scripts/ui/properties_object_constraint.py b/release/scripts/ui/properties_object_constraint.py index 6bff8d6d727..cb6f8cd71a2 100644 --- a/release/scripts/ui/properties_object_constraint.py +++ b/release/scripts/ui/properties_object_constraint.py @@ -460,6 +460,12 @@ class ConstraintButtonsPanel(bpy.types.Panel): layout.prop(con, "use_offset") self.space_template(layout, con, wide_ui) + + def COPY_TRANSFORMS(self, context, layout, con, wide_ui): + self.target_template(layout, con, wide_ui) + + self.space_template(layout, con, wide_ui) + #def SCRIPT(self, context, layout, con): diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 797fe8f7324..4de148803f8 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1690,8 +1690,8 @@ static void sizelike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t if (VALID_CONS_TARGET(ct)) { float obsize[3], size[3]; - mat4_to_size( size,ct->matrix); - mat4_to_size( obsize,cob->matrix); + mat4_to_size(size, ct->matrix); + mat4_to_size(obsize, cob->matrix); if ((data->flag & SIZELIKE_X) && (obsize[0] != 0)) { if (data->flag & SIZELIKE_OFFSET) { @@ -1735,6 +1735,58 @@ static bConstraintTypeInfo CTI_SIZELIKE = { sizelike_evaluate /* evaluate */ }; +/* ----------- Copy Transforms ------------- */ + +static int translike_get_tars (bConstraint *con, ListBase *list) +{ + if (con && list) { + bTransLikeConstraint *data= con->data; + bConstraintTarget *ct; + + /* standard target-getting macro for single-target constraints */ + SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list) + + return 1; + } + + return 0; +} + +static void translike_flush_tars (bConstraint *con, ListBase *list, short nocopy) +{ + if (con && list) { + bTransLikeConstraint *data= con->data; + bConstraintTarget *ct= list->first; + + /* the following macro is used for all standard single-target constraints */ + SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy) + } +} + +static void translike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) +{ + bConstraintTarget *ct= targets->first; + + if (VALID_CONS_TARGET(ct)) { + /* just copy the entire transform matrix of the target */ + copy_m4_m4(cob->matrix, ct->matrix); + } +} + +static bConstraintTypeInfo CTI_TRANSLIKE = { + CONSTRAINT_TYPE_TRANSLIKE, /* type */ + sizeof(bTransLikeConstraint), /* size */ + "Copy Transforms", /* name */ + "bTransLikeConstraint", /* struct name */ + NULL, /* free data */ + NULL, /* relink data */ + NULL, /* copy data */ + NULL, /* new data */ + translike_get_tars, /* get constraint targets */ + translike_flush_tars, /* flush constraint targets */ + default_get_tarmat, /* get target matrix */ + translike_evaluate /* evaluate */ +}; /* ----------- Python Constraint -------------- */ @@ -3565,6 +3617,7 @@ static void constraints_init_typeinfo () { constraintsTypeInfo[20]= &CTI_SHRINKWRAP; /* Shrinkwrap Constraint */ constraintsTypeInfo[21]= &CTI_DAMPTRACK; /* Damped TrackTo Constraint */ constraintsTypeInfo[22]= &CTI_SPLINEIK; /* Spline IK Constraint */ + constraintsTypeInfo[23]= &CTI_TRANSLIKE; /* Copy Transforms Constraint */ } /* This function should be used for getting the appropriate type-info when only diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 88c120dc1e1..b3cc52add49 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2302,6 +2302,13 @@ static void lib_link_constraints(FileData *fd, ID *id, ListBase *conlist) data->tar = newlibadr(fd, id->lib, data->tar); } break; + case CONSTRAINT_TYPE_TRANSLIKE: + { + bTransLikeConstraint *data; + data= ((bTransLikeConstraint*)con->data); + data->tar = newlibadr(fd, id->lib, data->tar); + } + break; case CONSTRAINT_TYPE_NULL: break; } @@ -11154,6 +11161,12 @@ static void expand_constraints(FileData *fd, Main *mainvar, ListBase *lb) expand_doit(fd, mainvar, data->tar); } break; + case CONSTRAINT_TYPE_TRANSLIKE: + { + bTransLikeConstraint *data = (bTransLikeConstraint*)curcon->data; + expand_doit(fd, mainvar, data->tar); + } + break; default: break; } diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 0476d69544a..163933da12a 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -200,6 +200,20 @@ typedef struct bLocateLikeConstraint { char subtarget[32]; } bLocateLikeConstraint; +/* Copy Scale Constraint */ +typedef struct bSizeLikeConstraint { + Object *tar; + int flag; + int reserved1; + char subtarget[32]; +} bSizeLikeConstraint; + +/* Copy Transform Constraint */ +typedef struct bTransLikeConstraint { + Object *tar; + char subtarget[32]; +} bTransLikeConstraint; + /* Floor Constraint */ typedef struct bMinMaxConstraint { Object *tar; @@ -211,14 +225,6 @@ typedef struct bMinMaxConstraint { char subtarget[32]; } bMinMaxConstraint; -/* Copy Scale Constraint */ -typedef struct bSizeLikeConstraint { - Object *tar; - int flag; - int reserved1; - char subtarget[32]; -} bSizeLikeConstraint; - /* Action Constraint */ typedef struct bActionConstraint { Object *tar; @@ -401,6 +407,7 @@ typedef enum eBConstraint_Types { CONSTRAINT_TYPE_SHRINKWRAP, /* shrinkwrap (loc/rot) constraint */ CONSTRAINT_TYPE_DAMPTRACK, /* New Tracking constraint that minimises twisting */ CONSTRAINT_TYPE_SPLINEIK, /* Spline-IK - Align 'n' bones to a curve */ + CONSTRAINT_TYPE_TRANSLIKE, /* Copy transform matrix */ /* NOTE: no constraints are allowed to be added after this */ NUM_CONSTRAINT_TYPES diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 908d832daf1..39232113581 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -167,6 +167,7 @@ extern StructRNA RNA_Controller; extern StructRNA RNA_CopyLocationConstraint; extern StructRNA RNA_CopyRotationConstraint; extern StructRNA RNA_CopyScaleConstraint; +extern StructRNA RNA_CopyTransformsConstraint; extern StructRNA RNA_Curve; extern StructRNA RNA_CurveMap; extern StructRNA RNA_CurveMapping; diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index f9405dec531..5ec8d438c42 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -43,6 +43,7 @@ EnumPropertyItem constraint_type_items[] ={ {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", ICON_CONSTRAINT_DATA, "Copy Location", ""}, {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", ICON_CONSTRAINT_DATA, "Copy Rotation", ""}, {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", ICON_CONSTRAINT_DATA, "Copy Scale", ""}, + {CONSTRAINT_TYPE_TRANSLIKE, "COPY_TRANSFORMS", ICON_CONSTRAINT_DATA, "Copy Transforms", ""}, {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", ICON_CONSTRAINT_DATA, "Limit Distance", ""}, {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", ICON_CONSTRAINT_DATA, "Limit Location", ""}, {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", ICON_CONSTRAINT_DATA, "Limit Rotation", ""}, @@ -151,6 +152,8 @@ static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr) return &RNA_DampedTrackConstraint; case CONSTRAINT_TYPE_SPLINEIK: return &RNA_SplineIKConstraint; + case CONSTRAINT_TYPE_TRANSLIKE: + return &RNA_CopyTransformsConstraint; default: return &RNA_UnknownType; } @@ -647,6 +650,69 @@ static void rna_def_constraint_track_to(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } +static void rna_def_constraint_locate_like(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint"); + RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copies the location of the target."); + + prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); + RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_def_struct_sdna_from(srna, "bLocateLikeConstraint", "data"); + + prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "tar"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Target", "Target Object"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + + prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "subtarget"); + RNA_def_property_ui_text(prop, "Sub-Target", ""); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + + prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X); + RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X location."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y); + RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y location."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z); + RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z location."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + prop= RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X_INVERT); + RNA_def_property_ui_text(prop, "Invert X", "Invert the X location."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + prop= RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y_INVERT); + RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y location."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z_INVERT); + RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z location."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_OFFSET); + RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); +} + static void rna_def_constraint_rotate_like(BlenderRNA *brna) { StructRNA *srna; @@ -703,20 +769,14 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } -static void rna_def_constraint_locate_like(BlenderRNA *brna) +static void rna_def_constraint_size_like(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copies the location of the target."); - - prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); - RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); - RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1."); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - - RNA_def_struct_sdna_from(srna, "bLocateLikeConstraint", "data"); + srna= RNA_def_struct(brna, "CopyScaleConstraint", "Constraint"); + RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copies the scale of the target."); + RNA_def_struct_sdna_from(srna, "bSizeLikeConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); @@ -731,39 +791,50 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X); - RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X location."); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_X); + RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X scale."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y); - RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y location."); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Y); + RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y scale."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z); - RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z location."); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Z); + RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z scale."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - prop= RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X_INVERT); - RNA_def_property_ui_text(prop, "Invert X", "Invert the X location."); + prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_OFFSET); + RNA_def_property_ui_text(prop, "Offset", "Add original scale into copied scale."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); +} - prop= RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y_INVERT); - RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y location."); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); +static void rna_def_constraint_transform_like(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; - prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z_INVERT); - RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z location."); + srna= RNA_def_struct(brna, "CopyTransformsConstraint", "Constraint"); + RNA_def_struct_ui_text(srna, "Copy Transforms Constraint", "Copies all the transforms of the target."); + RNA_def_struct_sdna_from(srna, "bTransLikeConstraint", "data"); + + prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); + RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_OFFSET); - RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location."); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "tar"); + RNA_def_property_ui_text(prop, "Target", "Target Object"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + + prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "subtarget"); + RNA_def_property_ui_text(prop, "Sub-Target", ""); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); } static void rna_def_constraint_minmax(BlenderRNA *brna) @@ -817,48 +888,6 @@ static void rna_def_constraint_minmax(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } -static void rna_def_constraint_size_like(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna= RNA_def_struct(brna, "CopyScaleConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copies the scale of the target."); - RNA_def_struct_sdna_from(srna, "bSizeLikeConstraint", "data"); - - prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "tar"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Target", "Target Object"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_X); - RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X scale."); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - - prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Y); - RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y scale."); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - - prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Z); - RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z scale."); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - - prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_OFFSET); - RNA_def_property_ui_text(prop, "Offset", "Add original scale into copied scale."); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); -} - static void rna_def_constraint_action(BlenderRNA *brna) { StructRNA *srna; @@ -1869,6 +1898,7 @@ void RNA_def_constraint(BlenderRNA *brna) rna_def_constraint_size_like(brna); rna_def_constraint_locate_like(brna); rna_def_constraint_rotate_like(brna); + rna_def_constraint_transform_like(brna); rna_def_constraint_minmax(brna); rna_def_constraint_track_to(brna); rna_def_constraint_kinematic(brna); |