Last active
May 15, 2018 23:43
-
-
Save Dodotree/572bcaee58b98ad9fb5f18f453691a23 to your computer and use it in GitHub Desktop.
Select and activate object in Blender3D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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