Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_mesh_api.c
| Show First 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | |||||
| static void rna_Mesh_transform(Mesh *mesh, float *mat, int shape_keys) | static void rna_Mesh_transform(Mesh *mesh, float *mat, int shape_keys) | ||||
| { | { | ||||
| BKE_mesh_transform(mesh, (float (*)[4])mat, shape_keys); | BKE_mesh_transform(mesh, (float (*)[4])mat, shape_keys); | ||||
| DAG_id_tag_update(&mesh->id, 0); | DAG_id_tag_update(&mesh->id, 0); | ||||
| } | } | ||||
| static void rna_Mesh_flip_polygons(Mesh *mesh) | |||||
| { | |||||
| BKE_mesh_polygons_flip(mesh->mpoly, mesh->mloop, &mesh->ldata, mesh->totpoly); | |||||
| BKE_mesh_tessface_clear(mesh); | |||||
| DAG_id_tag_update(&mesh->id, 0); | |||||
| } | |||||
| #else | #else | ||||
| void RNA_api_mesh(StructRNA *srna) | 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"); | ||||
| 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_property_flag(parm, PROP_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_polygons", "rna_Mesh_flip_polygons"); | |||||
| RNA_def_function_ui_description(func, "Invert winding of all polygons (flip polygon 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"); | ||||
| func = RNA_def_function(srna, "create_normals_split", "rna_Mesh_create_normals_split"); | func = RNA_def_function(srna, "create_normals_split", "rna_Mesh_create_normals_split"); | ||||
| RNA_def_function_ui_description(func, "Empty split vertex normals"); | RNA_def_function_ui_description(func, "Empty split vertex normals"); | ||||
| func = RNA_def_function(srna, "calc_normals_split", "BKE_mesh_calc_normals_split"); | func = RNA_def_function(srna, "calc_normals_split", "BKE_mesh_calc_normals_split"); | ||||
| RNA_def_function_ui_description(func, "Calculate split vertex normals, which preserve sharp edges"); | RNA_def_function_ui_description(func, "Calculate split vertex normals, which preserve sharp edges"); | ||||
| ▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines | |||||