Page MenuHome

bpy.ops.transform.rotate works incorrect if not set "orient_matrix" value
Open, Confirmed, MediumPublic

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

Details

Type
Bug

Event Timeline

Philipp Oeser (lichtwerk) triaged this task as Confirmed, Medium priority.

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.