0
$\begingroup$

for some reason the

bpy.ops.transform.rotate

code dont take account the pivot point, i dont understand why? and its only one part of my problem... in my code :

import bpy 

A = bpy.context.view_layer.objects.active
A.select_set(state=False)
bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]
bpy.ops.object.editmode_toggle()
bpy.context.scene.tool_settings.transform_pivot_point = 'BOUNDING_BOX_CENTER'
bpy.ops.transform.rotate(value=4.71239, axis=(1, 0, 0), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='ENABLED', proportional_edit_falloff='SMOOTH', proportional_size=0.00584779)

i need that every object of my selection exept the active object do a rotation of 270* on the x axis while the origin point stay in place, is it possible ?

im on 2.8 by the way i was trying to use the new multi-mesh-editor function, and this new select code :

A.select_set(state=False)

instead of the old code

thanks in advance

$\endgroup$

1 Answer 1

-2
$\begingroup$

here's the version I had to use in my script to set the pivot point to work in blender 2.80. by setting the transform to rotatate around the cursor, all objects will rotate around that locations and you can use shift+s to place the cursor.

context.scene.tool_settings.transform_pivot_point = 'CURSOR'

$\endgroup$
2
  • 1
    $\begingroup$ could you expand appon this. While that one line may be the answer. It would be much more useful if you for example linked to the documentation, explained what each part of that did, or how this is different from pre 2.8 $\endgroup$
    – David
    Jun 21, 2019 at 3:02
  • $\begingroup$ sure. actually. here's an addon with a gif that explains how I do this: gumroad.com/l/fastpivot $\endgroup$
    – spiraloid
    Oct 9, 2019 at 19:26

You must log in to answer this question.

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