Converting fantasy unit graphics from Civ4

those errors may be because someone "made" or reshaped the unit via nifskope instead of blender. A lot of cool leaderheads like Amra were donefor civ4 that way.

What you make have to do is unassign the mesh from the skeleton and delete the bones altogether in nifskope then re-rig it (assign bones) to the civ5 template you are using.

I'm looking into what's involved in this now and unfortunately I cannot work out how to unassign the mesh in nifskope. I can remove stuff with right click -> block -> remove, but straight up removing the skeleton in nifskope seems to remove the association between the mesh and the texture. :( If I remove just the bones that cause the script to fail (which is hard to do in nifskope, bones often disappear from the outliner view on the side but still exist?), then this also breaks the mapping between the texture and the mesh.
 
I'm looking into what's involved in this now and unfortunately I cannot work out how to unassign the mesh in nifskope. I can remove stuff with right click -> block -> remove, but straight up removing the skeleton in nifskope seems to remove the association between the mesh and the texture. :( If I remove just the bones that cause the script to fail (which is hard to do in nifskope, bones often disappear from the outliner view on the side but still exist?), then this also breaks the mapping between the texture and the mesh.

I have been able to get some difficult nifs to import by disabling Import Extra Nodes in the nif import options.
 
I have been able to get some difficult nifs to import by disabling Import Extra Nodes in the nif import options.

Thanks for the tip. I just tried this but unfortunately I get the same NiAvObject error (path between BIP HEAD and Scene Root). I don't suppose this is a parenting issue? Can I attach scene root to the BIP Head (in nifskope) to make it work? I'll tinker with that when I get time.
 
aren't scene root and BIP Head ci4 vertex groups? I don' think they are used in Civ5.

You might still have the vertices assigned to civ4 bones (that are no longer there) if you imported a civ4 unit with its skeleton then assigned the civ4 meshes to the civ5 body.

I get the impression from nifskope that BIP Head and scene root are both bones and vertex groups (as in, there is a vertex group named BIP Head and a bone named BIP Head) but I quite likely to be wrong. Nifskope seems a bit light on documentation. Any of the other units where the import from nif to blender works straight away are textured in the texture view in Blender (with no changes). But if I remove the bones that the import script complains about in the non-working models, then the relationship between the mesh and the texture seems to be broken. True, it's possible to redo the UV map in Blender, but I don't yet know how to do that. (I'll learn it soon enough, but I would also like to avoid unnecessary work because I imagine that would add a lot of time to each conversion.)

If you could take a quick look at, say, the skeleton model that PawelS posted on page 1, then that would be awesome. I'm a bit lost in nifskope, but once I know where to go I think I should be able to convert a bunch more of these.
 
I'll try to look at it. I sometime import civ4 models as obj (you can export to obj from nifskope) that way it gets rid of the skeleton and then I re-rig it to the civ5 skeleton. you don't need the civ4 skeleton on the vertices at all if you plan on rigging it a civ5 skeleton.
 
I'll try to look at it. I sometime import civ4 models as obj (you can export to obj from nifskope) that way it gets rid of the skeleton and then I re-rig it to the civ5 skeleton. you don't need the civ4 skeleton on the vertices at all if you plan on rigging it a civ5 skeleton.

Awesome, thanks! I just tried the obj intermediate export, but obj "doesn't support skinned meshes" so you lose the texture mapping that way as well. (Though the mesh did import into Blender where it hadn't before, which is good!) I think I should learn how to manually do UV mapping soon.
 
Awesome, thanks! I just tried the obj intermediate export, but obj "doesn't support skinned meshes" so you lose the texture mapping that way as well. (Though the mesh did import into Blender where it hadn't before, which is good!) I think I should learn how to manually do UV mapping soon.

weird. i had UV mapping come in on firaxis made civ4 models. These might be units made in nifskope which never imported blender right.
 
I have converted from the civ4 unit Fyrdwell from FFH.

fyrdwell_51d.png
 
Great, it will be a good addition to my mod :) I know fantasy units are often hard to convert, perhaps you can review various units from FFH and the downloads database to find ones that don't cause such problems...
 
I just tried the obj intermediate export, but obj "doesn't support skinned meshes" so you lose the texture mapping that way as well. (Though the mesh did import into Blender where it hadn't before, which is good!) I think I should learn how to manually do UV mapping soon.

OBJ import does preserve UV mapping. Exporting the Wolf Rider to OBJ from Nifskope and importing to Blender I have this:

attachment.php


You can use Alt-Z in Blender to view textures. You still have to manually assemble, attach the head and then rig to a suitable animation but at least the UV mapping is there.
 

Attachments

  • OBJ_WOLF_RIDER.png
    OBJ_WOLF_RIDER.png
    120.9 KB · Views: 346
I get the impression from nifskope that BIP Head and scene root are both bones and vertex groups (as in, there is a vertex group named BIP Head and a bone named BIP Head) but I quite likely to be wrong.

You're not wrong. BIP Head will be both a bone and the name of a vertex group for vertices mapped to it.
 
Most of the rest of them say either this:
File "E:\Program Files\Blender 2.49a\Blender\.blender\scripts\import\import_nif.py", line 2825, in complete_bone_tree
% (boneparent.name, skelroot.name))
AttributeError: 'NoneType' object has no attribute 'name'

This is due to the script trying to be too clever in identifying the skeleton root. I've tweak the script attached to use the root node as the skeleton root. This allows some units like the Ogre Warchief to be imported.

Or this:
File "E:\Program Files\Blender 2.49a\Blender\.blender\scripts\bpymodules\pyffi\formats\nif\__init__.py", line 3999, in get_transform
'between %s and %s.' % (self.name, relative_to.name))
ValueError: cannot find a chain of NiAVObject blocks between BIP Pelvis and Scene Root.

The last problem looks quite solvable? It looks like something someone competent with nifskope could fix by assigning a new vertex group/changing the hierarchy in the original nif model.

This generally happens when there are multiple skeletons copied within the NIF - Scene Root, MD, etc appears more than once. It can be sometimes fixed by using Copy Branch and Paste Branch to move the NiTriShape meshes so that they all sit under one Scene Root > MD >MD NonAccum and then using Remove Branch on the addition skeleton(s). I managed to get the attached Orc axeman into Blender this way.
 
With boneweight copy it should be real easy to put the undead units onto some civ5 bodies

Yay! Can't wait to see these!

Is anyone planning some more goblin units? I need archers and scout/hunter type goblin units (two "levels" of each but I can do simple recolor tweaks myself). Goblin style should match Deliverator's wolf riders.

[In trade, I'm going to post my working EaDll on GitHub shortly. It has some useful stuff for fantasy mods, like supporting a separate Animal player that can't be met and doesn't enter enemy borders (with necessary changes to AI threat assessment and war state counting). And many other things ... all organized by #ifdef #else #endif code blocks so you can easily find relevant changes.]
 
Back
Top Bottom