From c350d1eb1387e763ca156f065305a0bce666ceb9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 7 Sep 2020 14:09:50 +1000 Subject: Cleanup: remove redundant scene argument in BKE_object_add --- source/blender/editors/object/object_modifier.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'source/blender/editors/object/object_modifier.c') diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 692a445fe9c..74d6a48c4bf 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -516,7 +516,6 @@ bool ED_object_modifier_move_to_index(ReportList *reports, bool ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Depsgraph *depsgraph, - Scene *scene, ViewLayer *view_layer, Object *ob, ModifierData *md) @@ -583,7 +582,7 @@ bool ED_object_modifier_convert(ReportList *UNUSED(reports), } /* add new mesh */ - obn = BKE_object_add(bmain, scene, view_layer, OB_MESH, NULL); + obn = BKE_object_add(bmain, view_layer, OB_MESH, NULL); me = obn->data; me->totvert = totvert; @@ -642,7 +641,6 @@ bool ED_object_modifier_convert(ReportList *UNUSED(reports), /* Gets mesh for the modifier which corresponds to an evaluated state. */ static Mesh *modifier_apply_create_mesh_for_modifier(Depsgraph *depsgraph, - Scene *UNUSED(scene), Object *object, ModifierData *md_eval, bool build_shapekey_layers) @@ -690,7 +688,7 @@ static int modifier_apply_shape(Main *bmain, return 0; } - mesh_applied = modifier_apply_create_mesh_for_modifier(depsgraph, scene, ob, md_eval, false); + mesh_applied = modifier_apply_create_mesh_for_modifier(depsgraph, ob, md_eval, false); if (!mesh_applied) { BKE_report(reports, RPT_ERROR, "Modifier is disabled or returned error, skipping apply"); return 0; @@ -750,7 +748,7 @@ static int modifier_apply_obdata( } } else { - mesh_applied = modifier_apply_create_mesh_for_modifier(depsgraph, scene, ob, md_eval, true); + mesh_applied = modifier_apply_create_mesh_for_modifier(depsgraph, ob, md_eval, true); if (!mesh_applied) { BKE_report(reports, RPT_ERROR, "Modifier returned error, skipping apply"); return 0; @@ -1509,13 +1507,11 @@ static int modifier_convert_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); - Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Object *ob = ED_object_active_context(C); ModifierData *md = edit_modifier_property_get(op, ob, 0); - if (!md || - !ED_object_modifier_convert(op->reports, bmain, depsgraph, scene, view_layer, ob, md)) { + if (!md || !ED_object_modifier_convert(op->reports, bmain, depsgraph, view_layer, ob, md)) { return OPERATOR_CANCELLED; } @@ -2336,10 +2332,7 @@ static void skin_armature_bone_create(Object *skin_ob, } } -static Object *modifier_skin_armature_create(Depsgraph *depsgraph, - Main *bmain, - Scene *scene, - Object *skin_ob) +static Object *modifier_skin_armature_create(Depsgraph *depsgraph, Main *bmain, Object *skin_ob) { BLI_bitmap *edges_visited; Mesh *me_eval_deform; @@ -2362,7 +2355,7 @@ static Object *modifier_skin_armature_create(Depsgraph *depsgraph, CustomData_add_layer(&me->vdata, CD_MDEFORMVERT, CD_CALLOC, NULL, me->totvert); ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph); - arm_ob = BKE_object_add(bmain, scene, view_layer, OB_ARMATURE, NULL); + arm_ob = BKE_object_add(bmain, view_layer, OB_ARMATURE, NULL); BKE_object_transform_copy(arm_ob, skin_ob); arm = arm_ob->data; arm->layer = 1; @@ -2414,7 +2407,6 @@ static int skin_armature_create_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); - Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C), *arm_ob; Mesh *me = ob->data; ModifierData *skin_md; @@ -2426,7 +2418,7 @@ static int skin_armature_create_exec(bContext *C, wmOperator *op) } /* create new armature */ - arm_ob = modifier_skin_armature_create(depsgraph, bmain, scene, ob); + arm_ob = modifier_skin_armature_create(depsgraph, bmain, ob); /* add a modifier to connect the new armature to the mesh */ arm_md = (ArmatureModifierData *)BKE_modifier_new(eModifierType_Armature); -- cgit v1.2.3