swig

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

rene
Posts: 10
Joined: Mon Oct 21, 2002 4:29 pm
Contact:

swig

Postby rene » Mon Oct 21, 2002 5:37 pm

Making a swig wrapper to a lot of blenders functionality would not be too hard.

Most of it is writing type maps for the various data structures.

Of course you would write a nice to use wrapper on top of it.

Just for fun I made one for the BIF_editarmature.h file. I got it to compile successfully, but have not got it to import into blender correctly. For some reason it is not inserting the module into libblender_bpython.la I haven't figured out where the modules are added yet(so I can add stuff into the Blender module).

Anyway, I think it may be a wise idea to wait until the build system is decided upon, as this can greatly effect the way this is done.

I like modules been made the other way around. That is have python in control, and import blender in. Makes it easier to test, and mix with other modules. Here's a good argument in favour of extending http://twistedmatrix.com/users/glyph/rant/extendit.html

xitnalta
Posts: 68
Joined: Tue Oct 15, 2002 11:52 pm
Location: Romanshorn (TG), Switzerland

Postby xitnalta » Mon Oct 21, 2002 8:29 pm

Good idea. I'd especially love to see Ruby support in Blender! :)

For people that don't know swig yet: http://www.swig.org/ . It makes your application support dozens of cool programming languages! 8)
Felix

nlin
Posts: 6
Joined: Wed Oct 16, 2002 6:08 pm

Re: swig

Postby nlin » Mon Oct 21, 2002 10:33 pm

rene wrote:Making a swig wrapper to a lot of blenders functionality would not be too hard.

...

I like modules been made the other way around. That is have python in control, and import blender in. Makes it easier to test, and mix with other modules. Here's a good argument in favour of extending http://twistedmatrix.com/users/glyph/rant/extendit.html


This is indeed an interesting idea - the idea of making the entire Blender program a set of "services" which an external script (written in any script language which can be bound, e.g. via swig, to Blender) can control.

This is similar to Maya, where the entire core Maya "engine" is controlled via scripts, and the GUI is nothing more than a thin and 100% customizable scripting program which draws GUI elements on screen then calls functions in the Maya core. This also allows you to incorporate Blender services into any script of yours, making Blender fit easily into any production pipeline.

As has Ton pointed out, though, this customizability of the interface is a double-edged sword: if you can totally customize your interface, then this also means that there is no "standard Blender interface". You lose standardization of the GUI, meaning that documentation, tutorials, etc become more difficult.

But this level of scripting is probably an idea for Blender 3, since it would be a rather radical change.

xitnalta
Posts: 68
Joined: Tue Oct 15, 2002 11:52 pm
Location: Romanshorn (TG), Switzerland

Re: swig

Postby xitnalta » Tue Oct 22, 2002 1:59 am

nlin wrote:As has Ton pointed out, though, this customizability of the interface is a double-edged sword: if you can totally customize your interface, then this also means that there is no "standard Blender interface". You lose standardization of the GUI, meaning that documentation, tutorials, etc become more difficult.

This is an argument I don't like as-is, and even Ton will have difficulties to convince me of that.

One problem with it is that it is sometimes used as a bad excuse for bad interface design, which I don't think is the case with Blender's interface in general, but there are smaller glitches here and there (and even more grave: beneath the interface) that are almost dangerous (or too much work) to change.

Then, it is a good argument for software monopolists: they produce software with a certain interface, and they want to convince their customers that it is in their best interests to stick to this interface (which, btw., no competitor is allowed to fake, of course). It's actually not - many computer users can start using (for example) a window manager if they find their | _ | [ ] | >< | buttons in the decoration of a window.

Another problem is that you don't have to make this issue that black-and-white. For example, in Mozilla, the browser's interface you see is rendered by relying on different kinds of data. One kind of interface data is the layout - the "where's what" of the interface. Then, there's the stylesheet part (CSS), that makes the layout appear in a certain way. So you can easily change the stylesheet completely to your liking without getting lost when using a tutorial that uses a different one. (Btw., a similar problem is also if you changed your standard .B.blend substantially and read a tutorial that relies on it.)

Etc. etc. It isn't very convincing to me why people shouldn't be able to have a happy time when working on their computer and with a certain piece of software. (That's one reason I'm almost fanatically using free software.)
Felix

Jamesk
Posts: 239
Joined: Mon Oct 14, 2002 8:15 am
Location: Sweden

Postby Jamesk » Tue Oct 22, 2002 8:10 am

I say: Aye! Would be wonderful to have Java support through swig. Then I could plug my VirtuaLight material editor straight into Blender!
This is an excellent idea.

seval
Posts: 8
Joined: Mon Oct 14, 2002 3:31 am

Postby seval » Fri Oct 25, 2002 5:09 am

I do remember reading something in the old developement section at the bleder.nl site (R.I.P.) about one of the upcoming versions to have a customizable interface. Someone correct me if I am wrong. However, I suppose that even with such an interface, a restore default interface function could be implemented, for the sake of standardization.

Is "standardization" even a real word? I'll have to look that one up.....


Return to “Python”

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests