Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_pose.c
| Show First 20 Lines • Show All 833 Lines • ▼ Show 20 Lines | static void rna_def_pose_channel(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "PoseBone"); | RNA_def_property_struct_type(prop, "PoseBone"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Child", "Child of this pose bone"); | RNA_def_property_ui_text(prop, "Child", "Child of this pose bone"); | ||||
| /* Transformation settings */ | /* Transformation settings */ | ||||
| prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); | prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); | ||||
| RNA_def_property_float_sdna(prop, NULL, "loc"); | RNA_def_property_float_sdna(prop, NULL, "loc"); | ||||
| RNA_def_property_flag(prop, PROP_OVERRIDABLE); | |||||
| RNA_def_property_editable_array_func(prop, "rna_PoseChannel_location_editable"); | RNA_def_property_editable_array_func(prop, "rna_PoseChannel_location_editable"); | ||||
| RNA_def_property_ui_text(prop, "Location", ""); | RNA_def_property_ui_text(prop, "Location", ""); | ||||
| 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); | ||||
| 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, "scale", PROP_FLOAT, PROP_XYZ); | prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); | ||||
| RNA_def_property_float_sdna(prop, NULL, "size"); | RNA_def_property_float_sdna(prop, NULL, "size"); | ||||
| RNA_def_property_flag(prop, PROP_PROPORTIONAL); | RNA_def_property_flag(prop, PROP_PROPORTIONAL | PROP_OVERRIDABLE); | ||||
| RNA_def_property_editable_array_func(prop, "rna_PoseChannel_scale_editable"); | RNA_def_property_editable_array_func(prop, "rna_PoseChannel_scale_editable"); | ||||
| RNA_def_property_float_array_default(prop, default_scale); | RNA_def_property_float_array_default(prop, default_scale); | ||||
| RNA_def_property_ui_text(prop, "Scale", ""); | RNA_def_property_ui_text(prop, "Scale", ""); | ||||
| 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, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION); | prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION); | ||||
| RNA_def_property_float_sdna(prop, NULL, "quat"); | RNA_def_property_float_sdna(prop, NULL, "quat"); | ||||
| RNA_def_property_flag(prop, PROP_OVERRIDABLE); | |||||
| RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable"); | RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable"); | ||||
| RNA_def_property_float_array_default(prop, default_quat); | RNA_def_property_float_array_default(prop, default_quat); | ||||
| RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions"); | RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); | ||||
| /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but | /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but | ||||
| * having a single one is better for Keyframing and other property-management situations... | * having a single one is better for Keyframing and other property-management situations... | ||||
| */ | */ | ||||
| prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE); | prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE); | ||||
| RNA_def_property_flag(prop, PROP_OVERRIDABLE); | |||||
| RNA_def_property_array(prop, 4); | RNA_def_property_array(prop, 4); | ||||
| RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get", | RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get", | ||||
| "rna_PoseChannel_rotation_axis_angle_set", NULL); | "rna_PoseChannel_rotation_axis_angle_set", NULL); | ||||
| RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable"); | RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable"); | ||||
| RNA_def_property_float_array_default(prop, default_axisAngle); | RNA_def_property_float_array_default(prop, default_axisAngle); | ||||
| RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation"); | RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); | ||||
| prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER); | prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER); | ||||
| RNA_def_property_float_sdna(prop, NULL, "eul"); | RNA_def_property_float_sdna(prop, NULL, "eul"); | ||||
| RNA_def_property_flag(prop, PROP_OVERRIDABLE); | |||||
| RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_euler_editable"); | RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_euler_editable"); | ||||
| RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers"); | RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); | ||||
| prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "rotmode"); | RNA_def_property_enum_sdna(prop, NULL, "rotmode"); | ||||
| RNA_def_property_enum_items(prop, rna_enum_posebone_rotmode_items); /* XXX move to using a single define of this someday */ | RNA_def_property_enum_items(prop, rna_enum_posebone_rotmode_items); /* XXX move to using a single define of this someday */ | ||||
| RNA_def_property_enum_funcs(prop, NULL, "rna_PoseChannel_rotation_mode_set", NULL); | RNA_def_property_enum_funcs(prop, NULL, "rna_PoseChannel_rotation_mode_set", NULL); | ||||
| ▲ Show 20 Lines • Show All 510 Lines • ▼ Show 20 Lines | static void rna_def_pose(BlenderRNA *brna) | ||||
| srna = RNA_def_struct(brna, "Pose", NULL); | srna = RNA_def_struct(brna, "Pose", NULL); | ||||
| RNA_def_struct_sdna(srna, "bPose"); | RNA_def_struct_sdna(srna, "bPose"); | ||||
| RNA_def_struct_ui_text(srna, "Pose", "A collection of pose channels, including settings for animating bones"); | RNA_def_struct_ui_text(srna, "Pose", "A collection of pose channels, including settings for animating bones"); | ||||
| /* pose channels */ | /* pose channels */ | ||||
| prop = RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_collection_sdna(prop, NULL, "chanbase", NULL); | RNA_def_property_collection_sdna(prop, NULL, "chanbase", NULL); | ||||
| RNA_def_property_struct_type(prop, "PoseBone"); | RNA_def_property_struct_type(prop, "PoseBone"); | ||||
| RNA_def_property_flag(prop, PROP_OVERRIDABLE); | |||||
| RNA_def_property_ui_text(prop, "Pose Bones", "Individual pose bones for the armature"); | RNA_def_property_ui_text(prop, "Pose Bones", "Individual pose bones for the armature"); | ||||
| /* can be removed, only for fast lookup */ | /* can be removed, only for fast lookup */ | ||||
| RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_PoseBones_lookup_string", NULL); | RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_PoseBones_lookup_string", NULL); | ||||
| /* bone groups */ | /* bone groups */ | ||||
| prop = RNA_def_property(srna, "bone_groups", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "bone_groups", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_collection_sdna(prop, NULL, "agroups", NULL); | RNA_def_property_collection_sdna(prop, NULL, "agroups", NULL); | ||||
| RNA_def_property_struct_type(prop, "BoneGroup"); | RNA_def_property_struct_type(prop, "BoneGroup"); | ||||
| Show All 33 Lines | |||||