Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_pose.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| /* use API Method for conversions... */ | /* use API Method for conversions... */ | ||||
| BKE_rotMode_change_values( | BKE_rotMode_change_values( | ||||
| pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, (short)value); | pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, (short)value); | ||||
| /* finally, set the new rotation type */ | /* finally, set the new rotation type */ | ||||
| pchan->rotmode = value; | pchan->rotmode = value; | ||||
| } | } | ||||
| static float rna_PoseChannel_length_get(PointerRNA *ptr) | |||||
| { | |||||
| bPoseChannel *pchan = ptr->data; | |||||
| return len_v3v3(pchan->pose_head, pchan->pose_tail); | |||||
| } | |||||
| static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value) | static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value) | ||||
| { | { | ||||
| Object *ob = (Object *)ptr->owner_id; | Object *ob = (Object *)ptr->owner_id; | ||||
| bPoseChannel *pchan = (bPoseChannel *)ptr->data; | bPoseChannel *pchan = (bPoseChannel *)ptr->data; | ||||
| char oldname[sizeof(pchan->name)], newname[sizeof(pchan->name)]; | char oldname[sizeof(pchan->name)], newname[sizeof(pchan->name)]; | ||||
| /* need to be on the stack */ | /* need to be on the stack */ | ||||
| BLI_strncpy_utf8(newname, value, sizeof(pchan->name)); | BLI_strncpy_utf8(newname, value, sizeof(pchan->name)); | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); | RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); | ||||
| prop = RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION); | prop = RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION); | ||||
| RNA_def_property_float_sdna(prop, NULL, "pose_tail"); | RNA_def_property_float_sdna(prop, NULL, "pose_tail"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Pose Tail Position", "Location of tail of the channel's bone"); | RNA_def_property_ui_text(prop, "Pose Tail Position", "Location of tail of the channel's bone"); | ||||
| RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); | RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); | ||||
| prop = RNA_def_property(srna, "length", PROP_FLOAT, PROP_DISTANCE); | |||||
| RNA_def_property_float_funcs(prop, "rna_PoseChannel_length_get", NULL, NULL); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_ui_text(prop, "Length", "Length of the bone"); | |||||
| /* IK Settings */ | /* IK Settings */ | ||||
| prop = RNA_def_property(srna, "is_in_ik_chain", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "is_in_ik_chain", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL); | RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain"); | RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); | ||||
| prop = RNA_def_property(srna, "lock_ik_x", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "lock_ik_x", PROP_BOOLEAN, PROP_NONE); | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||