Rotation axis

there is a function that return the same value of this (the one in bold):

[bpy.ops.transform.rotate(value=(-0.488107,), axis=(0.099875, -0.947694, -0.303153), constraint_axis=(False, False, False), constraint_orientation=‘GLOBAL’, mirror=False, proportional=‘DISABLED’, proportional_edit_falloff=‘SMOOTH’, proportional_size=1, snap=False, snap_target=‘CLOSEST’, snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0),

i think is view location or rotation… but i don’t know to access to it!

hmm, if the rotate is executed the axis is used and now you want to find it back?
I think that is only possible if you have the world_matrix saved before the rotation and try to find out what the rotation axis was
to transform the old to the new …

i never used the world matrix and i don’t know how it can be used…

the problem is that i want implement the auto rotation function similar when you have a face selected and you use CTRL + LMB to extrude a face, in my script. for the moment i’ve used

bpy.ops.transform.rotate(value=(angle,) axis (var))

where “angle” is the angle between face center and mouse location and var is the vector take by a function that return the actual view rotation or location( i don’t know)

ok did it! PKHG you give me the inspiration. i used the perspective matrix to find wich index is equal to the “rotation axis” and it seems to be the third index…

the code is


Do not understand, but important you solved your problem :evilgrin: