Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_constraint.c
| Show First 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | static const EnumPropertyItem euler_order_items[] = { | ||||
| {CONSTRAINT_EULER_YZX, "YZX", 0, "YZX Euler", "Euler using the YZX rotation order"}, | {CONSTRAINT_EULER_YZX, "YZX", 0, "YZX Euler", "Euler using the YZX rotation order"}, | ||||
| {CONSTRAINT_EULER_ZXY, "ZXY", 0, "ZXY Euler", "Euler using the ZXY rotation order"}, | {CONSTRAINT_EULER_ZXY, "ZXY", 0, "ZXY Euler", "Euler using the ZXY rotation order"}, | ||||
| {CONSTRAINT_EULER_ZYX, "ZYX", 0, "ZYX Euler", "Euler using the ZYX rotation order"}, | {CONSTRAINT_EULER_ZYX, "ZYX", 0, "ZYX Euler", "Euler using the ZYX rotation order"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| static const EnumPropertyItem space_object_items[] = { | static const EnumPropertyItem owner_space_object_items[] = { | ||||
| {CONSTRAINT_SPACE_WORLD, | |||||
| "WORLD", | |||||
| 0, | |||||
| "World Space", | |||||
| "The constraint is applied relative to the world coordinate system"}, | |||||
| {CONSTRAINT_SPACE_CUSTOM, | |||||
| "CUSTOM", | |||||
| 0, | |||||
| "Custom Space", | |||||
| "The constraint is applied in local space of a custom object/bone/vertex group"}, | |||||
| {CONSTRAINT_SPACE_LOCAL, | |||||
| "LOCAL", | |||||
| 0, | |||||
| "Local Space", | |||||
| "The constraint is applied relative to the local coordinate system of the object"}, | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| static const EnumPropertyItem target_space_object_items[] = { | |||||
| {CONSTRAINT_SPACE_WORLD, | {CONSTRAINT_SPACE_WORLD, | ||||
| "WORLD", | "WORLD", | ||||
| 0, | 0, | ||||
| "World Space", | "World Space", | ||||
| "The transformation of the target is evaluated relative to the world coordinate system"}, | "The transformation of the target is evaluated relative to the world coordinate system"}, | ||||
| {CONSTRAINT_SPACE_CUSTOM, | {CONSTRAINT_SPACE_CUSTOM, | ||||
| "CUSTOM", | "CUSTOM", | ||||
| 0, | 0, | ||||
| ▲ Show 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | static const EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *UNUSED(C), | ||||
| Object *ob = (Object *)ptr->owner_id; | Object *ob = (Object *)ptr->owner_id; | ||||
| bConstraint *con = (bConstraint *)ptr->data; | bConstraint *con = (bConstraint *)ptr->data; | ||||
| if (BLI_findindex(&ob->constraints, con) == -1) { | if (BLI_findindex(&ob->constraints, con) == -1) { | ||||
| return owner_space_pchan_items; | return owner_space_pchan_items; | ||||
| } | } | ||||
| else { | else { | ||||
| /* object */ | /* object */ | ||||
| return space_object_items; | return owner_space_object_items; | ||||
| } | } | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C), | static const EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C), | ||||
| PointerRNA *ptr, | PointerRNA *ptr, | ||||
| PropertyRNA *UNUSED(prop), | PropertyRNA *UNUSED(prop), | ||||
| bool *UNUSED(r_free)) | bool *UNUSED(r_free)) | ||||
| { | { | ||||
| Show All 10 Lines | if (BKE_constraint_targets_get(con, &targets)) { | ||||
| BKE_constraint_targets_flush(con, &targets, 1); | BKE_constraint_targets_flush(con, &targets, 1); | ||||
| if (ct) { | if (ct) { | ||||
| return target_space_pchan_items; | return target_space_pchan_items; | ||||
| } | } | ||||
| } | } | ||||
| return space_object_items; | return target_space_object_items; | ||||
| } | } | ||||
| static bConstraintTarget *rna_ArmatureConstraint_target_new(ID *id, bConstraint *con, Main *bmain) | static bConstraintTarget *rna_ArmatureConstraint_target_new(ID *id, bConstraint *con, Main *bmain) | ||||
| { | { | ||||
| bArmatureConstraint *acon = con->data; | bArmatureConstraint *acon = con->data; | ||||
| bConstraintTarget *tgt = MEM_callocN(sizeof(bConstraintTarget), "Constraint Target"); | bConstraintTarget *tgt = MEM_callocN(sizeof(bConstraintTarget), "Constraint Target"); | ||||
| tgt->weight = 1.0f; | tgt->weight = 1.0f; | ||||
| ▲ Show 20 Lines • Show All 2,973 Lines • Show Last 20 Lines | |||||