diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-27 19:46:39 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-27 19:46:39 +0300 |
commit | 38cb29d67e5947f99824987dcd567a82cfd51646 (patch) | |
tree | afce1b3eb6e3545e89d7e1698bb0a6d37efba263 /source/blender/makesrna/intern/rna_object_api.c | |
parent | edce44d6931586fad3cee019db762d54e73a886a (diff) |
Cleanup: Nuke most of remaining evil G.main from RNA.
The few ones in getters/setters we cannot remove as easily, for now we
can live with those I think...
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 9b8a98a8831..237f3167f9a 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -140,10 +140,10 @@ static void rna_Object_camera_fit_coords( /* copied from Mesh_getFromObject and adapted to RNA interface */ /* settings: 0 - preview, 1 - render */ static Mesh *rna_Object_to_mesh( - Object *ob, ReportList *reports, Scene *sce, + Object *ob, Main *bmain, ReportList *reports, Scene *sce, int apply_modifiers, int settings, int calc_tessface, int calc_undeformed) { - return rna_Main_meshes_new_from_object(G.main, reports, sce, ob, apply_modifiers, settings, calc_tessface, calc_undeformed); + return rna_Main_meshes_new_from_object(bmain, reports, sce, ob, apply_modifiers, settings, calc_tessface, calc_undeformed); } /* mostly a copy from convertblender.c */ @@ -558,7 +558,7 @@ void RNA_api_object(StructRNA *srna) /* mesh */ func = RNA_def_function(srna, "to_mesh", "rna_Object_to_mesh"); RNA_def_function_ui_description(func, "Create a Mesh data-block with modifiers applied"); - RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers"); |