Commit: fd2ffb0b9e674a5edefa159d086d6a64edb3abe5 Author: Campbell Barton Date: Thu Oct 11 12:14:03 2018 +1100 Branches: blender2.8 https://developer.blender.org/rBfd2ffb0b9e674a5edefa159d086d6a64edb3abe5
RNA: remove redundant new_from_object/to_mesh arg If the caller wants loop-tris, there is a function to calculate them. =================================================================== M intern/cycles/blender/blender_util.h M source/blender/blenkernel/BKE_mesh.h M source/blender/blenkernel/intern/mesh_convert.c M source/blender/editors/object/object_bake_api.c M source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp M source/blender/makesrna/intern/rna_internal.h M source/blender/makesrna/intern/rna_main_api.c M source/blender/makesrna/intern/rna_object_api.c =================================================================== diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index b43a186a9b3..bb66359f4c7 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -64,7 +64,7 @@ static inline BL::Mesh object_to_mesh(BL::BlendData& data, subsurf_mod.show_viewport(false); } - BL::Mesh me = data.meshes.new_from_object(depsgraph, object, apply_modifiers, false, calc_undeformed); + BL::Mesh me = data.meshes.new_from_object(depsgraph, object, apply_modifiers, calc_undeformed); if(subdivision_type != Mesh::SUBDIVISION_NONE) { BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1]; diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index c7232015059..44a3b56a320 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -179,7 +179,7 @@ void BKE_mesh_split_faces(struct Mesh *mesh, bool free_loop_normals); struct Mesh *BKE_mesh_new_from_object( struct Depsgraph *depsgraph, struct Main *bmain, struct Scene *sce, struct Object *ob, - const bool apply_modifiers, const bool calc_loop_triangles, const bool calc_undeformed); + const bool apply_modifiers, const bool calc_undeformed); struct Mesh *BKE_mesh_create_derived_for_modifier( struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct ModifierData *md, int build_shapekey_layers); diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c index bb52ed79b53..4d7d2e4b931 100644 --- a/source/blender/blenkernel/intern/mesh_convert.c +++ b/source/blender/blenkernel/intern/mesh_convert.c @@ -840,7 +840,7 @@ void BKE_mesh_to_curve(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object * /* settings: 1 - preview, 2 - render */ Mesh *BKE_mesh_new_from_object( Depsgraph *depsgraph, Main *bmain, Scene *sce, Object *ob, - const bool apply_modifiers, const bool calc_loop_triangles, const bool calc_undeformed) + const bool apply_modifiers, const bool calc_undeformed) { Mesh *tmpmesh; Curve *tmpcu = NULL, *copycu; @@ -1069,11 +1069,6 @@ Mesh *BKE_mesh_new_from_object( break; } /* end copy materials */ - if (calc_loop_triangles) { - /* cycles and exporters rely on this still */ - BKE_mesh_runtime_looptri_ensure(tmpmesh); - } - return tmpmesh; } diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index d0d82a8ccc7..cc9f21df3f9 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -635,7 +635,7 @@ static Mesh *bake_mesh_new_from_object(Depsgraph *depsgraph, Main *bmain, Scene { ED_object_editmode_load(bmain, ob); - Mesh *me = BKE_mesh_new_from_object(depsgraph, bmain, scene, ob, 1, 0, 0); + Mesh *me = BKE_mesh_new_from_object(depsgraph, bmain, scene, ob, 1, 0); if (me->flag & ME_AUTOSMOOTH) { BKE_mesh_split_faces(me, true); } diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp index 016637f8002..a42e59ddb2a 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp @@ -107,13 +107,11 @@ NodeGroup *BlenderFileLoader::Load() bool apply_modifiers = false; bool calc_undeformed = false; - bool calc_loop_triangles = false; Mesh *mesh = BKE_mesh_new_from_object(depsgraph, _re->main, _re->scene, ob, apply_modifiers, - calc_loop_triangles, calc_undeformed); if (mesh) { diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 7087be9de2d..155c030587d 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -490,7 +490,7 @@ int rna_parameter_size(struct PropertyRNA *parm); struct Mesh *rna_Main_meshes_new_from_object( struct Main *bmain, struct ReportList *reports, struct Depsgraph *depsgraph, - struct Object *ob, bool apply_modifiers, bool calc_loop_triangles, bool calc_undeformed); + struct Object *ob, bool apply_modifiers, bool calc_undeformed); /* XXX, these should not need to be defined here~! */ struct MTex *rna_mtex_texture_slots_add(struct ID *self, struct bContext *C, struct ReportList *reports); diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 48ced4df0b4..59c9e523914 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -310,7 +310,7 @@ static Mesh *rna_Main_meshes_new(Main *bmain, const char *name) /* copied from Mesh_getFromObject and adapted to RNA interface */ Mesh *rna_Main_meshes_new_from_object( Main *bmain, ReportList *reports, Depsgraph *depsgraph, - Object *ob, bool apply_modifiers, bool calc_loop_triangles, bool calc_undeformed) + Object *ob, bool apply_modifiers, bool calc_undeformed) { Scene *sce = DEG_get_evaluated_scene(depsgraph); @@ -326,7 +326,7 @@ Mesh *rna_Main_meshes_new_from_object( return NULL; } - return BKE_mesh_new_from_object(depsgraph, bmain, sce, ob, apply_modifiers, calc_loop_triangles, calc_undeformed); + return BKE_mesh_new_from_object(depsgraph, bmain, sce, ob, apply_modifiers, calc_undeformed); } static Lamp *rna_Main_lights_new(Main *bmain, const char *name, int type) @@ -893,7 +893,6 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - RNA_def_boolean(func, "calc_loop_triangles", true, "Calculate Triangles", "Calculate tesselated triangles"); RNA_def_boolean(func, "calc_undeformed", false, "Calculate Undeformed", "Calculate undeformed vertex coordinates"); parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export"); diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index de4dfbbdae7..458c26f7026 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -224,11 +224,11 @@ static void rna_Object_camera_fit_coords( /* settings: 0 - preview, 1 - render */ static Mesh *rna_Object_to_mesh( Object *ob, bContext *C, ReportList *reports, Depsgraph *depsgraph, - bool apply_modifiers, bool calc_loop_triangles, bool calc_undeformed) + bool apply_modifiers, bool calc_undeformed) { Main *bmain = CTX_data_main(C); - return rna_Main_meshes_new_from_object(bmain, reports, depsgraph, ob, apply_modifiers, calc_loop_triangles, calc_undeformed); + return rna_Main_meshes_new_from_object(bmain, reports, depsgraph, ob, apply_modifiers, calc_undeformed); } static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList *reports, @@ -594,7 +594,6 @@ void RNA_api_object(StructRNA *srna) RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - RNA_def_boolean(func, "calc_loop_triangles", true, "Calculate Loop Triangles", "Calculate triangle tessellation"); RNA_def_boolean(func, "calc_undeformed", false, "Calculate Undeformed", "Calculate undeformed vertex coordinates"); parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export"); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs