Hi, I need to make a change to many blender files so I wrote a script using the bpy library to simplify the process. However, the command that changes the mode to edit mode does not work and I have to manually make the switch. This same command works on other simpler empty blender files so I was thinking maybe there’s something off with my blender file itself?? I’ll attach it to this post.
Here is the beginning bit of the script (up until the part where I manually have to change the mode):
bpy.ops.object.mode_set(mode=‘OBJECT’)
bpy.ops.object.empty_add(type=‘SPHERE’)
TARGET = bpy.context.active_object
TARGET.name = ‘TARGET’
TARGET.location = (0, 0.8, 1.3)
TARGET.scale = (0.2, 0.2, 0.2)
for obj in bpy.data.objects:
obj.select = False
armature = bpy.data.objects[31]
context = bpy.context
scene = context.scene
scene.objects.active = armature
bpy.ops.object.mode_set(mode=‘EDIT’)
- Since I am a new user, I can’t directly upload to this post so heres a link containing my .blend file : http://pasteall.org/blend/index.php?id=51150
Would really appreciate some help with this issue that I’m having!!