monkeyman192 / NMSDK

Custom Model importer for NMS
https://monkeyman192.github.io/NMSDK/
29 stars 9 forks source link

Collision Data Deleted From Scaled Vanilla Mesh After Exporting #80

Closed seancruzgp closed 3 years ago

seancruzgp commented 3 years ago

Describe the bug After scaling a vanilla mesh and exporting and packing the mod, game crashes. Comparing the exported MBIN to the original MBIN reveals that collision data was deleted as well as some values regarding LODs.

To Reproduce Steps to reproduce the behavior.

  1. I imported ASTEROIDXL.SCENE.MBIN. It has multiple meshes. My goal was scale the y axis of _Asteroid_Vertical from 1 to 0.5. _Asteroid_Vertical has 4 LODs, 0-3.
  2. On properties, I selected each mesh and one by one, changed scale y to 0.5.
  3. I exported with preserved node.
  4. Copied the folder it created, MODELS, to my NMS mod station project folder. Packed the mod, copied to Mod folder and tested the game.

EXML Files for Comparison.zip

Screenshots Image of Blender and what I did. blender_0IB0MTFHar

Yellow tab is original decompiled MBIN. Red is the Blender output decompiled. I ss mainly the LOD section that was removed and one of the collisions of one of the LOD meshes. The two other pink areas are other LOD collisions that were also removed since I changed the scale of _Asteroid_VerticalLOD0, LOD1, LOD2, LOD3. All the light blue highlights are edits but I'm not sure why they're edited.

notepad++_rbEd7BVyCb notepad++_THEWKojRD9

Devilin-Pixy commented 3 years ago

Having the exact same issue, even if no changes are made at all, with or without 'Preserving Node Info'. Even when scaling is done through 'edit mode', as you're likely supposed to do, this issue is present.

Using NMS version 2.62, MBINC v2.61.1-pre2, NMSDK v0.9.21

Note: Not seeing anything wrong when in '--debug-' mode either (Import, no changes > Export without PNI

Screenshot 2020-10-09 16 01 33

I did however notice something else that I found interesting. Likely not related, but noticed when making a change to the scale of 'AsteroidVerticalLOD0' in 'edit mode' (Scale Y with 0.5), get the following error in the console at the start of the export:

Screenshot 2020-10-09 15 44 02

Note the following in the image above:

File "", line 1 . ^ SyntaxError: unexpected EOF while parsing

I am not getting that 'error' when changing the scale through the Transform properties as @seancruzgp has done. If I were to scale all 4 LOD objects in edit mode (AsteroidVerticalLOD0/1/2/3), the error would show up 4 times.

Feel free to move this to be a separate issue. I just wanted to mention this here, as I was testing this exact issue when I found the error with scaling in edit mode.

seancruzgp commented 3 years ago

I tried the latest release you posted on Discord.

I followed the same steps I laid out in the OP. I also tried changing the scale of the collision on y to 800. The game will still crash while loading.

Here are the xmls to compare. EXMLCompare2.zip

monkeyman192 commented 3 years ago

Thanks, I'll have a look at it. This whole different ordering thing is annoying me now, so I'll try fix it so that exported scenes have nodes in the same order as imported scenes. Was going to do this as a separate issue, but I'll fix it now I think as it makes things easier