Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_object.c
| Show First 20 Lines • Show All 1,515 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| #else | #else | ||||
| static void rna_def_vertex_group(BlenderRNA *brna) | static void rna_def_vertex_group(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | |||||
| static EnumPropertyItem assign_mode_items[] = { | static EnumPropertyItem assign_mode_items[] = { | ||||
| {WEIGHT_REPLACE, "REPLACE", 0, "Replace", "Replace"}, | {WEIGHT_REPLACE, "REPLACE", 0, "Replace", "Replace"}, | ||||
| {WEIGHT_ADD, "ADD", 0, "Add", "Add"}, | {WEIGHT_ADD, "ADD", 0, "Add", "Add"}, | ||||
| {WEIGHT_SUBTRACT, "SUBTRACT", 0, "Subtract", "Subtract"}, | {WEIGHT_SUBTRACT, "SUBTRACT", 0, "Subtract", "Subtract"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| Show All 19 Lines | static void rna_def_vertex_group(BlenderRNA *brna) | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_int_funcs(prop, "rna_VertexGroup_index_get", NULL, NULL); | RNA_def_property_int_funcs(prop, "rna_VertexGroup_index_get", NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Index", "Index number of the vertex group"); | RNA_def_property_ui_text(prop, "Index", "Index number of the vertex group"); | ||||
| func = RNA_def_function(srna, "add", "rna_VertexGroup_vertex_add"); | func = RNA_def_function(srna, "add", "rna_VertexGroup_vertex_add"); | ||||
| RNA_def_function_ui_description(func, "Add vertices to the group"); | RNA_def_function_ui_description(func, "Add vertices to the group"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | ||||
| /* TODO, see how array size of 0 works, this shouldnt be used */ | /* TODO, see how array size of 0 works, this shouldnt be used */ | ||||
| prop = RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0); | parm = RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0); | ||||
| RNA_def_property_flag(prop, PROP_DYNAMIC | PROP_REQUIRED); | RNA_def_parameter_flags(parm, PROP_DYNAMIC, PARM_REQUIRED); | ||||
| prop = RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f); | parm = RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode"); | parm = RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode"); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "remove", "rna_VertexGroup_vertex_remove"); | func = RNA_def_function(srna, "remove", "rna_VertexGroup_vertex_remove"); | ||||
| RNA_def_function_ui_description(func, "Remove a vertex from the group"); | RNA_def_function_ui_description(func, "Remove a vertex from the group"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | ||||
| /* TODO, see how array size of 0 works, this shouldnt be used */ | /* TODO, see how array size of 0 works, this shouldnt be used */ | ||||
| prop = RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0); | parm = RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0); | ||||
| RNA_def_property_flag(prop, PROP_DYNAMIC | PROP_REQUIRED); | RNA_def_parameter_flags(parm, PROP_DYNAMIC, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "weight", "rna_VertexGroup_weight"); | func = RNA_def_function(srna, "weight", "rna_VertexGroup_weight"); | ||||
| RNA_def_function_ui_description(func, "Get a vertex weight from the group"); | RNA_def_function_ui_description(func, "Get a vertex weight from the group"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | ||||
| prop = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "The index of the vertex", 0, INT_MAX); | parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "The index of the vertex", 0, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f); | parm = RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f); | ||||
| RNA_def_function_return(func, prop); | RNA_def_function_return(func, parm); | ||||
| } | } | ||||
| static void rna_def_material_slot(BlenderRNA *brna) | static void rna_def_material_slot(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static EnumPropertyItem link_items[] = { | static EnumPropertyItem link_items[] = { | ||||
| ▲ Show 20 Lines • Show All 362 Lines • ▼ Show 20 Lines | static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint"); | RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint"); | ||||
| /* Constraint collection */ | /* Constraint collection */ | ||||
| func = RNA_def_function(srna, "new", "rna_Object_constraints_new"); | func = RNA_def_function(srna, "new", "rna_Object_constraints_new"); | ||||
| RNA_def_function_ui_description(func, "Add a new constraint to this object"); | RNA_def_function_ui_description(func, "Add a new constraint to this object"); | ||||
| /* object to add */ | /* object to add */ | ||||
| parm = RNA_def_enum(func, "type", rna_enum_constraint_type_items, 1, "", "Constraint type to add"); | parm = RNA_def_enum(func, "type", rna_enum_constraint_type_items, 1, "", "Constraint type to add"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint"); | parm = RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "remove", "rna_Object_constraints_remove"); | func = RNA_def_function(srna, "remove", "rna_Object_constraints_remove"); | ||||
| RNA_def_function_ui_description(func, "Remove a constraint from this object"); | RNA_def_function_ui_description(func, "Remove a constraint from this object"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| /* constraint to remove */ | /* constraint to remove */ | ||||
| parm = RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint"); | parm = RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| func = RNA_def_function(srna, "clear", "rna_Object_constraints_clear"); | func = RNA_def_function(srna, "clear", "rna_Object_constraints_clear"); | ||||
| RNA_def_function_ui_description(func, "Remove all constraint from this object"); | RNA_def_function_ui_description(func, "Remove all constraint from this object"); | ||||
| } | } | ||||
| /* object.modifiers */ | /* object.modifiers */ | ||||
| static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) | static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| { | { | ||||
| Show All 20 Lines | |||||
| /* RNA_def_property_collection_active(prop, prop_act); */ | /* RNA_def_property_collection_active(prop, prop_act); */ | ||||
| #endif | #endif | ||||
| /* add modifier */ | /* add modifier */ | ||||
| func = RNA_def_function(srna, "new", "rna_Object_modifier_new"); | func = RNA_def_function(srna, "new", "rna_Object_modifier_new"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | ||||
| RNA_def_function_ui_description(func, "Add a new modifier"); | RNA_def_function_ui_description(func, "Add a new modifier"); | ||||
| parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the modifier"); | parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the modifier"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* modifier to add */ | /* modifier to add */ | ||||
| parm = RNA_def_enum(func, "type", rna_enum_object_modifier_type_items, 1, "", "Modifier type to add"); | parm = RNA_def_enum(func, "type", rna_enum_object_modifier_type_items, 1, "", "Modifier type to add"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "modifier", "Modifier", "", "Newly created modifier"); | parm = RNA_def_pointer(func, "modifier", "Modifier", "", "Newly created modifier"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| /* remove modifier */ | /* remove modifier */ | ||||
| func = RNA_def_function(srna, "remove", "rna_Object_modifier_remove"); | func = RNA_def_function(srna, "remove", "rna_Object_modifier_remove"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | ||||
| RNA_def_function_ui_description(func, "Remove an existing modifier from the object"); | RNA_def_function_ui_description(func, "Remove an existing modifier from the object"); | ||||
| /* modifier to remove */ | /* modifier to remove */ | ||||
| parm = RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove"); | parm = RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| /* clear all modifiers */ | /* clear all modifiers */ | ||||
| func = RNA_def_function(srna, "clear", "rna_Object_modifier_clear"); | func = RNA_def_function(srna, "clear", "rna_Object_modifier_clear"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_USE_CONTEXT); | ||||
| RNA_def_function_ui_description(func, "Remove all modifiers from the object"); | RNA_def_function_ui_description(func, "Remove all modifiers from the object"); | ||||
| } | } | ||||
| /* object.particle_systems */ | /* object.particle_systems */ | ||||
| ▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| RNA_def_string(func, "name", "Group", 0, "", "Vertex group name"); /* optional */ | RNA_def_string(func, "name", "Group", 0, "", "Vertex group name"); /* optional */ | ||||
| parm = RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group"); | parm = RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "remove", "rna_Object_vgroup_remove"); | func = RNA_def_function(srna, "remove", "rna_Object_vgroup_remove"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| RNA_def_function_ui_description(func, "Delete vertex group from object"); | RNA_def_function_ui_description(func, "Delete vertex group from object"); | ||||
| parm = RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to remove"); | parm = RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to remove"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| func = RNA_def_function(srna, "clear", "rna_Object_vgroup_clear"); | func = RNA_def_function(srna, "clear", "rna_Object_vgroup_clear"); | ||||
| RNA_def_function_ui_description(func, "Delete all vertex groups from object"); | RNA_def_function_ui_description(func, "Delete all vertex groups from object"); | ||||
| } | } | ||||
| static void rna_def_object_lodlevel(BlenderRNA *brna) | static void rna_def_object_lodlevel(BlenderRNA *brna) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 836 Lines • Show Last 20 Lines | |||||