[Bf-committers] OpenGL python export script

Raphael Langerhorst raphael-langerhorst at gmx.at
Tue Jun 7 07:55:52 CEST 2005


On Tuesday 07 June 2005 05:04, Renato Perini wrote:
> I'm very interested too, in this stuff.
> I don't know if there is a "fully featured" Blender OpenGL exporter
> but the problems I had with that scripts I tried is they become
> "unmaintained" after a while. If your intentions are writing a
> fully featured and maintained OpenGL exporter for Blender, I think
> many people will be thankful. :-)
>
> Raphael Langerhorst ha scritto:
> >Hi all,
> >
> >sth completely different to XML, I have written (based on existing
> >work) a python script that directly exports into OpenGL
> > sourcecode, anyone interested in that? It's about 50 lines of
> > code, only basic stuff is exported. Or is there already a fully
> > features OpenGL exporter?
> >
> >Regards,
>


Seems like there actually is interest :)  ... let's see if I can dig 
it up somewhere on my hard disc... found it, and it's actually 150 
lines of code.

Notes:

* The filename is currently hardcoded (/home/raphael/blender_model.c)
  Simply change it to your needs inside the script (or write a
  dialog that asks for input - I'm no Python wizard - in fact this
  script is the only Python code I've written in my life.

* Scaling and deformations:
  These are not handled in the script, you MUST select all objects
  of the scene and select
  Transform -> Clear/Apply -> Apply Size/Rotation  (Ctrl+A)
  Transform -> Clear/Apply -> Apply Deformation  (Shift+Ctrl+A)
  in order to have correct transformations in the exported file.

* ### NAO MODIFIQUE NADA DAKI PRA BAIXO, I don't know what this means
  (it's from the original author, I just left it in)

* About 60 to 70 % of the code is from me.

* Tested with Blender 2.32

(I just put these notes into the script as well)


About maintaining it:

I have now uploaded it to ftp://ftp.g-system.at/people/raphael/scripts 
I am currently not actively using it but I'm accepting patches that 
improves it further and will keep it on this FTP location.

If someone else _wants_ to maintain it, I would be happy as well.

I hope this script is useful to you! Patches welcome of course :)


Best wishes,
Raphael


-- 
Raphael Langerhorst
http://raphael.g-system.at/blog


More information about the Bf-committers mailing list