[Bf-python] Embedding Blender - XEmbed protocol
Dietrich Bollmann
diresu at web.de
Wed Jul 28 08:43:45 CEST 2010
Hi Goat Man,
On Tue, 2010-07-27 at 05:37 -0700, Goat Man wrote:
> Dietrich,
> I'm developing this code as part of the process in porting Pyppet to
> RPython and Blender2.5. I have just gotten bpy.ops to proxy from
> RPython.
> http://pastebin.com/TsYNqd8p
Very nice! How about combining this with motion tracking. I would love
to see myself transformed into some blender being :)
Is there a special reason to use pypy and not the standard python? I
like the idea of using proxy objects! Unfortunately I currently don't
have enough time to experiment with your code but I hope to do that at
some time later :)
Thanks and good luck, Dietrich
> I found a bug in Blender253, pickle can only dump imported classes,
> and builtin types.
> But if you define your own class, and them dump an instance, the
> pickler raises a attribute-lookup error.
> The workaround i am using is sys.path.append('.') and then import the
> script as a module, and calling a dump function.. But when the
> pickler loads the dump, it seems like it gets dumped again. Thats why
> in the pastebin demo above two planes are created.
>
>
> On Mon, Jul 26, 2010 at 5:52 AM, Dietrich Bollmann <diresu at web.de>
> wrote:
> Hi Goat Man :)
>
> On Sun, 2010-07-25 at 22:57 -0700, Goat Man wrote:
> > Thats pretty awesome Dietrich, i hope it finds its way into
> official
> > blender in some form.
>
>
> Thanks :) But unfortunately it didn't find the way into the
> official
> blender version until now, as my approach to code everything
> from
> scratch was not appreciated and I still couldn't find the time
> to
> rewrite it using some library to get rid of my low-level
> stuff. On the
> corresponding page on the blender patch tracker
> https://projects.blender.org/tracker/index.php?func=detail&aid=6887&group_id=9&atid=127 is more information about why the patch was not integrated.
>
> I also would be happy to get some form of command port
> functionality
> integrated into blender, be it my code, some modified version
> of it
> using some message queue for example at the place of my
> low-level code
> or whatever other implementation somebody else has to offer.
>
> > But is your system one-way only? How do you get return
> values from
> > functions back into, in your case emacs?
>
>
> It is two-way. I temporarily redirect stdout and stderr into
> string
> buffers before evaluating the code and send them back to the
> client :)
>
> In emacs I use a slightly modified python mode and, at the
> place of the
> normal "python" command, wrap the blender shell client
> "blash". This
> works as "blash" behaves the same way as a normal python
> shell.
>
> For my lisp client I translate lisp to python code strings
> when sending
> commands to blender and later parse the output of the shell
> and
> translate it back into lisp code (only the subset I need which
> is small:
> I basically code everything as python dictionaries which are
> interpreted
> on server side to generate the 3D models etc.). Before
> switching to
> Blender I used the Maya command port which basically worked
> the same
> way. That's where I got the idea to do it like this...
>
> If you are interested, you can read more about the simple
> protocol I use
> to send python code / get back the results (stdout and stderr)
> here:
> http://formgames.org/blender/command-port/#bcp-protocol
>
> When using the command port from python I have to generate the
> python
> command strings and parse the responses in the same way I
> described
> concerning my lisp client. A "hello world" Python client is
> here:
> http://formgames.org/blender/command-port/#hello-world-python-client It
> would be much nicer of course to have a proxy bpy class
> generating the
> command port input and parsing the output as you wrote in your
> second
> email.
>
> Both links are for blender 2.4* as I couldn't find the time
> necessary to
> update the page yet, but the code for 2.5 is similar (using
> Python 3.1
> at the place of 2.5).
>
> > I'm working on a solution for getting return values, and
> doing
> > callbacks. My target is RPython (PyPy), i haven't started
> on bpy yet
> > though, but i have gotten pygtk, pyode, and pygame partly
> working, so
> > i am sure the solution is general enough to handle bpy.
>
>
> That sounds and looks pretty awesome also :) What do you
> intend to use
> your code for?
>
> Good luck (and fun of course), Dietrich
>
>
> > http://pastebin.com/rWEfgMSN
>
> > _______________________________________________
> > Bf-python mailing list
> > Bf-python at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-python
>
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
More information about the Bf-python
mailing list