niftools / max_nif_plugin

The nif plugin for 3ds max.
http://niftools.sourceforge.net/
Other
31 stars 20 forks source link

Vertex Color Support #9

Open neomonkeus opened 10 years ago

neomonkeus commented 10 years ago

There seem to be 2 bugs with 3ds max plugin when it comes to vertex colors.

First bug: I can't manage to import both NiVertexColorProperty node AND vertex colors array in NiTriStripsData or NiTriShapeData node. The checkbox in import dialog is a little vague. Grayed checkbox (whatever that stands for) acts sometimes same as unchecked. No vertex coloring gets imported. When checked, it imports NiVertexColorProperty nodes only, without corresponding vertex color arrays, or the NiVertexColorProperty nodes only. Possibly, it skips the nodes if the array is present.

Second bug: it comes to light when all (or most) of the colors are set to FFFFFFFF (white, with 100% alpha). The result is all black with periodic corrupt-like values (displays as extremely large numbers, possibly floats). The workaround I found is to change first color to black, and after exporting to change it back to whatever it was originally. To my observation it affects only the objects with all-white arrays, but my bug-testing shows that first color must be black, in order to work around the bug. Seems not to affect meshes/objects that have more diverse vertex coloring.

Texture paths: 3ds max plugin seems to pick the alphabetically first texture with the given filename, regardless of the original texture path upon exporting (maybe importing. Can't really say for sure), given that the file with same filename exists in game's texture path. Very annoying (that I can say for sure).

Collision bugs (3dmax plugin): Unpacked collision mesh crashes 3ds max when importing. When creating a mesh and setting it as collision mes, 3ds max crashes upon exporting. Multi-objects collision meshes are not imported correctly. Only the first mesh is imported as a collision mesh. The rest are treated as wireframe meshes. (combined with above bug makes it impossible to edit given nifs).

One other thing: I've noticed that updating tangent spaces with PyIFF and Nifskope/3ds max do not give the same result. Py gives visually sightly different tangents, as opposed to Nifskope and 3ds max plugin. You might want to double-check the Py code.

blabbatheorange commented 9 years ago

User didn't identify which game he was exporting to. The second bug is non-existent in current versions for Skyrim export.

Texture path exports is currently absolute paths, this might have been to support other non-Bethesda games. I've made a temporary fix for bethesda game export/import. I will eventually write the changes for the original codebase and merge the fix in when I get time.

Haven't looked at collisions yet.