johnzero7 / XNALaraMesh

Blender addon Import/Export XPS Models, Poses

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XPS Tools 2.0 not working with Blender 2.81/2.81a

PteJack opened this issue · comments

First off JohnZero7, I would like to thank you for your dedication to the modeling community and for this most excellent tool. As a tutorial writer I use it regularly and link your GitHub for the tool.
I posted a note on this a few days ago on your Deviantartist page as well.

Reading through the issues here I see that this situation has been reported, but as 2.81 was still in alpha, you wanted to wait, which with the changes happening in 2.8x is completely understandable.
2.81 has been officially released and has already been fixed up to 2.81a. I'm still receiving the same errors in 2.81a as I did in 2.81.

Here is an example of the situation in Blender 2.81 Situation

With 2.81a I am getting the same results on import and the errors in the Blender System console are the same... I can provide the XPS model I'm trying to import if required, just let me know...

Thanks
Error log, Blender 2.81a (v2.81.16)
``

---------------EXECUTING XPS PYTHON IMPORTER----------------

Importing file: C:\Users\Brad\Desktop\xps_lisa_park\Lisa casual\xps.xps
rootDir: C:\Users\Brad\Desktop\xps_lisa_park\Lisa casual
File: C:\Users\Brad\Desktop\xps_lisa_park\Lisa casual\xps.xps
Reading Header
Header Found
Tangent Space Normal Map Swizzel Coordinates:
X+ Y- Z+

Reading Bones
Read 1249 Bones
Reading Meshes
Read 11 Meshes
Importing Armature 1249 bones

---*** Importing Mesh 22_belt2_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 7
Created Mesh: 22_belt2_0.1_16_16
New Mesh = 22_belt2_0.1_16_16
Loading Texture: belt_diffuse.png
Loading Texture: belt_lightmap.png
Loading Texture: belt_bump.png
Loading Texture: lightmap_white.png
Loading Texture: bumpmap_flat.png
Traceback (most recent call last):
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\xps_tools.py", line 164, in execute
status = import_xnalara_model.getInputFilename(xpsSettings)
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 78, in getInputFilename
status = xpsImport()
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 159, in xpsImport
meshes_obs = importMeshesList(armature_ob)
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 478, in importMeshesList
for meshInfo in newMeshes]
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 478, in
for meshInfo in newMeshes]
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 615, in importMesh
material_creator.makeMaterial(xpsSettings, rootDir, mesh_da, meshInfo, flags)
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\material_creator.py", line 170, in makeMaterial
makeNodesMaterial(xpsSettings, materialData, rootDir, mesh_da, meshInfo, flags)
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\material_creator.py", line 338, in makeNodesMaterial
mappingCoordNode.scale = (texRepeater, texRepeater, texRepeater)
AttributeError: 'ShaderNodeMapping' object has no attribute 'scale'

location: :-1

location: :-1
Info: Deleted 1 object(s)

Hey PteJack, I used to watch your tutorials when I used to use SFM; thank you for those resources.
I switched to Blender full-time and mostly focused on organizing educational resources for new Blender users:


Regarding your error in Blender 2.81a with XPS Tools v2.0.0, I wasn't able to reproduce it with my setup.

Operating System: Pop!_OS 19.04 (based on Ubuntu)
Blender v2.81a Official Release (non-Steam version for Linux tar.bz2)
XPS Tools v2.0.0

I tested with the following XPS model: King of Fighters: All Star' Shiranui Mai

Do you have a link to download the XPS model you used?

Any luck with factory resetting Blender 2.81a and reinstalling XPS Tools v2.0.0?

Sorry for the tardy, Christmas and all... LOL

Ok, the model I'm trying to import is this one by Tokami-Fuko. It looks like they have pulled the download, but I was handed the model by someone who is trying to port it into SFM. I was going to use it as an example for one of my tutorials for 2.81a but when I tried to import it, I got the result I posted.
Lisa Park
I have placed the model in my dropbox and you can grab it here..
Lisa Dropbox

Now, here's something even stranger and it might point to the something to do with how the model was created.

Lisa model in 2.79b (no problem)
2.79b

Lisa Model in 2.80 (no problem)
2.80

Now I went out and grabbed the model pack you tried and imported the mai(94) model into 2.81a. Then imported the Lisa model into the same session as well... Here's the result...
2.81a

As the author has pulled the download, I'm starting to suspect it may be something to do with the model itself. But why would it import properly into the other 2 versions but not 2.81a?

Here is the System Console from the imports into 2.81a
<xps_tools updater verbose is enabled
xps_tools Updater: Read in JSON settings from file
Starting new HTTPS connection (1): www.blenderkit.com:443
https://www.blenderkit.com:443 "GET /api/v1/categories/ HTTP/1.1" 200 2365

---------------EXECUTING XPS PYTHON IMPORTER----------------

Importing file: C:\Users\Brad\Desktop\mai (94)\xps.xps
rootDir: C:\Users\Brad\Desktop\mai (94)
File: C:\Users\Brad\Desktop\mai (94)\xps.xps
Reading Header
Header Found
Tangent Space Normal Map Swizzel Coordinates:
X+ Y+ Z+

Reading Bones
Read 87 Bones
Reading Meshes
Read 5 Meshes
Importing Armature 87 bones

---*** Importing Mesh 24_+fan.Material146_1_0_0 ***---
UV Layer Count: 1
Texture Count: 4
Created Mesh: 24_+fan.Material146_1_0_0
New Mesh = 24_+fan.Material146_1_0_0
Loading Texture: ch_mai_weapon_94_d.png
Loading Texture: lmap.png
Loading Texture: ch_mai_weapon_n.png
Loading Texture: ch_mai_weapon_94_s.png
Geometry Corrected: False

---*** Importing Mesh 24_-fan.Material146(1)1_0_0 ***---
UV Layer Count: 1
Texture Count: 4
Created Mesh: 24
-fan.Material146(1)1_0_0
New Mesh = 24
-fan.Material146(1)_1_0_0
Loading Texture: ch_mai_weapon_94_d.png
Loading Texture: lmap.png
Loading Texture: ch_mai_weapon_n.png
Loading Texture: ch_mai_weapon_94_s.png
Geometry Corrected: False

---*** Importing Mesh 24_Material145(1)_0.25_0_0 ***---
UV Layer Count: 1
Texture Count: 4
Created Mesh: 24_Material145(1)_0.25_0_0
New Mesh = 24_Material145(1)_0.25_0_0
Loading Texture: ch_mai_94_d.png
Loading Texture: lmap.png
Loading Texture: ch_mai_94_n.png
Loading Texture: ch_mai_94_s.png
Geometry Corrected: False

---*** Importing Mesh 24_Material145(2)_0.25_0_0 ***---
UV Layer Count: 1
Texture Count: 4
Created Mesh: 24_Material145(2)_0.25_0_0
New Mesh = 24_Material145(2)_0.25_0_0
Loading Texture: ch_mai_94_d.png
Loading Texture: lmap.png
Loading Texture: ch_mai_94_n.png
Loading Texture: ch_mai_94_s.png
Geometry Corrected: False

---*** Importing Mesh 24_Material145_0.25_0_0 ***---
UV Layer Count: 1
Texture Count: 4
Created Mesh: 24_Material145_0.25_0_0
New Mesh = 24_Material145_0.25_0_0
Loading Texture: ch_mai_94_d.png
Loading Texture: lmap.png
Loading Texture: ch_mai_94_n.png
Loading Texture: ch_mai_94_s.png
Geometry Corrected: True

---------------EXECUTING XPS PYTHON IMPORTER----------------

Importing file: C:\Users\Brad\Desktop\xps_lisa_park\Lisa casual\xps.xps
rootDir: C:\Users\Brad\Desktop\xps_lisa_park\Lisa casual
File: C:\Users\Brad\Desktop\xps_lisa_park\Lisa casual\xps.xps
Reading Header
Header Found
Tangent Space Normal Map Swizzel Coordinates:
X+ Y- Z+

Reading Bones
Read 1249 Bones
Reading Meshes
Read 11 Meshes
Importing Armature 1249 bones

---*** Importing Mesh 22_belt2_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 7
Created Mesh: 22_belt2_0.1_16_16
New Mesh = 22_belt2_0.1_16_16
Loading Texture: belt_diffuse.png
Loading Texture: belt_lightmap.png
Loading Texture: belt_bump.png
Loading Texture: lightmap_white.png
Loading Texture: bumpmap_flat.png
Traceback (most recent call last):
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\xps_tools.py", line 164, in execute
status = import_xnalara_model.getInputFilename(xpsSettings)
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 78, in getInputFilename
status = xpsImport()
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 159, in xpsImport
meshes_obs = importMeshesList(armature_ob)
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 478, in importMeshesList
for meshInfo in newMeshes]
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 478, in
for meshInfo in newMeshes]
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\import_xnalara_model.py", line 615, in importMesh
material_creator.makeMaterial(xpsSettings, rootDir, mesh_da, meshInfo, flags)
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\material_creator.py", line 170, in makeMaterial
makeNodesMaterial(xpsSettings, materialData, rootDir, mesh_da, meshInfo, flags)
File "C:\Users\Brad\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\XNALaraMesh-master\material_creator.py", line 338, in makeNodesMaterial
mappingCoordNode.scale = (texRepeater, texRepeater, texRepeater)
AttributeError: 'ShaderNodeMapping' object has no attribute 'scale'

location: :-1

location: :-1
Info: Deleted 1 object(s)

This is the log from 2.80 (where there was no problem)

<

---------------EXECUTING XPS PYTHON IMPORTER----------------

Importing file: C:\Users\Brad\Desktop\xps_lisa_park\Lisa casual\xps.xps
rootDir: C:\Users\Brad\Desktop\xps_lisa_park\Lisa casual
File: C:\Users\Brad\Desktop\xps_lisa_park\Lisa casual\xps.xps
Reading Header
Header Found
Tangent Space Normal Map Swizzel Coordinates:
X+ Y- Z+

Reading Bones
Read 1249 Bones
Reading Meshes
Read 11 Meshes
Importing Armature 1249 bones

---*** Importing Mesh 22_belt2_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 7
Created Mesh: 22_belt2_0.1_16_16
New Mesh = 22_belt2_0.1_16_16
Loading Texture: belt_diffuse.png
Loading Texture: belt_lightmap.png
Loading Texture: belt_bump.png
Loading Texture: lightmap_white.png
Loading Texture: bumpmap_flat.png
Loading Texture: bumpmap_flat.png
Loading Texture: belt_spec.png
Geometry Corrected: False

---*** Importing Mesh 22_pants_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 7
Created Mesh: 22_pants_0.1_16_16
New Mesh = 22_pants_0.1_16_16
Loading Texture: pants_diff.png
Loading Texture: pants_L.png
Loading Texture: pants_nrm.png
Loading Texture: lightmap_white.png
Loading Texture: bumpmap_flat.png
Loading Texture: bumpmap_flat.png
Loading Texture: pants_spec.png
Geometry Corrected: False

---*** Importing Mesh 24_+Casual Torso.+body.body_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 4
Created Mesh: 24_+Casual Torso.+body.body_0.1_16_16
New Mesh = 24_+Casual Torso.+body.body_0.1_16_16
Loading Texture: C_Fem_D.png
Loading Texture: C_Fem_L.png
Loading Texture: C_Fem_N.png
Loading Texture: C_Fem_S.png
Geometry Corrected: False

---*** Importing Mesh 24_+Casual Torso.+head.head_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 4
Created Mesh: 24_+Casual Torso.+head.head_0.1_16_16
New Mesh = 24_+Casual Torso.+head.head_0.1_16_16
Loading Texture: skin-textures-1.png
Loading Texture: C_FemHead1_L.png
Loading Texture: C_FemHead1_N.png
Loading Texture: C_FemHead1_S.png
Geometry Corrected: False

---*** Importing Mesh 24_+Casual Torso.+head2.head2_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 4
Created Mesh: 24_+Casual Torso.+head2.head2_0.1_16_16
New Mesh = 24_+Casual Torso.+head2.head2_0.1_16_16
Loading Texture: skin-textures-1.png
Loading Texture: C_FemHead1_L.png
Loading Texture: C_FemHead1_N.png
Loading Texture: C_FemHead1_S.png
Geometry Corrected: False

---*** Importing Mesh 24_+head03.+neckband_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 4
Created Mesh: 24_+head03.+neckband_0.1_16_16
New Mesh = 24_+head03.+neckband_0.1_16_16
Loading Texture: pl1d_03Body_BM.png
Loading Texture: pl1d_03Body_LM.png
Loading Texture: pl1d_03Body_NM.png
Loading Texture: pl1d_03Body_MM.png
Geometry Corrected: False

---*** Importing Mesh 25_+head03.+head01.+hair1.hair_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 4
Created Mesh: 25_+head03.+head01.+hair1.hair_0.1_16_16
New Mesh = 25_+head03.+head01.+hair1.hair_0.1_16_16
Loading Texture: hair_d.png
Loading Texture: flatspec.tga
Loading Texture: hair_n.png
Loading Texture: hair_s.png
Geometry Corrected: False

---*** Importing Mesh 26_metal_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 3
Created Mesh: 26_metal_0.1_16_16
New Mesh = 26_metal_0.1_16_16
Loading Texture: metal_diffuse.png
Loading Texture: metal_bump.png
Loading Texture: environment.png
Geometry Corrected: False

---*** Importing Mesh 4_+head03.+head01.eyes_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 2
Created Mesh: 4_+head03.+head01.eyes_0.1_16_16
New Mesh = 4_+head03.+head01.eyes_0.1_16_16
Loading Texture: eye_diffuse.png
Loading Texture: eye_bump.png
Geometry Corrected: False

---*** Importing Mesh 4_+head03.+head01.skin4_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 2
Created Mesh: 4_+head03.+head01.skin4_0.1_16_16
New Mesh = 4_+head03.+head01.skin4_0.1_16_16
Loading Texture: facecape_diffuse.png
Loading Texture: facecape_bump.png
Geometry Corrected: False

---*** Importing Mesh 7_+head03.+head01.lashes_0.1_16_16 ***---
UV Layer Count: 1
Texture Count: 1
Created Mesh: 7_+head03.+head01.lashes_0.1_16_16
New Mesh = 7_+head03.+head01.lashes_0.1_16_16
Loading Texture: hair_diffuse.png
Geometry Corrected: False

I just tried importing that Lisa Park model into Blender 2.81a, and I got the same problem you got, as shown in that picture.
I have no idea why that's happening.

By chance, did you get an error while extracting the xps_lisa_park_by_tokami_fuko_d88vczo.rar file?

Also, besides Lisa Park, did you come across any other XPS models that fail to import in this way?

Yes, I did, I got a checksum error from the hair_s.png, but I don't think a specular texture would cause this issue, especially if it imports correctly in the earlier versions.

No, not yet anyway. This was the first model I've actually attempted to import to 2.81a and as you see the mai model came in without a problem. What I might try is exporting Lisa as an XPS from 2.79b and see if I can import her in 2.81a. After seeing Mai come in without a problem, I might have cried Wolf too soon and it's just the model.

But it still doesn't answer why she imports into the earlier versions but not in 2.81a. It's looks like something fell out of line between the add-on and the core somewhere. Maybe a UTF8 character in the model that didn't convert properly. Who knows?? LOL

Another API change in Blender 2.81, precisely in the ShaderNodeMapping node. https://wiki.blender.org/wiki/Reference/Release_Notes/2.81/Python_API
#In 2.80 was:
mappingCoordNode.scale = (texRepeater, texRepeater, texRepeater)
#in 2.81 is:
mappingCoordNode.inputs['Scale'].default_value = (texRepeater, texRepeater, texRepeater)

This only affected XPS render groups that supported scaling of the textures, like group 22.
This is why only some models could not be imported in Blender 2.81.
You can update to master using the addon-updater in the preferences or wait for a new release.

Thanks for you patience and keep enjoy this addon!