Skip to content

Instantly share code, notes, and snippets.

@Dodotree
Last active May 15, 2018 23:43
Show Gist options
  • Save Dodotree/572bcaee58b98ad9fb5f18f453691a23 to your computer and use it in GitHub Desktop.
Save Dodotree/572bcaee58b98ad9fb5f18f453691a23 to your computer and use it in GitHub Desktop.
Select and activate object in Blender3D
import bpy
'''
Don't do it if you can avoid it
'''
def selectAndActivate(id):
bpy.ops.object.select_all(action='DESELECT')
bpy.data.objects[id].select = True
obj = bpy.context.selected_objects[0]
bpy.context.scene.objects.active = obj
return obj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment