CivNexus6

CivNexus6 1.3.3

@Deliverator oh lol, I have no expertise at all, all I know is that its done by using curves instead of polys, there is no actual surface to render. Thats also why the materials are different, because its a shader that draws a "fake" surface.

HairAnim.jpg


But its no biggie, I was just curious, for my purposes, I'll just use the baked fibermesh, I dont see any performance stress, at least not in my computer

I honestly would love to be able to do what you do, to create tools that allows us to mod things, but I'm totally clueless about that. If not for community developed tools, made by people like you, I wouldn't be able to do half of what I do! Thanks! =)
 
But its no biggie, I was just curious, for my purposes, I'll just use the baked fibermesh, I dont see any performance stress, at least not in my computer

So have you actually got a baked fibermesh displaying in the Civ 6 game engine Asset Preview?

I honestly would love to be able to do what you do, to create tools that allows us to mod things, but I'm totally clueless about that. If not for community developed tools, made by people like you, I wouldn't be able to do half of what I do! Thanks! =)

No problem! I'm strange enough to enjoy cracking these sort of problems anyway.

The next version of CivNexus6 will be uploaded in the next few days with a number of improvements so watch this space!
 
@Deliverator yes, but "baked" fibermesh is just a normal mesh really, I'll send you a PM with a video link, probably not what you're expecting though LOL
 
CivNexus6 1.2.0

An extensive update to CivNexus6 to better support Civ 6 FGX format graphics modding.

New Features in CivNexus6 1.2


* New Import/Export format .cn6 can be used instead of the old .nb2/.br2 formats. Old formats can still be used via a radio button.

The .cn6 is a development of the .br2 format with the following improvements to Blender Import/Export scripts and CivNexus6 Import/Export:
1) Support for up to 3 UV layers per mesh - used for Emissive layer (night lights) on Buildings etc.
2) Support for up to 8 Bone Indexes and Weights per vertex (up from 4 in Civ 5).
3) Support for Materials Import/Export (names only).
4) Support for multiple Triangle Groups per mesh each with their own Material assignments for each mesh common for various entities in Civ 6.
5) It turns at that until now that Blender has always been recalculating it's own Normals for each vertex rather than using the custom ones from the .nb2 file. This explains why some meshes didn't look as smooth when imported to Blender as the original .fgx does in FGX viewer. Since Blender now supports custom normal import I can now import vertex normals properly. Also the original normals, binormals and tangents are preserved for export as far as possible using a dummy vertex group called VERTEX_KEYS. If you want to force Blender to recalculate vertex normals, binormals and tangents then you can just delete the VERTEX_KEYS Vertex Group for the mesh. I can add this enhancement to the old .nb2/.br2 Addon scripts for Blender 2.7x when I have time.

* Materials are now assigned at the level of a Meshes Triangle Groups rather than at Mesh level which is a proper representation of the internal .fgx Granny structure. Use the Edit Mesh Material Bindings tabs to switch assignments and to rename Meshs. Use the Edit Materials tab to Add or Remove Materials and rename Materials.

* Import/Overwrite Meshes can now use 3 Mesh Vertex Formats:
1) Bone Bindings, 1 UV (layer): used for Units, Leaders & anything animated.
2) No Bone Bindings, 2 UV (layers): used for Static objects such as Unit weapons and shields.
3) No Bone Bindings, 3 UV (layers) : used for Improvements, etc that have an Emissive map.

* Fixed Export for models that use Indices rather than Indices16 (e.g. LEAD_AZTE_Montezuma.fgx)

I'm sure there is more to mention! I will try and post some graphical demonstrations of what can now be done soon.
 
Deliverator updated CivNexus6 with a new update entry:

1.2.1 Update

* If you are importing/overwriting with Mesh Vertex Format set to "Bone Bindings, 1 UV", any mesh vertices that are unweighted will be assigned to the root bone with a warning giving the count of unweighted vertices in each mesh. If using a Mesh Vertex Format that does not have Bone Bindings (i.e. an unanimated model) there is no longer a need to rig your mesh to the skeleton.

* Fixed .br2 Import/Overwrite which was broken in 1.2.0.

View attachment 472660

Read the rest of this update entry...
 
Deliverator updated CivNexus6 with a new update entry:

1.2.1 Update

* If you are importing/overwriting with Mesh Vertex Format set to "Bone Bindings, 1 UV", any mesh vertices that are unweighted will be assigned to the root bone with a warning giving the count of unweighted vertices in each mesh. If using a Mesh Vertex Format that does not have Bone Bindings (i.e. an unanimated model) there is no longer a need to rig your mesh to the skeleton.

* Fixed .br2 Import/Overwrite which was broken in 1.2.0.

View attachment 472661

Read the rest of this update entry...
 
Deliverator updated CivNexus6 with a new update entry:

1.2.3 Update

Stream-lined Civ V conversion process:

If using CivNexus6 1.2.3+ then your Asset .ast file will be created automatically as part of the "Convert all .gr2 Files in Directory to .fgx/.anm" step. This works by assigning Civ V animations into the Civ VI animation slots. The mapping is editable if you need to tweak it - see the Civ6ToCiv5AninMap.txt in the CivNexus6 application directory. Another file containing just the Behavior data is generated within the fgx_anm_output folder called...

Read the rest of this update entry...
 
A bit more on how Civ6ToCiv5AnimMap.txt works. Here is an extract:

ATTACK_A:_attacka
BACKWARD_A:_shuffle;_idlea_trans_idleb
BREATHING_A:_idlea
BREATHING_COMBAT_A:_combat_ready_idle
DODGE_A:_bombard_defense
FORWARD_A:_shuffle;_idlea_trans_idleb
HERO_A:_attack_city,_attackb
HERO_1:_attack_city,_attackb
...

The first part is the Civ 6 animation code followed by a colon then the suffix part of the Civ 5 animation file(s) that you want to mapped to that Civ 6 animation code.

For the automatic creation of the Asset file to work you need to have your converted .gr2 > .fgx model loaded into CivNexus6, for example: sea_colossus.fgx.

As CivNexus6 builds up the Civ 6 animations it will look for animation files that have the prefix based on the currently loaded filename and the suffix from Civ6ToCiv5AnimMap.txt. This means you need to have the model .fgx loaded into CivNexus6 before you execute the "Convert all .gr2 animation files in directory to .fgx/.anm" function.

So if I have sea_colossus.fgx loaded the application will look for an animation file called sea_colossus_attacka and if found will map it to the ATTACK_A code.

Where there are multiple Civ 5 animation suffixes separated by semi-colons, the order of precedence is left-to-right. So for FORWARD_A the application will first look for a file called sea_colossus_shuffle then sea_colossus_idlea_trans_idleb.

This will probably only make sense to those that have attempted a Civ 5 conversion! :)
 
Last edited:
Help I can't get the animate import right.

With Blender 2.76 I had model exported as br2. Because I edited the bones too much I can't data transfer from any official mesh. Then when I parent the armature, I picked automatic weight. Object movements in Blender looks fine but I can't export cn6 format. The warning says "vertex group can't add to 255" or something like that. But br2 works.

With Blender 2.49b I key-framed some poses, exported as FBX using your modified script. Got it imported in CivNexus6 ok, but somehow all bone axis rotated 90 degrees along X axis. Playing the animation twisted my mesh so much it looks really funny. But frustrating. I tried pick Y-up, Z-up, etc, but just can't get the axis right. Do you have any idea why?
 
@FurionHuang I would use Nexus Buddy 2 to convert your .fbx animations to .gr2 animations then use CivNexus6 to resave them as .fgx.
 
Last edited:
@FurionHuang I would use Nexus Buddy 2 to convert your .fbx animations to .br2 animations then use CivNexus6 to resave them as .fgx.
Ok, let try that workflow.
So just to make sure everything works correctly. Should I keep Y-up in blender? How about exporting fbx settings, all default?
 
Use Blender 2.49. Keep Y up. Can't remember if you need to use the -90 Animation Fix option or not.
 
Yes sorry I mean fbx to gr2.
Tried, still got the bone axis rotated along x 90 degrees. I will keep looking maybe it's somewhere I didn't do right.

Also, could you explain what does it mean "vertex weight totals 255", why do you need it in cn6 export script and why I didn't weight them correctly (using automatic weight when adding to armature)?
Thanks!
 
Tried, still got the bone axis rotated along x 90 degrees. I will keep looking maybe it's somewhere I didn't do right.

Also, could you explain what does it mean "vertex weight totals 255", why do you need it in cn6 export script and why I didn't weight them correctly (using automatic weight when adding to armature)?
Thanks!

If you upload your .blend file I can try and take a look at some point. I haven't really done much with importing custom animations. I know they work because things like the Flying Dragon I test use custom animations. The process can probably be improved if I get to spend some time on it.

Regarding "vertex weight totals 255": all vertex points need to be weighted - that is assigned to bones with a non-zero weight. I'm not sure what automatic weight does, but I would normally use the Transfer Weights process to copy weights from one mesh to another one.
 
Tried, still got the bone axis rotated along x 90 degrees. I will keep looking maybe it's somewhere I didn't do right.

Also this might be useful. These are the settings Sukritact used for exporting animations from Blender 2.7:

FBXExportSettings_Sukritact.png
 
Regarding "vertex weight totals 255": all vertex points need to be weighted - that is assigned to bones with a non-zero weight. I'm not sure what automatic weight does, but I would normally use the Transfer Weights process to copy weights from one mesh to another one.
Automatic weights assigns weight to a mesh based off the proximity of various bones to the mesh. I used it with Zara Yaqob as well and actually got the same issue. Fixed it by altering your script a bit @Deliverator, though I didn't do it particularly elegantly:

Code:
                        # Ensure that total of vertex bone weights is 255
                        runningTotal = 0
                        for i, weight in enumerate(boneWeightsList):
                            runningTotal = runningTotal + weight               

                        if runningTotal != 255:
                            boneWeightsList[0] = boneWeightsList[0] + (255 - runningTotal)

                        runningTotal = 0
                        for i, weight in enumerate(boneWeightsList):
                            runningTotal = runningTotal + weight

                        print("Current Running Total")
                        print(runningTotal)

                        if runningTotal != 255:
                            raise "Error: Vertex bone weights do not total 255!"
 
Back
Top Bottom