Jump to content

Exporting GLM


Key
Go to solution Solved by Key,

Recommended Posts

Posted

I've successfully imported a GLM into Blender v2.69, using...

 

 http://jkhub.org/files/file/1413-blender-264-jedi-academy-plugin-suite/

 

However, when I go to export - the model is unchanged in-game. Blender isn't throwing any errors at me, nor are any appearing in the game console, so I have no idea what's going on. I've double checked to make sure that all the newly added vertices have been weighted, using a method someone gave me:

 

  1. Make a group.
  2. Name the group after a bone.
  3. Add vertices to the group that need to be weighted by the bone. 
  4. Apply weighting to all the vertices in the group.

 

I added into the .skin file all the new pieces. I'm not maxing out on polies/verts, these are small and simple changes. Now here's the twist, I tried loading the model into modview... For every new piece of the model that I added, it threw an exception that looks like this:

 

Model_GLMSurface_SetStatus():

Surface "name of model piece" not found!

 

(Model: "models/players/kb3/model.glm")

 

 

So I think that's a clear flag that something I'm doing is very wrong. I have no clue what I'm missing here. I can upload the .blend file if someone wants to look at it. Does anyone have any idea at all?

 

Some possible problems I think may be causing it (although I don't know why): 

  1. I modeled in 3DS Max and exported (only the modifications) as .OBJ's, the imported them into Blender.
  2. UV's might be messed up... they look fine in Blender though. 
  3. The modifications aren't the right type of mesh? I don't even know if that'd make sense. I just started using Blender. 

 

 

Any help is appreciated! 

Posted

I can take a look at the .blend file, this sounds quite intriguing. If something goes wrong I need the exporter to error, otherwise the kind of confusion you're experiencing arises. So I have an interest in knowing what's up.

 

You don't need to weight by manually setting vertex groups, by the way - you can just use the bone envelopes. Refer to just about any Blender tutorial on weighting for that. I just use vertex groups when importing because that's basically how weights are saved in .glm files - each vertex lists how much it is affected by each bone. But when you weight a model you don't want to manually specify that... (Well, there's weight painting that helps, but still.)

 

To verify your weighting works correctly you can select the skeleton and go to pose mode (change it from object mode in the menu bar below the 3D window), then move some bones and see if the mesh moves correctly. Because I have a feeling you might have made a mistake there since you did it the complicated way. Possibly. I have to look at the .blend to know for sure.

Posted

In the interest of anyone reading this, I'll not answer this in a PM.

 

Take a look at the Outliner in the top right of Blender - it displays your object hierarchy. Your models have to be properly placed in it. To parent an object to another, select the future child first and the parent second and press ctrl+p.

 

A proper hierarchy is important for numerous reasons:

  • The exporter uses it to determine what should be exported
  • The exporter uses it to determine which Level of Detail a given object has
  • Jedi Academy uses it to determine what should come off if a limb is severed (for example, r_arm and its children will come off when you severe the right arm)
If you want your model to have multiple Levels of Detail (LOD), you also need to supply your new parts in different LODs or they'll just vanish as the model moves further away from the camera and the LOD switches.

 

Since the GLM format saves some information only once for all LOD levels (e.g. the hierarchy), the exporter has to be able to tell what objects are the same in different LOD levels. (In previous versions of Blender length also used to be a problem, since object names were quite limited in length and some glm surface names exceeded that limit.) This is done using custom properties, of which Blender allows any object to have any number of. To simplify the process, I added a new Ghoul 2 Properties panel to the object properties (bottom right, in the cube tab).

 

Besides the object name this also allows you to specify the shader (usually later overwritten by a .skin file though), whether this surface should be off by default (caps for severed limbs don't get enabled until they're no longer connected) and whether it's a tag surface (used only to specify a location but not actually rendered - e.g. where a weapon is held).

 

You don't have to worry about turning surfaces off or creating tags since you're using an existing model as a base, so all those surfaces already exist. You do need to add the G2 Properties to your new objects and at least set the name though.

 

In order for the vertex groups to be used as weights (or if you decide to use bone envelopes instead) you'll also need to add an Armature Modifier to each object - that's done in the wrench tab in the properties.

 

Consult my tutorial on creating new vehicles with blender for additional information and images.

Posted

Well that definitely helped, I was able to change a bunch of stuff around and get actual errors (which is a good thing). However something still isn't going right... none of the pieces are showing up, the names I gave them aren't being recognized in the .skin file. 
 

 

This is what I did: 
 

  1. Added armatures to each vertex group
  2. Parented objects. There are like 5 model roots, I don't know why, but I got them all to be on model_root_0
  3. Tried exporting, told me there were faces that weren't triangles. I went back and triangulated every addition I made that needed it.
  4. Tried exporting, told me there were UV seams. Fixed those. 
  5. Tried exporting, gave me a bunch of success messages on the error list - so I'm assuming that's good. 
  6. Added the names of what I thought were the new pieces to the .skin file, check it out in ModView... same result as before, telling me that the surfaces weren't found. 
     

I'm once again at a loss, I can send the .blend again if needed. I'm obviously doing something wrong, I just have no idea what it is. This'll be the first/last time I ever do playermodeling, lol.

Posted

There are like 5 model roots, I don't know why, but I got them all to be on model_root_0

One for each Level of Detail. You shouldn't modify them after the import. There's a manual included in the plugin .zip, take a look at that for explanation on the hierarchy and other things required.

 

You may not need multiple LOD levels that much - in that case just unparent model_root_1, _2 etc. so they're no longer in scene_root, which contains all that gets exported.

Posted

I removed the other LOD's. I looked at the manual and checked all of my additions for the proper hierarchy & requirements. Still won't compile, and at this point, I'm about to just say screw it. Blender is frustrating me, I don't have enough experience with it to pinpoint where I'm going wrong. 

 

-- Edit --

 

I think it has something to do with the way UV's have been mapped. I started deleting pieces that were causing errors, I found one that complained about a UV having seams. I'm guessing it's just something about the way the meshes have UV's mapped - I certainly don't want to make new elements/meshes in Blender. 3DS Max is much more convenient. So really if I want to get this to work properly, I guess I'm just going to have do everything over within Blender. 

Posted

I found one that complained about a UV having seams.

Yeah, that's just an unnecessary source of confusion. In the glm format a vertex can only have one UV coordinate, so if two faces have different uv coordinates at a vertex (i.e. the edge is a seam, a cut in the uv map), that has to be exported as two vertices.

 

But that's really something the exporter could take care of. In general this topic made me realize how unnecessarily complicated the creation of playermodels is - a dedicated tool could make it a lot easier. I have a lot on my hands at the moment but once I'm done with all that I may take a look at creating such a thing, but yes, currently creating playermodels requires a ton of technical knowledge and you have to keep dozens of things in mind.

Key likes this
  • Solution
Posted

Just to wrap this up... here's how it was fixed:

 

Cleaned up the meshes in Blender by remapping the UVW's and taking care of the seam problem... That's literally all that was wrong after I set my LOD's and parenting/hierarchies correctly. Originally I modeled in 3DS Max 2010, exported the elements in the scene as an OBJ, and finally imported them into Blender... Well Blender didn't like that and got jealous I was using another modeling application, so as I previously mentioned I redid everything in Blender. And when I say I did it, I actually mean a clanmate did it for me and thus deserves all the credit. I'd tag him if he had a JKHub account. 

 

Anyways, I'd just be careful about the seam stuff in Blender like mrwonko described... I still don't fully understand it, but I don't think I'll be back for more anytime soon. 

Posted

3ds Max 2010 can export to .xsi which gets converted to .glm using carcass. Not sure why you had to export it to .obj and use Blender to export it to .glm. :P

Posted

3ds Max 2010 can export to .xsi which gets converted to .glm using carcass. Not sure why you had to export it to .obj and use Blender to export it to .glm. :P

 

Because I'm a noob... it just happened to be one of the file types I saw could be imported into Blender and exported from 3DS, there's no other reason lol

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...