diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-09-07 07:09:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-07 07:09:50 +0300 |
commit | c350d1eb1387e763ca156f065305a0bce666ceb9 (patch) | |
tree | a611bf60a6b6e0922ab0b3ad9b2a36f33b78fe8a /source/blender/editors/object/object_modifier.c | |
parent | c695523687ef5bd43f50b6d057de785fad454be8 (diff) |
Cleanup: remove redundant scene argument in BKE_object_add
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 22 |
1 files changed, 7 insertions, 15 deletions
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); |