Extend to support multi-model/multi-skeleton mesh swapping for Wonders, etc.
I looked at my multi skeleton export and I'm wondering if bones alone will work with multi meshes. But I'm still working on the leader though
Good news is that your leaderskinning works! I just used one diff for all the dds files and I could see that the texture work
the bad news is that doing a civ4 skeleton was really warped. Granted I didn't have an animation assigned (which could have been the problem). But the texture hurdle has been solved so now its just a matter of converting animations to GR2s and seeing if that works!
I'm focusing on trying to write a replacement for the grnreader98 export to SMD first.
Another question: is it possible to load/see the texture of a model in the Grannie Viewer? I haven't tried out all the options, but a quick lookaround didn't show me a way.
I definetely don't want to get in the way of that. One thought though. Both the milkshape.txt and smd files are readable in notepad (but I use Visual C++) Maybe we can bypass SMD completely and just have gr2s convert to milkshape.txt files? the text formats seem similar but if if I had to choose I'd rather see smd handle leaders rather than making a gr2>milkshape.txt (via smd conversion script)
Another question: is it possible to load/see the texture of a model in the Grannie Viewer? I haven't tried out all the options, but a quick lookaround didn't show me a way.
Question. Would it be possible to use a more modern software such as 3DS Max to create a mesh and bone structure, export that file to an FBX, open in blender, export FBX using your script, open in photoshop cs6, texture and paint the model, save as the proper dds files, then use NB2 to put the whole thing together as a GR2?
I thought the same thing about direct conversion to Milkshape Ascii. Both the SMD format and Milkshape ASCII txt are fairly simple and clean formats to work with.
My progress so far: I found another gr2 exporter called evegr2toobj.exe here. Unlike grnreader98.exe, the source code is included.
After a bit of tinkering about, I was able to get evegr2toobj.exe to compile in Visual Studio. evegr2toobj only exports the gr2 mesh to Wavefront OBJ format. However, the code gives access to all the mesh information needed to output to SMD/Milkshape Txt - it didn't output the bone binding information - but I have been able to extend to output that too.
So now I have C++ code that can access all the vertex, triangle and bone binding data for each mesh - all the data you see when you view the detail of a mesh in Granny Viewer. I have been able to output the "triangles" section of an SMD file from my code and the output exactly matches the output of grnreader98.exe.
The only remaining work in order to create a full SMD file is to output the skeleton and bone data. It is much simpler to access this data since all of it, including bone positions and rotations, is available via existing methods in the Firaxis Granny dll. So I'm currently around 90% confident that I can bring all this together to do a full SMD export. Seeing as everything involved will be in accessible C++/C# code I should be able to create SMD export code that doesn't suffer from the two big issues with grnreader98.exe - the fact that it doesn't work for most Leader gr2s and the fact that skeletons are often incorrectly rotated relative to the mesh. If I can get this SMD export code working without either of these two issues then it should be relatively easy to move on and creating a direct export to Milkshape ASCII.
That will leave only the inaccessible Leader textures as a major barrier to modding existing 3D assets. I have an idea to try for that too:
Make a perfectly square mesh in Blender, output to FBX and convert to gr2. Assign a Leader shader in Nexus Buddy 2, preferably Opaque_Matte or whatever the simplest one is, and assign one of the Leader base textures. I don't think that the texture will display in Nexus 3D Viewer so you will have to switch a leader fxsxml to point to your square gr2 and view in game. If you can set the scene up so that the square points directly towards the camera with no clutter in the foreground or lighting reflections then you can use Print Screen to capture the texture. Tedious, but it could work - and once you have the square gr2 and fxsxml set up it is simple but repetitive work to screen grab other Leader textures.
I thought the same thing about direct conversion to Milkshape Ascii. Both the SMD format and Milkshape ASCII txt are fairly simple and clean formats to work with.
My progress so far: I found another gr2 exporter called evegr2toobj.exe here. Unlike grnreader98.exe, the source code is included.
After a bit of tinkering about, I was able to get evegr2toobj.exe to compile in Visual Studio. evegr2toobj only exports the gr2 mesh to Wavefront OBJ format. However, the code gives access to all the mesh information needed to output to SMD/Milkshape Txt - it didn't output the bone binding information - but I have been able to extend to output that too.
So now I have C++ code that can access all the vertex, triangle and bone binding data for each mesh - all the data you see when you view the detail of a mesh in Granny Viewer. I have been able to output the "triangles" section of an SMD file from my code and the output exactly matches the output of grnreader98.exe.
The only remaining work in order to create a full SMD file is to output the skeleton and bone data. It is much simpler to access this data since all of it, including bone positions and rotations, is available via existing methods in the Firaxis Granny dll. So I'm currently around 90% confident that I can bring all this together to do a full SMD export. Seeing as everything involved will be in accessible C++/C# code I should be able to create SMD export code that doesn't suffer from the two big issues with grnreader98.exe - the fact that it doesn't work for most Leader gr2s and the fact that skeletons are often incorrectly rotated relative to the mesh. If I can get this SMD export code working without either of these two issues then it should be relatively easy to move on and creating a direct export to Milkshape ASCII.
That will leave only the inaccessible Leader textures as a major barrier to modding existing 3D assets. I have an idea to try for that too:
Make a perfectly square mesh in Blender, output to FBX and convert to gr2. Assign a Leader shader in Nexus Buddy 2, preferably Opaque_Matte or whatever the simplest one is, and assign one of the Leader base textures. I don't think that the texture will display in Nexus 3D Viewer so you will have to switch a leader fxsxml to point to your square gr2 and view in game. If you can set the scene up so that the square points directly towards the camera with no clutter in the foreground or lighting reflections then you can use Print Screen to capture the texture. Tedious, but it could work - and once you have the square gr2 and fxsxml set up it is simple but repetitive work to screen grab other Leader textures.
did you try building shaders too? I thought they would do it.
Building shaders work, but the texture 'floats' above the terrain rather than lying flat on it. That might be something to do with the model in the marsh gr2 rather than the building shader itself though.
Building shaders work, but the texture 'floats' above the terrain rather than lying flat on it. That might be something to do with the model in the marsh gr2 rather than the building shader itself though.
I haven't had any luck getting custom features to show up, the existing simpleshaders don't appear to be populated within the feature gr2s
Ah, yes I messed around with that. It used to only give me the eye balls of a leader.
I wonder if there is a way to pull from granny viewer all the skeleton data. Maybe a script that reads its out put that way you can at least compare what the data out put is between the two easier. It might be in its dll?