📋 Metadata
- Author: draguu
- Date: 2017-06-27 22:49:40
- Type:
answer - Reply to: post_00750
- Replies (1): post_00754
💬 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