DESERGARD this post (unless you want to see the trial and error lol), next page has a much easier method for the time being
Continuing the process of sailing into uncharted waters using the blender method to make a mod I've successfully completed the undamaged state of a mod:
- 4 makes
- wheels with lods all appearing and rotating correct orientation
- all lods for the 4 makes
- roof/hood flaps etc animate in game with region morphs
- mod looks as expected with textures and performance in a full field is great
Moving to the damaged state however has been very rough, since we don't have animation frames to rely on where each mesh can act as the damaged and undamaged state at the same time it required extra technical challenge of duplicating the mesh to have 1 in damaged state and 1 in its undamaged state for every piece. Tedious but doable and even some older mods used this method.
However, the real issue came when compiling:
Despite 2 meshes being the exact same in vert, face, and tri count in this example a chassis mesh, because we manipulated the verts the export of the meshes will create unnecessary changes to the normals thus splitting extra verts. Doesn't matter when we created the 'damaged' look on the mesh by manually moving verts with out mouse or used a lattice deform modifier the results will be the same error I've found for 15-25% of your meshes (more complex and warped the mesh more prone this error occurs)
The reason why I didn't run into this error with the roof flaps which uses the same REGION_MORPH state switch is because with roof flaps you don't need to move vertices, you simply just use the orientation to rotate the entire mesh.
I tried using the data transfer modifier to match vertex order and the sorting order for the mesh in X orientation but neither fixed the issue. What I found to fix this was exporting the undamaged state of my mesh as a OBJ then re-importing and clearing custom normals data and applying clear all transforms. You have to reapply your papy material and then make a COPY of this mesh for the damage state you wanted.
At this point compiling works
but its doesn't stop there...
in game while damage works you then notice as damage is taken the morph that occurs is all jarbled up, as in the verts are not morphing to the correct location of the damaged mesh. This is due to
vertex order being incorrect. Despite us making a COPY of the imported sanitized OBJ file and vert count matching it still becomes broken when we manipulate the verts of the COPIED mesh as its treated as a separate entity and the vertex order gets re-sorted.
So we have two things we have to fix for each mesh simultaneously to make it work correct in NR2003:
- matching vertex count
- vertex order 100% matching
So after a couple hours I finally found the 'current' wroking process that I have replicated now several times as I go through and 'sanitize' each damage part:
- Starting with MESH A (your undamaged mesh piece) export it as OBJ with object groups, vertex groups on and materials off:
- re-import your MESH A OBJ and on import prompt ensure vertex/object groups is selected
- clear transforms (so coordinates reset to 0,0,0), clear custom normals, and apply your papy material back
- make copy of MESH A to make the damaged copy (MESH B) then apply the lattice deform (or deform your MESH B however you want to make the damaged 'look' )
- select MESH B THEN MESH A and choose 'join shapes' option (can find this by pressing F3 and searching for it too)
- delete MESH B from your scene (or you can keep it but its useless now)
-select Mesh A and move the shape slider to 1.0 to show the damaged state, essentially the join shapes has made our MESH A 'inherit' MESH B's shape with a slider we can toggle on and off (y
ou might be thinking, isn't this what lattice deform does? yes, but remember applying even the same lattice deform on a different mesh its not keeping the same data as this joined shape has)
-COPY the MESH A whne your slider is in the damaged state, its now an exact replicate of MESH A but in a damaged state, this becomes your new MESH B
- ensure you purge your blender scene of unused data: File > cleanup > purge unused data
- you can now rename MESH A and MESH B to their respective names you want to use in your code for papy export
-final result-
compiling has no errors AND in game the corrupting warped effect no longer appears, as your parts become damaged they warp as expected instead of appearing 'exploded'
I am still working on LOD state 1 for the first make. I have yet to see if I have to do this process for the other LODs as well since I use a LOD generator for my other LOD states, either way this does kinda suck but I'd rather do this than be stuck with 3ds max 8. Once I get into the rhythm of exporting and re-importing OBJs in the process it won't be too bad. The real pain was the constant errors and figuring out how to solve it.
This is more a blender thing I think than the addon itself, I think if we were able to animate between frame 0 and 1 for damage since it would be the same mesh we couldn't run into this but since we have to deal with two separate meshes for each damage part thats where it becomes tricky.
I plan in the future to make an in-depth tutorial on using the papy blender addon and things to be aware of for mod creation but since we are still in alpha stage I don't want to write a whole thing up and things change 6 months later.