Previous Thread  Next Thread

chat icon Auto Run unable to change context

vinniyo

Posted: Thu Dec 20, 2012 9:27 am
Joined: 20 Dec 2012
Posts: 7
Hi,
I'm very stumped and I assume that there isn't a fix for this so I'm looking for some kind of work around. It seems as if the Scene maybe loaded after the python script is autorun both by the command line " -P main.py" and also having register script checked. Certain script commands run fine. Eg:

bpy.ops.sequencer.delete()
bpy.ops.sequencer.sound_strip_add(filepath="C:\\par5.wav")
bpy.context.scene.frame_end = soundl

But selecting Modes or area types throw an error. Eg:

bpy.context.area.type = "SEQUENCE_EDITOR"
bpy.ops.object.mode_set(mode='POSE')
bpy.ops.pose.select_all(action='DESELECT')

Note: The script works fine if I click Run Script within Blender.
The purpose of this project is to automate random movements for the rig in a large video sequence. Blinks, hand gestures, etc.
Any help would be greatly appreciated. Thank you!
Reply with quote


vinniyo

Posted: Thu Dec 20, 2012 9:46 am
Joined: 20 Dec 2012
Posts: 7
bpy.context.area.type = "SEQUENCE_EDITOR" give
AttributeError: 'NoneType' object has no attribute 'type'
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group