0
$\begingroup$

I' ve written the following function to apply a shrinkwrap modifier

def shrinkwrap(obs):
for ob in obs:
    if not ob.type == 'MESH':
        continue
    msw = ob.modifiers.new("shrink", type = 'SHRINKWRAP')
    bpy.data.objects["body_2"].modifiers["shrink"].target = bpy.data.objects["body_1"]
    bpy.ops.object.modifier_apply(apply_as = 'DATA')

I've problems with the last row (it is the function that should let me push the apply button shown in the following image )

enter image description here

In this image the target has not been selected, the function selects it correctly.

$\endgroup$
2
  • $\begingroup$ Hello, what exactly is your question ? $\endgroup$
    – Gorgious
    Commented Sep 11, 2020 at 15:32
  • $\begingroup$ Yes, thank you :) $\endgroup$ Commented Sep 11, 2020 at 16:02

0

Browse other questions tagged .