Dietrich,<br>I'm developing this code as part of the process in porting <a href="http://pyppet.blogspot.com/">Pyppet</a> to RPython and Blender2.5.  I have just gotten bpy.ops to proxy from RPython.<br><a href="http://pastebin.com/TsYNqd8p">http://pastebin.com/TsYNqd8p</a><br>
<br>I found a bug in Blender253, pickle can only dump imported classes, and builtin types.<br>But if you define your own class, and them dump an instance, the pickler raises a attribute-lookup error.<br>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.<br>
<br><br><div class="gmail_quote">On Mon, Jul 26, 2010 at 5:52 AM, Dietrich Bollmann <span dir="ltr"><<a href="mailto:diresu@web.de">diresu@web.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Goat Man :)<br>
<div class="im"><br>
On Sun, 2010-07-25 at 22:57 -0700, Goat Man wrote:<br>
> Thats pretty awesome Dietrich, i hope it finds its way into official<br>
> blender in some form.<br>
<br>
</div>Thanks :)  But unfortunately it didn't find the way into the official<br>
blender version until now, as my approach to code everything from<br>
scratch was not appreciated and I still couldn't find the time to<br>
rewrite it using some library to get rid of my low-level stuff.  On the<br>
corresponding page on the blender patch tracker<br>
<a href="https://projects.blender.org/tracker/index.php?func=detail&aid=6887&group_id=9&atid=127" target="_blank">https://projects.blender.org/tracker/index.php?func=detail&aid=6887&group_id=9&atid=127</a> is more information about why the patch was not integrated.<br>

<br>
I also would be happy to get some form of command port functionality<br>
integrated into blender, be it my code, some modified version of it<br>
using some message queue for example at the place of my low-level code<br>
or whatever other implementation somebody else has to offer.<br>
<div class="im"><br>
> But is your system one-way only?  How do you get return values from<br>
> functions back into, in your case emacs?<br>
<br>
</div>It is two-way.  I temporarily redirect stdout and stderr into string<br>
buffers before evaluating the code and send them back to the client :)<br>
<br>
In emacs I use a slightly modified python mode and, at the place of the<br>
normal "python" command, wrap the blender shell client "blash".  This<br>
works as "blash" behaves the same way as a normal python shell.<br>
<br>
For my lisp client I translate lisp to python code strings when sending<br>
commands to blender and later parse the output of the shell and<br>
translate it back into lisp code (only the subset I need which is small:<br>
I basically code everything as python dictionaries which are interpreted<br>
on server side to generate the 3D models etc.).  Before switching to<br>
Blender I used the Maya command port which basically worked the same<br>
way.  That's where I got the idea to do it like this...<br>
<br>
If you are interested, you can read more about the simple protocol I use<br>
to send python code / get back the results (stdout and stderr) here:<br>
<a href="http://formgames.org/blender/command-port/#bcp-protocol" target="_blank">http://formgames.org/blender/command-port/#bcp-protocol</a><br>
<br>
When using the command port from python I have to generate the python<br>
command strings and parse the responses in the same way I described<br>
concerning my lisp client.  A "hello world" Python client is here:<br>
<a href="http://formgames.org/blender/command-port/#hello-world-python-client" target="_blank">http://formgames.org/blender/command-port/#hello-world-python-client</a> It<br>
would be much nicer of course to have a proxy bpy class generating the<br>
command port input and parsing the output as you wrote in your second<br>
email.<br>
<br>
Both links are for blender 2.4* as I couldn't find the time necessary to<br>
update the page yet, but the code for 2.5 is similar (using Python 3.1<br>
at the place of 2.5).<br>
<div class="im"><br>
> I'm working on a solution for getting return values, and doing<br>
> callbacks.  My target is RPython (PyPy), i haven't started on bpy yet<br>
> though, but i have gotten pygtk, pyode, and pygame partly working, so<br>
> i am sure the solution is general enough to handle bpy.<br>
<br>
</div>That sounds and looks pretty awesome also :)  What do you intend to use<br>
your code for?<br>
<br>
Good luck (and fun of course), Dietrich<br>
<br>
<br>
> <a href="http://pastebin.com/rWEfgMSN" target="_blank">http://pastebin.com/rWEfgMSN</a><br>
<div><div></div><div class="h5">> _______________________________________________<br>
> Bf-python mailing list<br>
> <a href="mailto:Bf-python@blender.org">Bf-python@blender.org</a><br>
> <a href="http://lists.blender.org/mailman/listinfo/bf-python" target="_blank">http://lists.blender.org/mailman/listinfo/bf-python</a><br>
<br>
<br>
_______________________________________________<br>
Bf-python mailing list<br>
<a href="mailto:Bf-python@blender.org">Bf-python@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-python" target="_blank">http://lists.blender.org/mailman/listinfo/bf-python</a><br>
</div></div></blockquote></div><br>