1
$\begingroup$

I have a script that works fine on a non-mirrored mesh but produces a different result on a mirrored mesh. The script emulates the keystroke combination of "s", "x/y/z", "0" using the following line:

bpy.ops.transform.resize(value=(0, 1, 1), constraint_axis=(True, False, False), 
    constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', 
    proportional_edit_falloff='SMOOTH', proportional_size=1)

(substituting the appropriate values for x/y/z)

When I run this on a normal mesh in wire/solid mode I get the expected results:

enter image description here

With a mirrored mesh in wired mode I also get the correct result. However with mirrored and in solid mode I get this:

enter image description here

Moving any/all of the vertices immediately redraws the mesh and everything snaps to the correct place. I have tried changing the "mirror" attribute to "True" and get the same results. Is there a refresh/redraw option that I'm missing? I'm sure there is something I'm not getting but I can't seem to find it.

Thanks for any help…

  • @lan
$\endgroup$

1 Answer 1

1
$\begingroup$

So the operator seems to actually do what it is supposed to do, but the view lags behind.

Try the following call after transform.resize():

bpy.context.object.data.update()

That should trigger the update. I believe this update is incorrectly missing in the C-operator.

$\endgroup$
3
  • $\begingroup$ This fixed the issue. Thanks for the quick reply. $\endgroup$ Feb 6, 2014 at 17:54
  • $\begingroup$ You're welcome! Reported to tracker: developer.blender.org/T38525 $\endgroup$
    – CodeManX
    Feb 7, 2014 at 14:18
  • $\begingroup$ Brecht fixed it in trunk! rBf49e89fa378c $\endgroup$
    – CodeManX
    Feb 12, 2014 at 22:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .