views:

373

answers:

5

Is it possible to embed a 3-D editor inside my wxPython application? (I'm thinking Blender, but other suggestions are welcome.)

My application opens a wxPython window, and I want to have a 3-D editor inside of it. Of course, I want my program and the 3-D editor to interact with each other.

Possible? How?

A: 

For Blender specifically, I doubt it. Blender uses a custom UI based on OpenGL, and I'm not sure you can force it to use a pre-existing window. I suggest browsing the code of "Ghost", which is Blender's custom adaption layer (responsible for interacting with the OS for UI purposes).

unwind
+2  A: 

Blender has python plugins, you can write a plugin to interract with your program.

Luper Rouch
http://blenderartists.org/forum/archive/index.php/t-3098.html and http://blenderartists.org/forum/archive/index.php/t-3336.html discuss using sockets to communicate between Blender instances, something similar could be done easily between Python and Blender
dbr
But in this scenario, will Blender still be its own window, or will it be inside my program's window? I'm aiming for the latter.
cool-RR
It would be a separate window/application
dbr
A: 

Perhaps this script might provide some context for your project. It integrates Blender, ActiveX, and wxPython.

Caveat: Windows only.

Matthew Piziak
+1  A: 

I second Luper Rouch's idea of Blender plugins. But if you must have your own window you need to fork Blender. Take a look at makehuman project. It used to have Blender as a platform. (I'm not sure but I think they have a different infrastructure now)

muhuk
A: 

For Blender2.5 on linux you can use gtk.Socket, code example is here on pastebin

goathead