Subsurf faces for exporter

Hi guys…

I’m currently busy getting our Blender exporter ready for Unity (a game creation toolklit for Mac).

Our goal is to be able to make a scene in Blender and automatically pulling it straight into Unity. Currently we get all Objects, Hierarchies, Meshes (with UV mappings & realtime textures) across. Our goal, however, is to be able to get an automated 1:1 relationship between what you see in Blender & what you see in Unity.

I have one thing I’ve been unable to find out:

Is there any way to get to the generated mesh of subsurfs. If I get the mesh, I (understandably) get the source mesh. There is a GetMeshRaw, but that doesn’t seem to do it.

I have some more questions, but this is seriusly slowing down our GooBall work. Any ideas?

TIA,
Nicholas

You can use the Blender.NMesh.GetRawFromObject function for that.

Martin

I haven’t really looked at the souce, but I know the script called “obj_io_modif228.py”, which transcodes in OBJ format, exports the subsurfaced mesh if it’s enabled.

http://www.zoo-logique.org/3D.Blender/scripts_python/obj_io_modif228.py

Upon viewing the source, I can’t find any reference to the subsurfed mesh, only

mesh = NMesh.GetRawFromObject(object.name)

sorry to say it, but replacing NMesh.GetRaw (obj.data.name) with NMesh.GetRawFromObject (o.name) does not result in any changes. I still get the mesh in it’s pre subsurfaced state.

A workaround could be to ask your users to convert the object type to mesh. Note that you will lose the vertex group associations this way, so this is no option for already animated objects.

That’s what I feared…

Shame - our goal is to have a completele flow of assets - So far, we read photoshop files (with layers), Maya binary files (with lofts, subsurfs, whatever), so artists only need to have one file. I was hoping to do the same for Blender, and already run blender as an automated exporter from inside our engine…

Oh well…

hey nich, can you direct me to more information regarding unity? this sounds interesting.

marin

Certainly:

http://www.otee.dk - tech section of the site.

Unity is a Mac-only game building toolkit than can do Games for PC & Mac. We’re currently using it in-house to build our first game, GooBall. GooBall will go out on Mac just before XMas, and on PC sometime next year.

Unity will enter beta testing around the GooBall ship date, to be released as a prosumer product around March/April.

Edit:
Oh yeah - there are some screenshots at a Danish GameDev site:
http://www.spiludvikling.dk/viewtopic.php?t=948

nice! what abt pricing?

$300 for the Indie version - that’s the one we’re building gooBall with
1000$ for the Pro version (Summer 2005) - that’s where we get skeletal animation decent image-based effects.

Do you completely lose the vertex group associations or are just the new verts without groups?

even if you lose the vert groups, it would be pretty trivial to make a script to handle this…

LetterRip

Pay attention to the subsurf button in the edit window :
don’t forget to push it !

:slight_smile:

Another possible problem might be that GetRawFromObject() returns the subsurf mesh created for direct display, not the render subdivision mesh. So if the first ‘subdiv’ level button is 0, it will return the original mesh, since the subdivided mesh is only created at rendertime.

Gimme a break 8)

Actually, since the contents are created for game use, they are never rendered - so it’s only the 1st button I use. Just for testing, however, I played with both buttons, but still only get the original mesh.

Never mind. We’re going alpha with gooball in 1 week, so I don’t really have any more time right now… I’m just converting to normal meshes as I go along - even if it does make subsequent editing a pain…