Import gr2 skeleton

Yeah I'm pretty much out of ideas myself, no matter what I do I get the same deformed helo as your getting.
 
well I went through some old threads. I compared the ascii txt file and looked at the bones and then compared them to the bones in a materialhacker copy of the real game gunship. I think "somewhere" the bones are getting rotated and transformed. That would be my next step. I'd take coordinates in the grannyviewer (go to model list right click for details then go the skeleton structure) then compare them to an exported one to find whats wrong. then change them in blender by going t armature->transform properties.

not sure I can work on it more this week. Maybe you can check it out?
 
Having a look at the exported FBX file it looks like the extra bones are being added by the pose.

Pose: "Pose::BIND_POSES", "BindPose" {
Type: "BindPose"
Version: 100
Properties60: {
}
NbPoseNodes: 38
PoseNode: {
Node: "Model::WORLD_center"
Matrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000
}
PoseNode: {
Node: "Model::WORLD_center"
Matrix: -1.000000000000000,0.000000000000000,0.000000087422777,0.000000000000000,0.000000087422777,-0.000000043711388,1.000000000000000,0.000000000000000,0.000000000000004,1.000000000000000,0.000000043711388,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000
}
PoseNode: {
Node: "Model::MilkShape3D Object"
Matrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-0.000000043711388,1.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,-0.000000043711388,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000
}
PoseNode: {
Node: "Model::Cabin door01"
Matrix: 1.000000000000000,-0.000000079546602,0.000000026051277,0.000000000000000,-0.000000080342978,-0.819814205169678,0.572629690170288,0.000000000000000,-0.000000025136902,-0.572629630565643,-0.819814264774323,0.000000000000000,29.966440200805664,-21.186544418334961,19.161058425903320,1.000000000000000
}
PoseNode: {
Node: "Model::Cabin door02"
Matrix: 1.000000000000000,-0.000000080821508,-0.000000022329665,0.000000000000000,-0.000000079649460,-0.848980665206909,-0.528423905372620,0.000000000000000,0.000000022742583,0.528423905372620,-0.848980665206909,0.000000000000000,29.954044342041016,21.722658157348633,18.635986328125000,1.000000000000000
}
PoseNode: {
Node: "Model::WORLD_center_0"
Matrix: -0.000000043711388,1.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,-0.000000043711388,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000
}
PoseNode: {
Node: "Model::Airplane tail"
Matrix: -0.000000044659320,0.000000313913773,-1.000000000000000,0.000000000000000,-1.000000000000000,0.000000476839887,0.000000044659330,0.000000000000000,0.000000476839887,1.000000000000000,0.000000313913745,0.000000000000000,115.996002197265620,-0.000005137659173,-7.459563255310059,1.000000000000000
}

As you can see WORLD_center is there 3 times plus the old milkshape one.

You can see this when you compare gr2 files.
 

Attachments

  • Original_gr2.png
    Original_gr2.png
    99.8 KB · Views: 289
  • Modified_gr2.png
    Modified_gr2.png
    70.4 KB · Views: 200
That reminds me I compared the SMD to the milkshape3d txt file and the coordinates were different like you suspected. So I copied and pasted them into the text file and imported into blender and looked ok but still had the same problems when exporting to FBX (extra bones). But there were animations (propellers spinning) on the helo in game but it was half underground s I could not check for deformations.
 
That reminds me I compared the SMD to the milkshape3d txt file and the coordinates were different like you suspected. So I copied and pasted them into the text file and imported into blender and looked ok but still had the same problems when exporting to FBX (extra bones). But there were animations (propellers spinning) on the helo in game but it was half underground s I could not check for deformations.

I'm thinking about deleting world center in the txt file and them import it
 
I'm hoping you guys can get this to work. I animated a helicopter (my Mi8 model) in 3ds max, got it into Blender (w/ animations) and exported to fbx/gr2. Can't seem to get it to work though. Strange as I'm able to use the same procedure for other units, and it works fine. I'm going to keep at it but it's driving me nuts. Helicopters are may favorite units to make, but there's no way for me to get them into civ5. REALLY hoping you guys can crack the code!!
 
We are still trying but I think like Ekmek said we need Darnell and Bernie to get involved.
 
I'm hoping you guys can get this to work. I animated a helicopter (my Mi8 model) in 3ds max, got it into Blender (w/ animations) and exported to fbx/gr2. Can't seem to get it to work though. Strange as I'm able to use the same procedure for other units, and it works fine. I'm going to keep at it but it's driving me nuts. Helicopters are may favorite units to make, but there's no way for me to get them into civ5. REALLY hoping you guys can crack the code!!

In the meantime you can rig it toa jet fighter - just 2 bones- and find a way to add the prop animation. I think danrell did a prop fix for the fighter.
 
This is incredible work!!! Hat’s off :hatsoff: to ekmek, snafu and wolfdog!!!! RL has been VERY busy....this is literally the first time I have actually logged on in months (although I have occasionally peeked in)

OK....did I mention how amazing you guys are??? :goodjob: :goodjob:

Here’s the progress so far.....I was able to make an smd--> blend as per wolfdog.....i failed miserably at being able to make a successful fbx from that blend, BUT using ekmek’s gunship_wWC blend (and 56 blends -> fbxs -> gr2s later)...I THINK we may have something workable.....

It is tested in [old] asset viewer but not in game (I think it will work, but my xml and sql skills SUCK)

So, if someone can test it ingame....we can go from there!!!
 

Attachments

Thank you bernie I will be more than happy to test it tonight when I get off work. So good to hear from you we were running out of things to try. I would like to no in more detail how you did. Our export to .fbx failed too until we renamed the skeleton to WORLD_center.
 
This is incredible work!!! Hat’s off :hatsoff: to ekmek, snafu and wolfdog!!!! RL has been VERY busy....this is literally the first time I have actually logged on in months (although I have occasionally peeked in)

OK....did I mention how amazing you guys are??? :goodjob: :goodjob:

Here’s the progress so far.....I was able to make an smd--> blend as per wolfdog.....i failed miserably at being able to make a successful fbx from that blend, BUT using ekmek’s gunship_wWC blend (and 56 blends -> fbxs -> gr2s later)...I THINK we may have something workable.....

It is tested in [old] asset viewer but not in game (I think it will work, but my xml and sql skills SUCK)

So, if someone can test it ingame....we can go from there!!!

For a quick test I've linked your gr2 file to a (renamed) copy of the gunship fxsxml, set it to replace the English AT-Gun in R.E.D., and here is the result:

Spoiler :


Seems good ! :goodjob:
 
Great work all! I ended up fixing my animation problem, so I can make my own animations now too. This whole process was a great learning experience! I'm very excited for all the new helicopters that need to be made (I've got the AH-64, Huey, Mi-8, and Eurocopter very close to done).

Got the Mi-8 in game with the template! IT WORKS!!!!

 
I think I worked out what bernie did from the description on the file. I added all the propeller vertex groups to First Propeller 01 and removed the assignments to the other propellers. I exported it to fbx and converted to gr2 and it looked the same as bernies in granny viewer and nexus viewer (have not been able to test in game yet).
 

Attachments

  • Vertex.png
    Vertex.png
    99.2 KB · Views: 263
Exciting news! I've built on the work you guys started here and I've successfully developed a complete round trip process for exporting Civ 5 GR2 Mesh AND Skeleton into blender and back to Civ 5 gr2.

So far the process has worked flawlessly for the Longswordsman and Helicopter Gunship gr2s. I tested the Lancer gr2 to see if mounted units can be exported/reimported and its nearly there but there are a few issues which I think I can iron out. I'm hopeful we'll now be able to generate Blender files for all Civ 5 units so that lots of lovely new units can be rigged to Civ 5 animations. :)

I'll write another post imminently to outline the process and attached the amended Blender scripts I've developed to fix the bone twisting problem. After that I'll make an updated complete export and reimport tutorial,

For now here are my Longswordsman and Helicopter blend files (Blender 2.49b), my amended Milkshape ASCII txt import script and FBX export script, and a screenshot of the blender exported Helicopter in game.

Back soon. :)

Spoiler :
attachment.php
 

Attachments

  • heli.jpg
    heli.jpg
    238.9 KB · Views: 505
:woohoo: I seriously think my eyes teared up. This is awesome! I'll all for doing the work to build up our template library.

One bummer is that the grnreader program that converts our gr2s to smd files works for units and it looks like it works for wonders and tiles but it won't do the skeletons for leaders. I think its because of old code but I have no idea how to improve the grnreader so it can convert leader files.
 
Back
Top Bottom