Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_constraint.c
| Show First 20 Lines • Show All 589 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| 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)) | ||||
| { | { | ||||
| bConstraint *con = (bConstraint *)ptr->data; | bConstraint *con = (bConstraint *)ptr->data; | ||||
| const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); | |||||
| ListBase targets = {NULL, NULL}; | ListBase targets = {NULL, NULL}; | ||||
| bConstraintTarget *ct; | bConstraintTarget *ct; | ||||
| if (cti && cti->get_constraint_targets) { | if (BKE_constraint_targets_get(con, &targets)) { | ||||
| cti->get_constraint_targets(con, &targets); | |||||
| for (ct = targets.first; ct; ct = ct->next) { | for (ct = targets.first; ct; ct = ct->next) { | ||||
| if (ct->tar && ct->tar->type == OB_ARMATURE) { | if (ct->tar && ct->tar->type == OB_ARMATURE) { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| if (cti->flush_constraint_targets) { | BKE_constraint_targets_flush(con, &targets, 1); | ||||
| cti->flush_constraint_targets(con, &targets, 1); | |||||
| } | |||||
| if (ct) { | if (ct) { | ||||
| return target_space_pchan_items; | return target_space_pchan_items; | ||||
| } | } | ||||
| } | } | ||||
| return space_object_items; | return space_object_items; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,973 Lines • Show Last 20 Lines | |||||