monkeyman192 / NMSDK

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

[BUG] UVs Are Distorted After Exporting New Scenes #84

Open seancruzart opened 1 year ago

seancruzart commented 1 year ago

Description

UVs appear to not register or are distorted/re-arranged after export.

Steps to Reproduce

- What were you attempting to do? Learning NMSDK. Created a new scene with new geometry with a custom diffuse texture and a NMS normal map. Made a reference to this new scene in the procedurally generated plant pots found on space stations and other buildings as a way to easily test the object in-game.

New Model Setup

  1. I first created a new NMS scene. MBINcompiler and PCBANKS locations were properly set. Created the cube, and made a simple material with only the diffuse. Renamed everything to CUBEY.SCENE or CUBEY in the Outliner/tree.
  2. In Blender's shader editor, I created an Image Texture node with the diffuse texture, and renamed the name and label to Texture Image - Diffuse.
  3. I set the reference node to //CUSTOMMODELS\CUBEY\CUBEY.SCENE. Originally, when using the Open File Browser button, it included the entire address going back to my drive. The new object seemed to work and show in-game with the reference having the full address, but I cut it back to //CUSTOMMODELS\CUBEY\CUBEY.SCENE anyways afterwards.

CUBEY SETUP

Setting the Reference In Plant Pots For Testing Setup

  1. Imported PLANTPOTLSYSPROC.SCENE.MBIN, selected its reference node PLANTPOTLSYSPROC.SCENE, then used the context menu to create a new reference node under that node named CUBEY.SCENE.
  2. Using the file browser button I selected the CUBEY.SCENE.MBIN. It initially displayed the full address, but I think after exporting PLANTPOTLSYSPROC.SCENE it corrected it to //CUSTOMMODELS\CUBEY\CUBEY.SCENE.MBIN.
  3. I exported this scene with Preserve Node Info.

Plantpot scene setup

Seeing the Result In-Game

  1. The first time I tested CUBEY out, the diffuse texture was showing, but I was not sure if it was distorted. I decided to place a normal map from the squid ship called SQUIDSCLASS_TRIM.BASE.NORMAL to test the normals. Renamed the new image texture node name and label to Texture Image - Normal. This is the result.

CUBEY SETUP CUBEY SETUP

As you can see compared to the normals displayed in the blender screenshot, the normals are all stretched/mis-aligned.

  1. I decide to decompile CUBEY.SCENE.MBIN from my pak and import into blender and see if anything changed. The UVs are all out of place, and no material imports.

Imported CUBEY.SCENE from pak with messed up UVs/no material.

CUBEY SETUP

Original UVs in the original blend file.

CUBEY SETUP CUBEY SETUP

Stack trace Attaching them just in case but I didn't see any errors pop up.

Files Included are the Blend Files + Stack Traces, Pak Mod

BlendFiles.zip cruzdroid_CubeyTest.zip

monkeyman192 commented 1 year ago

I know it's been a while, but I believe this should have been fixed in the latest version. If you could check and confirm that would be really good so we can close this.