Extract GR2 Animations into Blender and Re-Import to Civ V/Civ BE

That .gr2 file has zero animations so there is no animation data to export! What is it you are trying to do exactly?
 
File "C:\Users\~username~\AppData\Roaming\Blender Foundation\Blender\.blender\scripts\export_br2.py", line 123, in saveBR2
if not parentArmOb.name in modelMeshes:
AttributeError: 'NoneType' object has no attribute 'name'
 
Scripts have been updated so that Animations can be directly loaded into 2.7* version of Blender via NA2 format.

Update 16.0
* Animation import to 2.7* versions of Blender now working via the .na2 format. Actually the fix was a simple change to NB2 and CN6 import scripts. Many thanks to Magarto for finding this!

This means animations from Civ V, Civ VI and Beyond Earth can be loaded directly into Blender 2.7* versions for the first time.

Will need to re-install and re-enable NB2/CN6 Import Addons for this to work.

https://forums.civfanatics.com/resources/blender-scripts-for-civ-v-and-civ-vi.25925/
 
Last edited:
So, I've been trying to make animations for a lightsaber dude, but I am running to problems. I can get the animations done (edited from longswordsman) in Blender, but I can't get them exported to .gr2 properly. If I edit the animation in Blender, export it to fbx and then convert to gr2 with Nexusbuddy, only one bone of the sword gets animated. I am probably missing something very basic, since only experience I have with Blender is from civ modding, but is there any idea what's going wrong? I am not entirely sure about the fbx export options either. So far I've been doing the following:

open animation with (a new) mesh loaded
edit animation (keep limbs' animations etc. "hide" sword blade inside the hilt by downscaling the blade tip bone, then scale the bone up in correct frames so that it bursts out from the hilt)
bake animation (all actions, choose "pose" over "object"
export fbx:
  1. 6.1 format
  2. choose only armature from the selection
  3. -y -axis forward, z up
  4. apply modifiers on
  5. smoothing: face (?)
  6. X to animation, all actions, default take and optimise keyframes
I don't have any idea what most of these do, but I get a moving animation, but it's just the hilt moving. I might get more things working if I deleted all keyframes and animated everything from scratch, but I'd prefer using the stuff made by firaxis and adding the details of my own. It seems that in some point something forgets that there should be other stuff than the sword moving as well.
 
So, I've been trying to make animations for a lightsaber dude, but I am running to problems. I can get the animations done (edited from longswordsman) in Blender, but I can't get them exported to .gr2 properly. If I edit the animation in Blender, export it to fbx and then convert to gr2 with Nexusbuddy, only one bone of the sword gets animated. I am probably missing something very basic, since only experience I have with Blender is from civ modding, but is there any idea what's going wrong? I am not entirely sure about the fbx export options either..

If you share your .blend save I can take a look when I get the chance.
 
@Jaegerguy Here's what I did to get it working.

1. Ctrl-A to Apply Location/Rotation/Scale.
2. Export FBX with these settings:

upload_2021-2-8_21-49-43.png


3. Also Export to BR2 Format.
4. Open FBX in Nexus Buddy 2 and Save.
5. Open BR2 in text editor and replace "Base " with "Base_" - it seems that FBX export replaces spaces with underscores which is not super helpful! - so we need to do this edit so the bone names match.
6. In Nexus Buddy 2 do Overwrite Meshes from BR2 and select the edited BR2 file. Everything should animate correctly in Granny Viewer. :)

upload_2021-2-8_21-55-44.png


7. Now you can Save Anim to save the animation .gr2 file and then use Remove Animations and Save to save model .gr2 without the animation data.

See jedi_files.zip attached.

Also there is generally no need to bake the animations.

Edit: Realised that it would be better to replace “Base_” with “Base “ in the FBX file instead before opening in Nexus Buddy 2.
 

Attachments

  • jedi_files.zip
    205.5 KB · Views: 70
Last edited:
Thank you so much, now it works :clap: I spent a day or two trying to solve this. Also great that it's now documented here so maybe this will help someone else too.

You're welcome. I might make a small edit to the FBX export Addon for Blender 2.7 so it doesn't replace spaces with underscores in Bone names. I've not run into this issue as I've previously used Blender 2.49 with my customized FBX export script.
 
Hello, I am getting an error in Blender.

I tried something different and converted the gr2 formats of the game called Metin2. I didn't get any errors, but I'm having trouble transferring it to the blender. I did not understand where the problem originated. I would be glad if you help me.

The error I encountered is below:


Python: Traceback (most recent call last):
File "C:\Users\same\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_import_na2.py", line 241, in execute
import_na2(self.filepath)
File "C:\Users\same\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_import_na2.py", line 173, in import_na2
armOb = allObjects[0]
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

location: <unknown location>:-1
 
Hello, I am getting an error in Blender.

I tried something different and converted the gr2 formats of the game called Metin2. I didn't get any errors, but I'm having trouble transferring it to the blender. I did not understand where the problem originated. I would be glad if you help me.

The error I encountered is below:


Python: Traceback (most recent call last):
File "C:\Users\same\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_import_na2.py", line 241, in execute
import_na2(self.filepath)
File "C:\Users\same\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_import_na2.py", line 173, in import_na2
armOb = allObjects[0]
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

location: <unknown location>:-1
im also getting this error when i try to import an animation
 
im also getting this error when i try to import an animation

Sorry but Nexus Buddy 2 only supports GR2 files from Civilization V and Civ BE. It won't work with GR2 files from other games.
 
ah right, im using civ nexus 6, so that might explain it

For Civ V the tool is Nexus Buddy 2; for Civ VI the tool is CivNexus6 - somewhat confusing but the naming of NB2 was for legacy reasons.
 
Hi! I'd like to ask if there is a way to change one (or two or three) animations for a new model, while keeping the other old vanilla .gr2 's functional. I haven't found other ways to do this than to convert the vanilla anims to .na2, import to Blender and follow the instructions you provided earlier in this thread. It works, but it's manual, very repetitive work if I want to change one animation (I guess one could write a script to automatize that though). If I make the custom animation, follow the steps and at the end, use the remove animations and save function of NB2, the resulting .gr2 becomes very wildly distorted when trying to preview the vanilla animations (it does work for the edited animations though).
 

Attachments

  • grannyviewer2.PNG
    grannyviewer2.PNG
    157.5 KB · Views: 41
Hi! I'd like to ask if there is a way to change one (or two or three) animations for a new model, while keeping the other old vanilla .gr2 's functional. I haven't found other ways to do this than to convert the vanilla anims to .na2, import to Blender and follow the instructions you provided earlier in this thread. It works, but it's manual, very repetitive work if I want to change one animation (I guess one could write a script to automatize that though). If I make the custom animation, follow the steps and at the end, use the remove animations and save function of NB2, the resulting .gr2 becomes very wildly distorted when trying to preview the vanilla animations (it does work for the edited animations though).

It sounds like the rotation of skeleton of your new model is different to the vanilla model. Are you following the steps from here to create the model GR2 by doing Overwrite Meshes from BR2 file?
https://forums.civfanatics.com/thre...t-to-civ-v-civ-be.564873/page-2#post-16022481

Another technique is to make a copy of the vanilla GR2 and then use Overwrite Meshes from BR2 and see if the edited animated work. Potentially altering the Forward and Up axes in Blender might resolve the problem too.
 
It sounds like the rotation of skeleton of your new model is different to the vanilla model. Are you following the steps from here to create the model GR2 by doing Overwrite Meshes from BR2 file?
https://forums.civfanatics.com/thre...t-to-civ-v-civ-be.564873/page-2#post-16022481

Another technique is to make a copy of the vanilla GR2 and then use Overwrite Meshes from BR2 and see if the edited animated work. Potentially altering the Forward and Up axes in Blender might resolve the problem too.

Yup, I'm following the instructions. I did suspect something like an axis problem, but additionally, if I try to combine a vanilla model and overwrite the meshes from br2, only parts of the new model animate at all. I'm unsure what you mean by rotation of the skeleton, is the fact that I have moved bones and changed the model's rest pose enough to cause errors? I have made changes to the angles of arms in rest pose since they differ by unit, and with some models I've moved bones a bit to offset different lengths of limbs. But anyway, I haven't rotated the models or bones completely, I've just imported vanilla meshes and animations to blender without changing their general orientation. I didn't have experience in 3d modeling before starting civ5 graphics modding, so it could be that I'm doing something wrong without understanding what it will affect.
 
Yup, I'm following the instructions. I did suspect something like an axis problem, but additionally, if I try to combine a vanilla model and overwrite the meshes from br2, only parts of the new model animate at all. I'm unsure what you mean by rotation of the skeleton, is the fact that I have moved bones and changed the model's rest pose enough to cause errors? I have made changes to the angles of arms in rest pose since they differ by unit, and with some models I've moved bones a bit to offset different lengths of limbs. But anyway, I haven't rotated the models or bones completely, I've just imported vanilla meshes and animations to blender without changing their general orientation. I didn't have experience in 3d modeling before starting civ5 graphics modding, so it could be that I'm doing something wrong without understanding what it will affect.

I did a test: I imported a regular composite bowman to blender, didn't edit anything on the mesh or armature and then imported an animation and edited the animation, but I still get the same problem. Only the quiver and the side sword of the comp bowman move in granny viewer when I drag the .gr2 anims (resaved once in NB2 ofc) into it, the bowman itself is just t-posing motionless.

Edit: The parts that animate seem to often have originally had the underscore in them. Is it just coincidence or are there "different" underscores in different languages or something? I am doing the replace operation with Notepad++ from "Base " to "Base_".

Edit2: I realised only now that you had suggested to edit the FBX file for the Base_, not the br2 file. Still doesn't work though, but I am continuing testing

Edit3: It seems to be always that one set of animations (customised vs. vanilla) work and the other doesn't. If I use the "remove animations and save" model, the custom animations work and if I overwrite meshes with the custom mesh, my own animations don't
 
Last edited:
Edit: The parts that animate seem to often have originally had the underscore in them. Is it just coincidence or are there "different" underscores in different languages or something? I am doing the replace operation with Notepad++ from "Base " to "Base_".

I think I might have had this the wrong way around. It should replace "Base_" with "Base ". FBX export replaces spaces with underscores and we want to reverse that.
 
Top Bottom