Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_main_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index b21cd3324b8..8f48738a27e 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -317,16 +317,9 @@ 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_undeformed)
+Mesh *rna_Main_meshes_new_from_object(Main *bmain, ReportList *reports, Object *object)
{
- Scene *sce = DEG_get_evaluated_scene(depsgraph);
-
- switch (ob->type) {
+ switch (object->type) {
case OB_FONT:
case OB_CURVE:
case OB_SURF:
@@ -338,7 +331,7 @@ Mesh *rna_Main_meshes_new_from_object(Main *bmain,
return NULL;
}
- return BKE_mesh_new_from_object(depsgraph, bmain, sce, ob, apply_modifiers, calc_undeformed);
+ return BKE_mesh_new_from_object(bmain, object);
}
static Light *rna_Main_lights_new(Main *bmain, const char *name, int type)
@@ -951,24 +944,13 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "new_from_object", "rna_Main_meshes_new_from_object");
- RNA_def_function_ui_description(func,
- "Add a new mesh created from object with modifiers applied");
+ RNA_def_function_ui_description(
+ func,
+ "Add a new mesh created from given object (undeformed geometry if object is original, and "
+ "final evaluated geometry, with all modifiers etc., if object is evaluated)");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm = RNA_def_pointer(func,
- "depsgraph",
- "Depsgraph",
- "Dependency Graph",
- "Evaluated dependency graph within which to evaluate modifiers");
- RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
parm = RNA_def_pointer(func, "object", "Object", "", "Object to create mesh from");
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_undeformed",
- false,
- "Calculate Undeformed",
- "Calculate undeformed vertex coordinates");
parm = RNA_def_pointer(func,
"mesh",
"Mesh",