[Bf-python] local rotation

Campbell Barton ideasman42 at gmail.com
Thu May 26 21:58:14 CEST 2011


Using the transform operator might be more hassle then its worth, you
can modify the object matrix directly.

# This rotates 90deg about the objects own Y axis
bpy.context.object.matrix_world *= Matrix.Rotation(math.pi / 2.0, 4,
Vector((0.0, 1.0, 0.0)))

2011/5/26 Yuniel Castro González <ycastrog at estudiantes.uci.cu>:
> Hello to all.
> I have a cylinder in the scene that was rotated to world coordinates, then I need to rotate about its axis 'Y', with local coordinates and using a script.
> I think that this function is related to the topic, but I do not use it well.
>
> bpy.ops.transform.rotate(value=(0.191027,), axis=(0.338614, -0.757322, 0.558394), constraint_axis=(False, False, True), constraint_orientation='LOCAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=4.59497, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)
>
> How can I use it?
> Thanks in advance.
>
>
>
>
>
> --
>
>
>
>
>
>
>
>
> Yuniel
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>



-- 
- Campbell



More information about the Bf-python mailing list