On Feb 17, 7:32 pm, Nathan <[EMAIL PROTECTED]> wrote:
> Does anyone have any pointers for the best way to get models from
> blender to pyglet?

Blender is scriptable via Python, so you could write your own export.
And the nice thing is that all the (2-3 dozen or so) import/export
methods are written in Python -- so you have lots of example code to
draw on.

I had to do something like this for a project I was working on -- I
only needed to extract geometry and texture coordinate information.
No fancy lighting or animation stuff.   The geometric data in a
blender model is exposed in an easy to access form, so my code was
quite short.

And here's the nicest part: There is no need to parse any foreign
format.  The export routine extracts the data from the Blender model
and puts it straight into whatever structures I want to use in my
OpenGL program, (mostly OpenGL VertexArrays) and then pickles those
structures and writes them out to a file.  That's the end of the
export step.  My Pyglet code can then read/unpickle those files,
recreating those structures, and I then have all the data in exactly
the form I want for display.   Very clean, Python from beginning to
end, and all steps under my complete control.

Gary Herron
>
> After googling awhile, I found that the wavefront object file format
> (one of the choices in blender's 'export' menu) is text that I can
> parse.  Is there a better way to get models to use for 3D stuff?
> Rather than reinvent the wheel writing my own parser, I'd love to
> discover an easier and better way.
>
> ~ Nathan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to