Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_mesh_api.c
| Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | void RNA_api_mesh(StructRNA *srna) | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| const int normals_array_dim[] = {1, 3}; | const int normals_array_dim[] = {1, 3}; | ||||
| func = RNA_def_function(srna, "transform", "rna_Mesh_transform"); | func = RNA_def_function(srna, "transform", "rna_Mesh_transform"); | ||||
| RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix " | RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix " | ||||
| "(Warning: inverts normals if matrix is negative)"); | "(Warning: inverts normals if matrix is negative)"); | ||||
| parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f); | parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_boolean(func, "shape_keys", 0, "", "Transform Shape Keys"); | RNA_def_boolean(func, "shape_keys", 0, "", "Transform Shape Keys"); | ||||
| func = RNA_def_function(srna, "flip_normals", "rna_Mesh_flip_normals"); | func = RNA_def_function(srna, "flip_normals", "rna_Mesh_flip_normals"); | ||||
| RNA_def_function_ui_description(func, "Invert winding of all polygons " | RNA_def_function_ui_description(func, "Invert winding of all polygons " | ||||
| "(clears tessellation, does not handle custom normals)"); | "(clears tessellation, does not handle custom normals)"); | ||||
| func = RNA_def_function(srna, "calc_normals", "BKE_mesh_calc_normals"); | func = RNA_def_function(srna, "calc_normals", "BKE_mesh_calc_normals"); | ||||
| RNA_def_function_ui_description(func, "Calculate vertex normals"); | RNA_def_function_ui_description(func, "Calculate vertex normals"); | ||||
| Show All 26 Lines | RNA_def_boolean(func, "free_mpoly", 0, "Free MPoly", "Free data used by polygons and loops. " | ||||
| "only used on temporary mesh data-blocks to reduce memory footprint of render " | "only used on temporary mesh data-blocks to reduce memory footprint of render " | ||||
| "engines and export scripts"); | "engines and export scripts"); | ||||
| func = RNA_def_function(srna, "calc_smooth_groups", "rna_Mesh_calc_smooth_groups"); | func = RNA_def_function(srna, "calc_smooth_groups", "rna_Mesh_calc_smooth_groups"); | ||||
| RNA_def_function_ui_description(func, "Calculate smooth groups from sharp edges"); | RNA_def_function_ui_description(func, "Calculate smooth groups from sharp edges"); | ||||
| RNA_def_boolean(func, "use_bitflags", false, "", "Produce bitflags groups instead of simple numeric values"); | RNA_def_boolean(func, "use_bitflags", false, "", "Produce bitflags groups instead of simple numeric values"); | ||||
| /* return values */ | /* return values */ | ||||
| parm = RNA_def_int_array(func, "poly_groups", 1, NULL, 0, 0, "", "Smooth Groups", 0, 0); | parm = RNA_def_int_array(func, "poly_groups", 1, NULL, 0, 0, "", "Smooth Groups", 0, 0); | ||||
| RNA_def_property_flag(parm, PROP_DYNAMIC | PROP_OUTPUT); | RNA_def_parameter_flags(parm, PROP_DYNAMIC, PARM_OUTPUT); | ||||
| parm = RNA_def_int(func, "groups", 0, 0, INT_MAX, "groups", "Total number of groups", 0, INT_MAX); | parm = RNA_def_int(func, "groups", 0, 0, INT_MAX, "groups", "Total number of groups", 0, INT_MAX); | ||||
| RNA_def_property_flag(parm, PROP_OUTPUT); | RNA_def_parameter_flags(parm, 0, PARM_OUTPUT); | ||||
| func = RNA_def_function(srna, "normals_split_custom_set", "rna_Mesh_normals_split_custom_set"); | func = RNA_def_function(srna, "normals_split_custom_set", "rna_Mesh_normals_split_custom_set"); | ||||
| RNA_def_function_ui_description(func, | RNA_def_function_ui_description(func, | ||||
| "Define custom split normals of this mesh " | "Define custom split normals of this mesh " | ||||
| "(use zero-vectors to keep auto ones)"); | "(use zero-vectors to keep auto ones)"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| /* TODO, see how array size of 0 works, this shouldnt be used */ | /* TODO, see how array size of 0 works, this shouldnt be used */ | ||||
| parm = RNA_def_float_array(func, "normals", 1, NULL, -1.0f, 1.0f, "", "Normals", 0.0f, 0.0f); | parm = RNA_def_float_array(func, "normals", 1, NULL, -1.0f, 1.0f, "", "Normals", 0.0f, 0.0f); | ||||
| RNA_def_property_multi_array(parm, 2, normals_array_dim); | RNA_def_property_multi_array(parm, 2, normals_array_dim); | ||||
| RNA_def_property_flag(parm, PROP_DYNAMIC | PROP_REQUIRED); | RNA_def_parameter_flags(parm, PROP_DYNAMIC, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "normals_split_custom_set_from_vertices", | func = RNA_def_function(srna, "normals_split_custom_set_from_vertices", | ||||
| "rna_Mesh_normals_split_custom_set_from_vertices"); | "rna_Mesh_normals_split_custom_set_from_vertices"); | ||||
| RNA_def_function_ui_description(func, | RNA_def_function_ui_description(func, | ||||
| "Define custom split normals of this mesh, from vertices' normals " | "Define custom split normals of this mesh, from vertices' normals " | ||||
| "(use zero-vectors to keep auto ones)"); | "(use zero-vectors to keep auto ones)"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| /* TODO, see how array size of 0 works, this shouldnt be used */ | /* TODO, see how array size of 0 works, this shouldnt be used */ | ||||
| parm = RNA_def_float_array(func, "normals", 1, NULL, -1.0f, 1.0f, "", "Normals", 0.0f, 0.0f); | parm = RNA_def_float_array(func, "normals", 1, NULL, -1.0f, 1.0f, "", "Normals", 0.0f, 0.0f); | ||||
| RNA_def_property_multi_array(parm, 2, normals_array_dim); | RNA_def_property_multi_array(parm, 2, normals_array_dim); | ||||
| RNA_def_property_flag(parm, PROP_DYNAMIC | PROP_REQUIRED); | RNA_def_parameter_flags(parm, PROP_DYNAMIC, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "update", "ED_mesh_update"); | func = RNA_def_function(srna, "update", "ED_mesh_update"); | ||||
| RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges"); | RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges"); | ||||
| RNA_def_boolean(func, "calc_tessface", 0, "Calculate Tessellation", "Force recalculation of tessellation faces"); | RNA_def_boolean(func, "calc_tessface", 0, "Calculate Tessellation", "Force recalculation of tessellation faces"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_USE_CONTEXT); | ||||
| func = RNA_def_function(srna, "unit_test_compare", "rna_Mesh_unit_test_compare"); | func = RNA_def_function(srna, "unit_test_compare", "rna_Mesh_unit_test_compare"); | ||||
| RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to compare to"); | RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to compare to"); | ||||
| Show All 22 Lines | |||||