Python access to GUI limits/possible workarounds?

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

Post Reply
Duoas
Posts: 0
Joined: Mon Apr 18, 2005 10:32 am

Python access to GUI limits/possible workarounds?

Post by Duoas »

I was trying to write a python script that used the Video Sequence Editor (which methinks is not likely to happen now...)

One thing I was trying to do is just to change the current area to the Sequence Editor. You can do this by hand by pressing Shift+F8, but using something like:

Code: Select all

area = Window.GetAreaID()
Window.SetKeyQualifiers( Window.Qual.SHIFT )
Window.QAdd( area, F8KEY, 1 )
Window.QAdd( area, F8KEY, 0 )
Window.SetKeyQualifiers( 0 )
...
Window.QHandle( area )
(and variations) doesn't want to work. The only workaround would be to 1) check to see if the VSE is already open in the current screen, 2) check to see if the screen '4-Sequencer' is available and change to it, 3) give up and complain to the user...

(But, of course, once I get to the sequencer options are limited anyway...)


My question is this: currently python scripting in Blender seems a bit disconnected. Are there any plans to integrate it more tightly? (And/Or is there a way to do what I want above?)

Thanks for any help...

an-toni
Posts: 0
Joined: Wed Mar 17, 2004 5:20 pm

Post by an-toni »

the strategy has been to use Blender via Python directly, not as via the GUI. perhaps in the future the GUI is written in Python using the API :)

so to use the sequence editor, the way would be to add a Sequencer module to bpy, and add the required object types and functions there.

what would you need from it? something like:

from Blender import Sequencer

clip1 = Sequencer.add("myvideo.avi")
clip1.start = 10
clip1.end = 146
(and then add an effect somehow?)

or what?

~Toni

Duoas
Posts: 0
Joined: Mon Apr 18, 2005 10:32 am

Post by Duoas »

Yes, that's pretty much it. I figured that greater access to the sequencer would require writing a python interface module (which I don't currently have time for...)...

Even so, there's currently no way to access a lot of internals. Say, for example, you want to get or set the 'subsurf' flag for a particular mesh. (Not so weird a thing: a number of extant scripts would benefit from that ability.)


Oh well... for now my project has been put on hold so we'll see what happens later...

LetterRip
Posts: 0
Joined: Thu Mar 25, 2004 7:03 am

Post by LetterRip »

subsurf flag was accessible in 2.37a and prior, subsurf has become a modifier and so we need to change the interface.

LetterRip

Duoas
Posts: 0
Joined: Mon Apr 18, 2005 10:32 am

Post by Duoas »

Heh, so it is. I've looked over that one a zillion times and never seen it... :oops:

Post Reply