robmcrosby / BlenderUSDZ

Simple USDZ file exporter plugin for Blender3D
GNU General Public License v3.0
474 stars 66 forks source link

Cannot import models from Apple's website #36

Closed Amrsatrio closed 4 years ago

Amrsatrio commented 4 years ago

I cannot import the iPhone 11 Pro model found here. Maybe because I am running on Windows? Here's the stack trace:

Traceback (most recent call last):
  File "C:\Users\satri\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\__init__.py", line 54, in execute
    return import_usdz.import_usdz(context, **keywords)
  File "C:\Users\satri\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\import_usdz.py", line 38, in import_usdz
    importData(context, usdData, tempDir, materials, animations)
  File "C:\Users\satri\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\import_usdz.py", line 64, in importData
    materials = importMaterials(usdData, tempDir) if materials else {}
  File "C:\Users\satri\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\import_usdz.py", line 416, in importMaterials
    mat = createMaterial(matData, tempDir)
  File "C:\Users\satri\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\import_usdz.py", line 429, in createMaterial
    setMaterialInput(data, 'diffuseColor', 'Base Color')
  File "C:\Users\satri\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\import_usdz.py", line 471, in setMaterialInput
    setShaderInputTexture(data, inputData, inputName)
  File "C:\Users\satri\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\import_usdz.py", line 550, in setShaderInputTexture
    texNode = getImageTextureNode(data, inputData.value.parent)
  File "C:\Users\satri\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\import_usdz.py", line 519, in getImageTextureNode
    mapNode = getTextureMappingNode(data, usdTexture)
  File "C:\Users\satri\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\import_usdz.py", line 495, in getTextureMappingNode
    uvMap = stData['inputs:varname'].value.value
AttributeError: 'str' object has no attribute 'value'

location: <unknown location>:-1
robmcrosby commented 4 years ago

The initial issue was fixed by a recent fix but another crash was encountered and fixed as well. Was able to successfully test importing the iPhone model on MacOS. Thanks for the report and link to the model.

Amrsatrio commented 4 years ago

Thanks, the model can be successfully imported now. But the textures on the iPhone 11 Pro are messed up. Also the cheese grater on this Mac Pro model isn't visible. The texture UV's are messed up.