diff options
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 3 | ||||
-rw-r--r-- | source/blender/editors/object/object_hook.c | 7 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 22 |
4 files changed, 12 insertions, 22 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 2d7f903ccd0..59c784658e8 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -544,7 +544,7 @@ Object *ED_object_add_type_with_obdata(bContext *C, } } else { - ob = BKE_object_add(bmain, scene, view_layer, type, name); + ob = BKE_object_add(bmain, view_layer, type, name); } BASACT(view_layer)->local_view_bits = local_view_bits; /* editor level activate, notifiers */ diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index bdd5094a9ef..2cca3045aee 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1970,13 +1970,12 @@ static bool get_new_constraint_target( /* if still not found, add a new empty to act as a target (if allowed) */ if ((found == false) && (add)) { Main *bmain = CTX_data_main(C); - Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); Object *obt; /* add new target object */ - obt = BKE_object_add(bmain, scene, view_layer, OB_EMPTY, NULL); + obt = BKE_object_add(bmain, view_layer, OB_EMPTY, NULL); /* transform cent to global coords for loc */ if (pchanact) { diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index aaf76ff649e..5cfe02dbc59 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -496,13 +496,12 @@ static bool hook_op_edit_poll(bContext *C) return false; } -static Object *add_hook_object_new( - Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, Object *obedit) +static Object *add_hook_object_new(Main *bmain, ViewLayer *view_layer, View3D *v3d, Object *obedit) { Base *basedit; Object *ob; - ob = BKE_object_add(bmain, scene, view_layer, OB_EMPTY, NULL); + ob = BKE_object_add(bmain, view_layer, OB_EMPTY, NULL); basedit = BKE_view_layer_base_find(view_layer, obedit); BLI_assert(view_layer->basact->object == ob); @@ -545,7 +544,7 @@ static int add_hook_object(const bContext *C, if (mode == OBJECT_ADDHOOK_NEWOB && !ob) { - ob = add_hook_object_new(bmain, scene, view_layer, v3d, obedit); + ob = add_hook_object_new(bmain, view_layer, v3d, obedit); /* transform cent to global coords for loc */ mul_v3_m4v3(ob->loc, obedit->obmat, cent); 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); |