[Bf-committers] Python mesh modifiers

Nick M uberfob at gmail.com
Sun Sep 4 07:22:32 CEST 2005


Hi all,

I saw the PyTexture SoC project and was inspired by it to try make a
Python modifier type for meshes. The idea is to link to a regular
textblock like a scriptlink, and let the script perform arbitrary
modifications on mesh data. Now, I'm sure this has been thought of
before, but I haven't found any implementation yet.

Anyway, I am maybe half-way through to making a test build; I was just
wondering if someone is already working on something like this, or if
there are any specific caveats (e.g. modifiers are getting revamped,
or it's a useless feature).

Speaking of useless, I know it is already possible to assign an
OnRender scriptlink to an object, which does the trick quite well for
a lot of things (e.g. that MakeHuman subsurface scattering
thingamajig). Still, calling Python from within a modifier stack
allows to see results in regular wireframe window and apply other
modifiers to the output. A streamlined API to convey the mesh data to
and from the script would of course be necessary.

I can already think of a couple uses for this - for example, convert
the Discombobulator script to use that API. Heh, of course it would be
speedier to implement a Discombobulator modifier in native C, but that
would lose a lot of tweakability. Anyway, if this works, I am hoping
to implement some example modifier scripts to go with the patch.

Let me know what ya think.


More information about the Bf-committers mailing list