Error when exporting 3D from Blender to CivNexus6

Skyzoh

Chieftain
Joined
Mar 5, 2018
Messages
14
Hi,

I'm trying to add my own custom assets for an improvement. I've followed this thread to try and understand the steps required. I downloaded CivNexus6 and the Blender export scripts.

I already made 2 improvements in Blender (one normal, and one pillaged). I zipped and attached the .blend and .fbx for reference.

I'm trying to export the 3D object in .cn6 in order to import it in CivNexus6. The blender script throw this error which I am still unable to solve after more than an hour spent trying different things.

Code:
Traceback (most recent call last):
  File "C:\Users\Simon\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_export_cn6.py", line 555, in execute
    do_export(self.filepath)
  File "C:\Users\Simon\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_export_cn6.py", line 145, in do_export
    parentArmOb = object.modifiers[0].object
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

I tried what was suggested here but it didn't solve my problem. Any idea?

While on the topic, from what I understood (and correct me if I'm wrong), what' I'm trying to do is the next step in order to generate a .dds for the texture (using CivNexus). After that, I'll need to create 6 file that I'll cook together using Asset Editor to create a mtl file and I'll be able to import the .mtl and .fbx as a new improvement in my mod.
 

Attachments

  • IMP_Hockey_rink_cleaned.7z
    180.7 KB · Views: 209
It looks like one of your meshes is not parented to an armature (skeleton). See here. Right click to select the mesh, and then right click to select the Armature then key Ctrl-P to parent your mesh to the selected Armature.
 
While on the topic, from what I understood (and correct me if I'm wrong), what' I'm trying to do is the next step in order to generate a .dds for the texture (using CivNexus). After that, I'll need to create 6 file that I'll cook together using Asset Editor to create a mtl file and I'll be able to import the .mtl and .fbx as a new improvement in my mod.

First you use the Asset Editor to import your .dds texture files selecting the correct texture type for each (Base/AO/Normal/Gloss/Metalness/TintMap). This will create a .tex file to sit alongside the .dds file. Then you can create a Material .mtl file that references each of your textures. Then you can link your Asset .ast file to the Material file.
 
Hi, apologies for the late reply, I tend to only get the time to play around with my mod on weekends.

parenting the meshes solved the issue I was experiencing. However, when I export to cn6 and import in CivNexus I now get this error (importing fbx seems doesn't cause an error, but 0 model/assets are imported):

Code:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

** Exception Text **
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at NexusBuddy.Utils.NumberUtils.parseInt(String str) in E:\mod\CivNexus6\NexusBuddy\Utils\NumberUtils.cs:line 69
   at NexusBuddy.FileOps.CN6FileOps.loadModelInfo(String filename, Int32 vertexFormat) in

From the error name, I guessed it had to do with the filepath or the name of the objects/meshes that were empty. My guess was wrong and a search on the forums did not yield a solution. Do you have an idea what's causing this?

Also, I dismissed this as not important (as I still seems to get a valid exported file) but when I convert to cn6 from blender the script gives me a few errors like:
mesh.calc_tangents(mesh.uv_layers[0].name) IndexError: bpy_prop_collection[index]

Any help is still appreciated

Thx
 
You should not get any errors when doing the .cn6 export. If you do then there is a real problem. In this case it’s because your mesh is not UV unwrapped. You can only export unwrapped meshes that have at least one UV layer as well as them being rigged to armatures.
 
Last edited:
Top Bottom