[Bf-python] Fwd:Shed Skin

Tom M letterrip at gmail.com
Tue Sep 27 22:25:49 CEST 2005


One of the google summer of code projects was 'Shed Skin' which
translates python to C++ giving a 10-100 fold speed up.  I contacted
the author regarding the project and here was his reply (forwarded
with permisson). On a followup message he also added,

[QUOTE]I haven't looked at it in-depth, but it looks like a simple and clean
API.. Maybe if you have simple Blender script (say 30 lines?) we could
try and run Shed Skin on it and see what happens? :-)[/QUOTE]

So anyone have a simple script which might be appropriate as a trial
script?  (Ie something where a significant speed up would be
advantagous, that makes use of standard python features such as lists
and dicts (preferably heavy usage), but fairly minimal usage of
Blender internal API (some functions from Object, NMesh, and
Mathutils) - probably something like an importer or exporter would be
best.  (Has pytexture been added yet to CVS?  If so that might be even
a better test case).

LetterRip


---------- Forwarded message ----------
From: Mark Dufour <mark.dufour AT gmail DOT com>
Date: Sep 26, 2005 10:12 AM
Subject: Re: excellent work on Shed Skin
To: Tom M <letterrip AT gmail DOT com>


> Congratulations on your Shed Skin,

Thank you! However, I'm only at version 0.0.3 (tomorrow 0.0.4)..
There's still a long way to go..

> I'm curious if it would be feasible to use it with something like
> Blender http://www.blender.org/cms/Home.2.0.html  (well with Blender
> specifically :) ) which has python embeded and then defines some of
> its own types in C with python wrappers (ie points, faces, and other
> common 3d data stuff as well as common functions for acting on the
> data...).

In theory, it's possible to call any external code. You need to
provide a 'type-model' for all imported functions/variables though, as
well as an implementation of them in C++. The type-model is used
during analysis (see builtin_.py) to derive the correct types, and the
C++ implementation is linked into the final result( see builtin_.?pp).
The C++ implementation part may be automated later on, but it's
currently a manual thing.

How large is the interface with blender.. ? How many classes, methods
and functions are we talking about?

> I noticed you mentioned that it can't use the bundled libraries that
> come with a standard python install so presumably not.

Currently, all the builtin types are seen as external modules, and
parts of the random, math and sys modules have been type-modeled and
implemented. The nice thing is that each import has to be done only
once, and everyone else can use it afterwards without having to do
anything.. The bad thing is of course that the standard library is
pretty large.. :P

> Thanks for creating such a neat piece of code,

You're welcome.. :D It still crashes on 99.9% of all possible programs though ;)

> Tom M.
>

thanks!
mark.



More information about the Bf-python mailing list