Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_object.c
| Show First 20 Lines • Show All 2,417 Lines • ▼ Show 20 Lines | static void rna_def_object(BlenderRNA *brna) | ||||
| RNA_def_property_float_funcs(prop, "rna_Object_boundbox_get", NULL, NULL); | RNA_def_property_float_funcs(prop, "rna_Object_boundbox_get", NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Bounding Box", | RNA_def_property_ui_text(prop, "Bounding Box", | ||||
| "Object's bounding box in object-space coordinates, all values are -1.0 when " | "Object's bounding box in object-space coordinates, all values are -1.0 when " | ||||
| "not available"); | "not available"); | ||||
| /* parent */ | /* parent */ | ||||
| prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL, NULL); | RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL, NULL); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); | RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK | PROP_OVERRIDABLE); | ||||
| RNA_def_property_ui_text(prop, "Parent", "Parent Object"); | RNA_def_property_ui_text(prop, "Parent", "Parent Object"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); | ||||
| prop = RNA_def_property(srna, "parent_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "parent_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_bitflag_sdna(prop, NULL, "partype"); | RNA_def_property_enum_bitflag_sdna(prop, NULL, "partype"); | ||||
| RNA_def_property_enum_items(prop, parent_type_items); | RNA_def_property_enum_items(prop, parent_type_items); | ||||
| RNA_def_property_enum_funcs(prop, NULL, "rna_Object_parent_type_set", "rna_Object_parent_type_itemf"); | RNA_def_property_enum_funcs(prop, NULL, "rna_Object_parent_type_set", "rna_Object_parent_type_itemf"); | ||||
| RNA_def_property_ui_text(prop, "Parent Type", "Type of parent relation"); | RNA_def_property_ui_text(prop, "Parent Type", "Type of parent relation"); | ||||
| ▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | RNA_def_property_int_funcs(prop, "rna_Object_active_material_index_get", "rna_Object_active_material_index_set", | ||||
| "rna_Object_active_material_index_range"); | "rna_Object_active_material_index_range"); | ||||
| RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material slot"); | RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material slot"); | ||||
| RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_LINKS, NULL); | RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_LINKS, NULL); | ||||
| /* transform */ | /* transform */ | ||||
| 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_editable_array_func(prop, "rna_Object_location_editable"); | RNA_def_property_editable_array_func(prop, "rna_Object_location_editable"); | ||||
| RNA_def_property_flag(prop, PROP_OVERRIDABLE); | |||||
| RNA_def_property_ui_text(prop, "Location", "Location of the object"); | RNA_def_property_ui_text(prop, "Location", "Location of the object"); | ||||
| 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_TRANSFORM, "rna_Object_internal_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_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_editable_array_func(prop, "rna_Object_rotation_4d_editable"); | RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable"); | ||||
| RNA_def_property_flag(prop, PROP_OVERRIDABLE); | |||||
| 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_TRANSFORM, "rna_Object_internal_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_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_array(prop, 4); | RNA_def_property_array(prop, 4); | ||||
| RNA_def_property_float_funcs(prop, "rna_Object_rotation_axis_angle_get", | RNA_def_property_float_funcs(prop, "rna_Object_rotation_axis_angle_get", | ||||
| "rna_Object_rotation_axis_angle_set", NULL); | "rna_Object_rotation_axis_angle_set", NULL); | ||||
| RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable"); | RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable"); | ||||
| RNA_def_property_float_array_default(prop, default_axisAngle); | RNA_def_property_float_array_default(prop, default_axisAngle); | ||||
| RNA_def_property_flag(prop, PROP_OVERRIDABLE); | |||||
| 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_TRANSFORM, "rna_Object_internal_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_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, "rot"); | RNA_def_property_float_sdna(prop, NULL, "rot"); | ||||
| RNA_def_property_editable_array_func(prop, "rna_Object_rotation_euler_editable"); | RNA_def_property_editable_array_func(prop, "rna_Object_rotation_euler_editable"); | ||||
| RNA_def_property_flag(prop, PROP_OVERRIDABLE); | |||||
| 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_TRANSFORM, "rna_Object_internal_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_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, prop_rotmode_items); /* XXX move to using a single define of this someday */ | RNA_def_property_enum_items(prop, prop_rotmode_items); /* XXX move to using a single define of this someday */ | ||||
| RNA_def_property_enum_funcs(prop, NULL, "rna_Object_rotation_mode_set", NULL); | RNA_def_property_enum_funcs(prop, NULL, "rna_Object_rotation_mode_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Rotation Mode", ""); | RNA_def_property_ui_text(prop, "Rotation Mode", ""); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_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_Object_scale_editable"); | RNA_def_property_editable_array_func(prop, "rna_Object_scale_editable"); | ||||
| RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3); | RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3); | ||||
| 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", "Scaling of the object"); | RNA_def_property_ui_text(prop, "Scale", "Scaling of the object"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); | ||||
| prop = RNA_def_property(srna, "dimensions", PROP_FLOAT, PROP_XYZ_LENGTH); | prop = RNA_def_property(srna, "dimensions", PROP_FLOAT, PROP_XYZ_LENGTH); | ||||
| RNA_def_property_array(prop, 3); | RNA_def_property_array(prop, 3); | ||||
| ▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | #endif | ||||
| RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); | RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); | ||||
| RNA_def_property_ui_text(prop, "Matrix", "Inverse of object's parent matrix at time of parenting"); | RNA_def_property_ui_text(prop, "Matrix", "Inverse of object's parent matrix at time of parenting"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); | ||||
| /* modifiers */ | /* modifiers */ | ||||
| prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "Modifier"); | RNA_def_property_struct_type(prop, "Modifier"); | ||||
| RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the geometric data of the object"); | RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the geometric data of the object"); | ||||
| RNA_def_property_flag(prop, PROP_OVERRIDABLE); | |||||
| rna_def_object_modifiers(brna, prop); | rna_def_object_modifiers(brna, prop); | ||||
| /* constraints */ | /* constraints */ | ||||
| prop = RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "Constraint"); | RNA_def_property_struct_type(prop, "Constraint"); | ||||
| RNA_def_property_ui_text(prop, "Constraints", "Constraints affecting the transformation of the object"); | RNA_def_property_ui_text(prop, "Constraints", "Constraints affecting the transformation of the object"); | ||||
| /* RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "constraints__add", "constraints__remove"); */ | /* RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "constraints__add", "constraints__remove"); */ | ||||
| rna_def_object_constraints(brna, prop); | rna_def_object_constraints(brna, prop); | ||||
| ▲ Show 20 Lines • Show All 296 Lines • ▼ Show 20 Lines | /* RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "constraints__add", "constraints__remove"); */ | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "poselib"); | RNA_def_property_pointer_sdna(prop, NULL, "poselib"); | ||||
| RNA_def_property_struct_type(prop, "Action"); | RNA_def_property_struct_type(prop, "Action"); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); | RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); | ||||
| RNA_def_property_ui_text(prop, "Pose Library", "Action used as a pose library for armatures"); | RNA_def_property_ui_text(prop, "Pose Library", "Action used as a pose library for armatures"); | ||||
| prop = RNA_def_property(srna, "pose", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "pose", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "pose"); | RNA_def_property_pointer_sdna(prop, NULL, "pose"); | ||||
| RNA_def_property_struct_type(prop, "Pose"); | RNA_def_property_struct_type(prop, "Pose"); | ||||
| RNA_def_property_flag(prop, PROP_OVERRIDABLE); | |||||
| RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures"); | RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures"); | ||||
| /* shape keys */ | /* shape keys */ | ||||
| prop = RNA_def_property(srna, "show_only_shape_key", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_only_shape_key", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK); | RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK); | ||||
| RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object"); | RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object"); | ||||
| RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); | RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); | ||||
| RNA_def_property_update(prop, 0, "rna_Object_internal_update_data"); | RNA_def_property_update(prop, 0, "rna_Object_internal_update_data"); | ||||
| ▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines | |||||