Page MenuHome

bpy.ops.transform.rotate works incorrect if not set "orient_matrix" value
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce 920M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 416.81

Blender Version
Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-07-05 16:36, hash: rB699193713fc0
Worked: 2.79b

Short description of error
If not set "orient_matrix" value in operator bpy.ops.transform.rotate, object will be rotate in anoter side. This works for GLOBAL and LOCAL orientations.

For Example:

bpy.ops.transform.rotate(value=0.349066, orient_axis='Y', orient_type='GLOBAL', orient_matrix_type='GLOBAL', constraint_axis=(False, True, False)) must rotate global Y axis 20 degrees.
In fact: Rotate global Y axis -20 degrees.

or

bpy.ops.transform.rotate(value=0.349066, orient_axis='X', orient_type='LOCAL', orient_matrix_type='LOCAL', constraint_axis=(True, False, False)) must rotate local X axis 20 degrees.
In fact: Rotate local X axis -20 degrees.

Exact steps for others to reproduce the error

  • Create New File and select Default Cube
  • Open Python Console
  • Run: bpy.ops.transform.rotate(value=0.349066, orient_axis='Y', orient_type='GLOBAL', orient_matrix_type='GLOBAL', constraint_axis=(False, True, False)) or bpy.ops.transform.rotate(value=0.349066, orient_axis='X', orient_type='LOCAL', orient_matrix_type='LOCAL', constraint_axis=(True, False, False))
  • Check result cube's rotation

Event Timeline

Philipp Oeser (lichtwerk) lowered the priority of this task from 90 to 50.

Confirmed.

@Campbell Barton (campbellbarton) : just guessing: not sure why we are inverting spacemtx in initTransformOrientation here (if skipped for for the non-modal case, issue seems to be gone...)?

Also If you set the orientation type to VIEW and dont set the orient_matrix, it will use the global orientation.

Bastien Montagne (mont29) changed the subtype of this task from "Report" to "Bug".Jan 27 2020, 5:19 PM

This bug was gone in 2.90.1 but has now reappeared in 2.91 and is even worse as setting orient_matrix no longer prevents the bug. As far as I can tell there is now no way to get transform.rotate to output a none reversed rotation without inverting a value.

This bug was gone in 2.90.1 but has now reappeared in 2.91 and is even worse as setting orient_matrix no longer prevents the bug. As far as I can tell there is now no way to get transform.rotate to output a none reversed rotation without inverting a value.

Since this is a bit of a new situation in 2.91, could you make a new report for this?
(you can also reference this report in the new one, but overall, this will make it easier to track progress, thx)

Can not replicate the issue. Checked with 2.93 LTS and 3.0.0 (rBd1e1d6c4916addd078f6ec7fb944829652e6a39a). Issue was there in 2.92 release.

Hi @Philipp Oeser (lichtwerk) , are you able to reproduce the problem with 2.93LTS?

Output:

2.922.93LTS
Philipp Oeser (lichtwerk) closed this task as Resolved.Fri, Jul 23, 1:12 PM
Philipp Oeser (lichtwerk) claimed this task.

This was fixed by rB92743cc895dd: Fix T85886: Rotate Tool and Adjust Last Operation - angles inverted, so bug is not in 2.93 nor 3.0.
Will close as resolved (but of course feel free to comment again if issues persist)