n00b export troubles with SubSer

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
pinkman
Posts: 0
Joined: Tue Mar 16, 2004 10:10 pm

n00b export troubles with SubSer

Post by pinkman »

Okay, first of all, I am new to Blender and Python so please excuse me if this is in overly simple question, but how do I export the triangles generated by a subdivision surface? I am of course assuming that this is possible?

Thanks in advance and for any one that cares, heres a bit of background:

I have run through the Ginger bread man tutorial, which I found was very helpfull/usefull and gave me a glimpse as to why people are so impressed with Blender :) . The Ginger Bread man is the model I am trying to export as a starting point.

I am trying to make a exporter that will export models into a format readable by a game project I am apart of (well half of at the momment :) ). The model almost comes up fine, but the actual body displays as cubes, not as the SubSur. I am starting off small and just exporting to a text format not much better than the raw format, other than the triangles contain indexes into a vertex array.

I did have md3 models in the game, but I soon realised how limited the format was, and there also seems to be mixed reports of legal issues using the format.

Anyway, enough rambling, back to coding :)

pinkman
Posts: 0
Joined: Tue Mar 16, 2004 10:10 pm

Post by pinkman »

I have found a way around this, and that is to change the subdivided surface into a mesh before exporting it (alt-c). It took me a heck of a long time to find this, I must have been looking in the wrong places!

Is there anyway to change it into a mesh at script run time? And how hard is it to do without upseting animation based around the orginal mesh?

blendix
Posts: 51
Joined: Wed Oct 16, 2002 1:00 pm

Post by blendix »

I know the wavefront obj import/export script exports a subdivided mesh. You can find it here:

http://www.elysiun.com/forum/viewtopic.php?t=21310

pinkman
Posts: 0
Joined: Tue Mar 16, 2004 10:10 pm

Post by pinkman »

Thanks Blendix. I have grabbed the script and had a quick look through it - I couldn't find where it does "the magic", but it has to be in there somewhere. It's a starting point at least.

On the upside, I have managed to import my model format (as simple as it is right now) into our game :).

Cheers.

breakin
Posts: 0
Joined: Fri Aug 22, 2003 3:33 am

Post by breakin »

I searched for "magic" and this came up:

Nmesh mesh=GetRawFromObject(objectName)

breakin
Posts: 0
Joined: Fri Aug 22, 2003 3:33 am

Post by breakin »

That should be nmesh=Object.GetRawFromObject(objectName)

Post Reply