📋 Metadata

💬 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?

draguu:

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

draguu , thank you very much, it worked like a charm! :slight_smile:


❤️ 1 likes


🔗 View on Blender Artists