Extract GR2 to Blender with mesh AND skeleton and re-export to GR2

I have the same problem. I would like to add bones for FX triggers but when I do a br2 to gr2 it does not work, its either invisible or contorted.

I don't think you can move the structure bones, I think you would need to edit the animations as well if you did that, but I don't know that for sure.

There is something you can try for adding fx bones or editing skeletons.

Creating your GR2 from FBX usually mangles the meshes but as far as I know Skeletons are usually imported OK. You can check this in Granny Viewer by using the skeleton display options.

Providing this is the case, you could try this approach:

1) Export your model from Blender to both FBX and BR2 formats.
2) In Nexus Buddy import from your FBX file - all being well this should create a GR2 with your skeleton including any additional or altered bones. Your meshes might well be corrupted but it doesn't matter because...
3) Overwrite the meshes from your BR2 file.

Haven't tried this but I think it could be the only reliable way to add additional FX bones etc.

This would also be the best way of converting Civ 4 skeletons and animations or doing custom animation for anyone brave enough to try that!


It's unfortunate that importing from BR2 doesn't work reliably for skeletons. Some of the maths and code involved is pretty complex so I'm pleased any of it works at all. Which reminds me I should release all the source for Nexus Buddy at some point.
 
There is something you can try for adding fx bones or editing skeletons.

Creating your GR2 from FBX usually mangles the meshes but as far as I know Skeletons are usually imported OK. You can check this in Granny Viewer by using the skeleton display options.

Providing this is the case, you could try this approach:

1) Export your model from Blender to both FBX and BR2 formats.
2) In Nexus Buddy import from your FBX file - all being well this should create a GR2 with your skeleton including any additional or altered bones. Your meshes might well be corrupted but it doesn't matter because...
3) Overwrite the meshes from your BR2 file.

Haven't tried this but I think it could be the only reliable way to add additional FX bones etc.

This would also be the best way of converting Civ 4 skeletons and animations or doing custom animation for anyone brave enough to try that!


It's unfortunate that importing from BR2 doesn't work reliably for skeletons. Some of the maths and code involved is pretty complex so I'm pleased any of it works at all. Which reminds me I should release all the source for Nexus Buddy at some point.

Hmn... That sounds like it could work, I'll try as soon as I'm able.
 
Anyone have any suggestions for my question from earlier?
Which Civ5 template would I use [for the Civ4 Wolf]? The wolf unit doesn't have existing animations in the base game, as far as I know.
 
Anyone have any suggestions for my question from earlier?

This is always a tough question as it really affects how your unit will animate. I have used the horse template to animate bullocks and it worked OK. May be the horse would work for a wolf as well and just scale it down.
 
...or you could try to use the Civ4 animations with the technique described in post #241 above.

Problem is, without a template to paste my model into, I've been getting errors exporting to basically any format usable by this game (.fbx, .br2). Since I'm pretty inexperienced with Blender and Python, I don't know how to address them myself.

I posted a thread about the issues I've been having, but haven't yet got a response. Would really appreciate any help.
 
Do you have the Civ 5 SDK installed and the assets path set? These are both needed for Nexus Buddy 2 to work.

Yes, I did!

I bought Civ 5 today and installed it via steam.

After that I downloaded Civ 5 SDK and set the file path via regedit.

I could use if for 5-10 minutes and could open Nexus Buddy 2. I exported the cannon.gr2 and imported the new cannon.nb2 via blender (but it did not work - I just got a complete deformed mesh).

After that I tried to view the cannon.gr2 with the granny Viewer - but the granny viewer crashed and I got a crash message. I tried to open a .gr2 unit file from the civ 5 download base here in the forum - and it worked perfectly! Result: I cannot open original .gr2 files from the original civ 5 game - granny viewer crashes every time I try to open a file!

And another problem: now, nexus buddy will not start again!!! (but I changed nothing - no change of file paths or other things!).

I become desperate - I don't know what could be the problem...
 
Ok, most of the problems have been solved...

...but one other raised:

After I have used Nexus Buddy 2 to convert the .gr2 file to .nb2 and when I have imported it with the blender script, the unit mesh looks like this:

attachment.php


Can someone help? I have used deliverators_blender_scripts_v6
 

Attachments

  • blender_fail.jpg
    blender_fail.jpg
    133.2 KB · Views: 651
Result: I cannot open original .gr2 files from the original civ 5 game - granny viewer crashes every time I try to open a file!
To open original .gr2 files you need to open them in Nexus Buddy 2 first and then re save them as a .gr2. After that you ca view them in granny viewer.

I have attached a cannon template if you need it.
 

Attachments

Hard Question #18930234:

So... I've been looking into the CityStyle models, opened them up in NexusBuddy and although I couldn't use GrannyViewer to check it, it exports!

But... it exports it as multiple gr2 files!... Then I thought, maybe if I import them all to Blender, and then export to Br2 I could replace the meshes and thus make my own city-styles! (compatibility issues aside)

So... imported each one of them, but there's a problem... no bone is imported... And thus, the meshes are not weighted at all... and thus I can't export to Br2 or fbx at all. Has anyone managed to dig more into this issue? Is there a workaround for it?
 
Hard Question #18930234:

So... I've been looking into the CityStyle models, opened them up in NexusBuddy and although I couldn't use GrannyViewer to check it, it exports!

But... it exports it as multiple gr2 files!... Then I thought, maybe if I import them all to Blender, and then export to Br2 I could replace the meshes and thus make my own city-styles! (compatibility issues aside)

So... imported each one of them, but there's a problem... no bone is imported... And thus, the meshes are not weighted at all... and thus I can't export to Br2 or fbx at all. Has anyone managed to dig more into this issue? Is there a workaround for it?

I'm definitely not an expert, but if there's no bone set up in the city models (because they don't animate, I guess?) and you're only overwriting the mesh of the existing city model, the skeleton setup in your blend file should be irrelevant. So any skeleton setup that lets the br2 export script work should be fine. Try adding a new bone and just assign all existing vertex groups to it? (Assuming there are vertex groups with a naming convention in the city models, like there are for units, which we need to match.)
 
Leugi said:
But... it exports it as multiple gr2 files!... Then I thought, maybe if I import them all to Blender, and then export to Br2 I could replace the meshes and thus make my own city-styles! (compatibility issues aside)

So... imported each one of them, but there's a problem... no bone is imported... And thus, the meshes are not weighted at all... and thus I can't export to Br2 or fbx at all. Has anyone managed to dig more into this issue? Is there a workaround for it?

Yeah, if a .gr2 contains multiple Models then each one will be exported to a separate .nb2 file.

My guess is that the reason why no skeleton is imported may be that the import script removes the top bone in the tree. If there is only one bone then the whole skeleton disappears. It is a simple change to the script to stop that happening.

cities use multiple skeletons so do wonders

I have theory that if I create a blend with multiple skeltons I can do the br2 write over method but havent tried yet

In order for this to work Nexus Buddy would have to allow you to select which Model's meshes you want to overwrite.

It shouldn't be too difficult to add something to allow you to switch between Models/Skeletons in a .gr2 file that has more than one. It's something I can look into to provide some way for Wonders, Improvements, Citystyles to be altered.
 
It shouldn't be too difficult to add something to allow you to switch between Models/Skeletons in a .gr2 file that has more than one. It's something I can look into to provide some way for Wonders, Improvements, Citystyles to be altered.

Great! Here's hoping for some nice new changes then :goodjob:

BTW, I also noticed something odd when it comes to improvements, and is that in the LandmarkShader the height maps don't work at all. I simply opened a Lumbermill gr2 model to change its main texture, and when saved the heightmap is no longer working (even though when opening the gr2 file, it still is part of the LandmarkShader), any ideas for it?
 
Citystyles
Not sure if folks know it, but this is something we could really take advantage of, since we have total control of individual city art in Lua. I figured this out a while ago. You can even have different city styles in the same civ (e.g., you could link it to city founding civ rather than current owner). So it would be nice to have some different city styles.
 
Can you have multiple types of building art styles in the same city? As in have a city with Polynesian, Euro, Mediterranean and Asian buildings?

That'd be awesome.
 
I don't know anything about how individual art elements are assembled into a city. The SerialEventCityCreated event (when invoked) can be used to change art style, continent, apparent size and era for the whole city.
 
In order for this to work Nexus Buddy would have to allow you to select which Model's meshes you want to overwrite.

It shouldn't be too difficult to add something to allow you to switch between Models/Skeletons in a .gr2 file that has more than one. It's something I can look into to provide some way for Wonders, Improvements, Citystyles to be altered.

I've been working on some changes to Nexus Buddy 2 to make it possible to work with .gr2 files that contain multiple models such as Wonders and Citystyles.

It is now possible to switch between the models in the .gr2 using check boxes. This switches the current model for editing materials, but also overwrite from BR2.

attachment.php


You can now either export all a .gr2 file's models to separate NB2 files (as at present) or just select the current model for export.

I have added some options to the NB2 import script to make the Mesh rotations and top bone removal optional.

This means I can edit just one model from a multi-model .gr2 in Blender. Here I added extra statues to the Statue of Zeus wonder graphic.

attachment.php


Because I can select which model I want to overwrite meshes for and thanks to some further updates to the code I can overwrite just the completed temple mesh with one I edited in Blender. This is using Overwrite Meshes from BR2.

attachment.php


I should be able to release the updated Nexus Buddy on Monday after a bit more testing and polishing.
 

Attachments

  • beta8-overwrite-models.png
    beta8-overwrite-models.png
    52.8 KB · Views: 543
  • beta8-grannyviewer.jpg
    beta8-grannyviewer.jpg
    217.1 KB · Views: 609
  • beta8-blender.png
    beta8-blender.png
    73.3 KB · Views: 591
All I have to say is... Heh, temple of Zeus with Fancy Heads!

Good Job, will be awaiting for your update :goodjob:
 
Back
Top Bottom