Post #753: : post_00754
π·οΈ Tags
macro python-scripting beginner solved
βοΈ Related PME Features
- Stack Key Editor
- Python Scripting
- Macro Editor
π¬ Content
yan.kansky:
roaoao, Iβm trying to make a button to move selected objects to center. It works if I type this text in βCommandβ:
bpy.context.object.location[0] = 0
[ATTACH=CONFIG]489161[/ATTACH]
but for active object only. What do I need to add to the command to make it move not just one but all selected objects to center on one axis?
try this with stack keys in command tab
for i in bpy.context.selected_objects: i.location[0] = 0
this one is for X axis , change i.location[0] tp i.location[1] for Y axis , and i.location[2] for z axiz ,
and to make it all in center , i.location = [0,0,0]
Hope this works