Git Product home page Git Product logo

blenderusdz's Introduction

Blender UDSZ file import/export add-on

USDZ file import and export plugin for Blender, that provides a simple method of importing and exporting models used with Augmented Reality applications.

Installation

  1. Download io_export_usdz.zip file from the root of this repository.
  2. Open Blender 2.8 and Go to edit -> User Preferences...
  3. In User Preferences select Add-ons on the left hand menu and then select the Install button on the top right side of the window.
  4. Navigate to and select the downloaded zip file from step 1.
  5. Select the check mark next to Import-Export: UDSZ format to activate the plugin.

Usage

Always be sure to save your work before using this tool. This tool will attempt to export the currently selected objects in the blender scene. The tool can be found in blender under File -> Export -> USDZ (.usdz) When selected the add-on will present the usual file export window for where to export the usdz file along with some options on the left side tool bar. Depending on which options are selected and the size and complexity of the selected objects could affect the amount of time it takes to export a usdz file.

Add-on Options

Import Options

Import Materials - By selecting this option, the add-on will attempt to import materials associated with objects.

Export Options

Export Materials - The exporter will export object materials as USD Principled shader materials which share many of the same properties as the Principled BSDF shader for Eevee and Cycles in Blender. Mix and Add shader nodes are not supported yet in this add-on.

Export Animations - When selected, the active object/bone animation will be exported to the usdz file. Currently any animations are baked per-frame.

Bake Textures - When enabled, any textures associated with materials will be baked out to image files that will be bundled into the usdz file. Currently the add-on will automatically switch to Cycles to bake images which could take a significant amount of time. This option is ignored if Export Materials is unchecked.

Bake AO - This options bakes ambient occlusion textures that are applied to the USD Principled shader materials in the usdz file. Activating this option can add a significant amount of time to export. This option is ignored if Export Materials is unchecked.

Samples - The number of samples used in baking the ambient occlusion textures. A higher number generates higher quality occlusion textures with added time to export. This option is ignored if either Export Materials or Bake AO options are unchecked.

Scale - This value is used to scale the objects exported to the usdz file.

Use Usdz Converter Tool - By selecting this option, the add-on will export a usda file that will be converted to usdz by the external Usdz Converter Tool bundled with Xcode. Note that the Usdz Converter has been deprecated from the current version of Xcode and this option will no longer work.

Notes

This add-on has only been tested to work on Mac-OS and there are no guarantees that it will work on Windows or Linux.

The generated binary usd file used in the exported usdz file could potentially be incompatible to some augmented reality applications, in these cases it is recommend to export the text version of a usd file by adding the ".usda" extension to the exported file name. Then use the usdconvert tool in usdpython to generate the final usdz file.

The import functionality is currently limited to simple static models with no animations.

blenderusdz's People

Contributors

robmcrosby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blenderusdz's Issues

cannot install

i'm tryng to install the plugin in the normal way
this is the console:
Modules Installed () from '/Users/apo/Downloads/BlenderUSDZ-master.zip' into '/Users/apo/Library/Application Support/Blender/2.80/scripts/addons'

every thing seems to work but then I can't find the plugin in the installed list

doesn't seem to work

Hey this plugin doesn't seem to work for me,

Blender Version 2.90.1 (2.90.1 2020-09-23)

`Traceback (most recent call last):
File "/Users/sterlingcrispin/Library/Application Support/Blender/2.90/scripts/addons/io_scene_usdz/init.py", line 54, in execute
return import_usdz.import_usdz(context, **keywords)
File "/Users/sterlingcrispin/Library/Application Support/Blender/2.90/scripts/addons/io_scene_usdz/import_usdz.py", line 38, in import_usdz
importData(context, usdData, tempDir, materials, animations)
File "/Users/sterlingcrispin/Library/Application Support/Blender/2.90/scripts/addons/io_scene_usdz/import_usdz.py", line 81, in importData
materials = importMaterials(usdData, tempDir) if materials else {}
File "/Users/sterlingcrispin/Library/Application Support/Blender/2.90/scripts/addons/io_scene_usdz/import_usdz.py", line 435, in importMaterials
mat = createMaterial(matData, tempDir)
File "/Users/sterlingcrispin/Library/Application Support/Blender/2.90/scripts/addons/io_scene_usdz/import_usdz.py", line 448, in createMaterial
setMaterialInput(data, 'diffuseColor', 'Base Color')
File "/Users/sterlingcrispin/Library/Application Support/Blender/2.90/scripts/addons/io_scene_usdz/import_usdz.py", line 490, in setMaterialInput
setShaderInputTexture(data, inputData, inputName)
File "/Users/sterlingcrispin/Library/Application Support/Blender/2.90/scripts/addons/io_scene_usdz/import_usdz.py", line 571, in setShaderInputTexture
texNode = getImageTextureNode(data, inputData.value.parent)
File "/Users/sterlingcrispin/Library/Application Support/Blender/2.90/scripts/addons/io_scene_usdz/import_usdz.py", line 540, in getImageTextureNode
mapNode = getTextureMappingNode(data, usdTexture)
File "/Users/sterlingcrispin/Library/Application Support/Blender/2.90/scripts/addons/io_scene_usdz/import_usdz.py", line 514, in getTextureMappingNode
uvMap = stData['inputs:varname'].value
AttributeError: 'NoneType' object has no attribute 'value'

location: :-1

`

Misnomer in project readme

The project readme states that this is for the “UDSZ” format, which does not match the repository name, “BlenderUSDZ.”

Obviously a typo, but a rather dismarketing one to be on the front page of the addon. 🤭🙃

[linux] usdz import failes.

When i try to import a usdz file exported from houdini i get the following error.


Warning: 'OBJ_SEQUENCE_properties' doesn't contain '_PT_' with prefix & suffix
Warning: class IMPORT_OT_usdz contains a property which should be an annotation!
/home/tanghe/.config/blender/2.82/scripts/addons/io_scene_usdz/__init__.py:141
    assign as a type annotation: IMPORT_OT_usdz.materials
    assign as a type annotation: IMPORT_OT_usdz.animations
Warning: class EXPORT_OT_usdz contains a property which should be an annotation!
/home/tanghe/.config/blender/2.82/scripts/addons/io_scene_usdz/__init__.py:141
    assign as a type annotation: EXPORT_OT_usdz.exportMaterials
    assign as a type annotation: EXPORT_OT_usdz.exportAnimations
    assign as a type annotation: EXPORT_OT_usdz.bakeTextures
    assign as a type annotation: EXPORT_OT_usdz.bakeAO
    assign as a type annotation: EXPORT_OT_usdz.bakeAOSamples
    assign as a type annotation: EXPORT_OT_usdz.bakeTextureSize
    assign as a type annotation: EXPORT_OT_usdz.globalScale
    assign as a type annotation: EXPORT_OT_usdz.useConverter
0  meshes freed
Warning: property 'release_confirm' not found in keymap item  'OperatorProperties'
Traceback (most recent call last):
  File "/home/tanghe/.config/blender/2.82/scripts/addons/io_scene_usdz/__init__.py", line 54, in execute
    return import_usdz.import_usdz(context, **keywords)
  File "/home/tanghe/.config/blender/2.82/scripts/addons/io_scene_usdz/import_usdz.py", line 19, in import_usdz
    fileName, fileType = fileName.split('.')
ValueError: too many values to unpack (expected 2)

stack dump when I use it to export

Mac OSX Big Sur. 11.5.2
Blender 2.93.4

Most of my future work will require Y-up orientation and I will need to switch platforms if Blender unable to export to USDZ. I am hoping you are still working on this Add-on.
Attached is the error report

Serge

Screen Shot 2021-09-29 at 6 53 45 PM

For Windows

Is there any chance that usdz exporting would work on Windows in near future?

uv mapping not set properly

trying to load usdz from iphone app polycam (lidar scanning), textures are loaded and mesh but the UV map node connected to vector just says st and everything blank..
..removing or changing to uv mapping nothing works, so it's either not set at the source properly or there was some problem while importing..

example file https://gofile.io/d/rEFNfC

TypeError: unsupported operand type(s) for &: 'list' and 'int'

When executing an export using this tool I'm having this issue.

Traceback (most recent call last):
Support/Blender/2.80/scripts/addons/io_scene_usdz/__init__.py", line 123, in execute
    return export_usdz.export_usdz(context, **keywords)
Support/Blender/2.80/scripts/addons/io_scene_usdz/export_usdz.py", line 54, in export_usdz
    writeCrateFile(usdcPath, usdData)
 Support/Blender/2.80/scripts/addons/io_scene_usdz/export_usdz.py", line 103, in writeCrateFile
    crate.writeUsd(usdData)
Support/Blender/2.80/scripts/addons/io_scene_usdz/crate_file.py", line 652, in writeUsd
    self.writeUsdPrim(child)
Support/Blender/2.80/scripts/addons/io_scene_usdz/crate_file.py", line 621, in writeUsdPrim
    self.writeUsdPrim(child)
Support/Blender/2.80/scripts/addons/io_scene_usdz/crate_file.py", line 621, in writeUsdPrim
    self.writeUsdPrim(child)
Support/Blender/2.80/scripts/addons/io_scene_usdz/crate_file.py", line 629, in writeUsdPrim
    self.writeUsdAttribute(attribute)
Support/Blender/2.80/scripts/addons/io_scene_usdz/crate_file.py", line 584, in writeUsdAttribute
    fset.append(self.addField('default', usdAtt.value, usdAtt.valueType))
Support/Blender/2.80/scripts/addons/io_scene_usdz/crate_file.py", line 431, in addField
    return self.addFieldItem(field, vType, False, True, False, value)
Support/Blender/2.80/scripts/addons/io_scene_usdz/crate_file.py", line 160, in addFieldItem
    rep = (vType.value << 48) | (payload & PAYLOAD_MASK)
TypeError: unsupported operand type(s) for &: 'list' and 'int'

location: <unknown location>:-1

Texture Maps not exporting

When I use the exporter with a material that has a texture map attached. It either exports with no material or the file wont be recognized by XCode or Apple's previewer. I assumed it was my asset, but when I downloaded the USDZ examples off Apple's website. They imported (using your importer) with the materials, but they do not export with the material. It only seems to work if I remove the texture maps and use the color sliders, but this wont work for the models I am trying to work on as I need the texture maps to export too. I tested this with using USDA and the USDZ converter, It did not work either.

deleting objects throws exception

Hi, this plugin is great, thanks for making it.
In Blender 2.82, I make a scene with animations, export to USDZ all works OK.
If I go back and delete an object,save, then export it throws an exception:

Traceback (most recent call last):
File "/Users/xxx/Library/Application Support/Blender/2.82/scripts/addons/io_scene_usdz/init.py", line 123, in execute
return export_usdz.export_usdz(context, **keywords)
File "/Users/xxx/Library/Application Support/Blender/2.82/scripts/addons/io_scene_usdz/export_usdz.py", line 40, in export_usdz
globalScale = globalScale)
File "/Users/xxx/Library/Application Support/Blender/2.82/scripts/addons/io_scene_usdz/export_usdz.py", line 74, in exportUsdData
scene.loadContext(context)
File "/Users/xxx/Library/Application Support/Blender/2.82/scripts/addons/io_scene_usdz/scene_data.py", line 830, in loadContext
bpy.ops.object.mode_set(mode='OBJECT')
File "/Applications/Blender.app/Contents/Resources/2.82/scripts/modules/bpy/ops.py", line 201, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.mode_set.poll() failed, context is incorrect

location: :-1

hope thats helpful

Export as component USDZ model (containing separate parts)

Hi,

I am trying to have separated parts in my model to be able to show/hide some parts (more described here). I found that I need to access modelEntity.children property and there should be many children for each parts. But for me it has only 1 child. How can I export model to have many parts/children? I am new in Blender so I don't know if I should keep each part in collection or how to set hierarchy.

Thanks for help

Trying to import robot.usdz from Body Capture

There are all kind of error reported when I tried to import USDZ, but I wonder if you can make this one work Basically I am curious on Apple's example Body Motion Capture and wanted to import the robot.usdz and using my own character.

https://developer.apple.com/documentation/arkit/capturing_body_motion_in_3d

Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/__init__.py", line 54, in execute
    return import_usdz.import_usdz(context, **keywords)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/import_usdz.py", line 34, in import_usdz
    usdData = crate.readUsd()
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/crate_file.py", line 700, in readUsd
    index, jump = self.readUsdItem(data, index)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/crate_file.py", line 659, in readUsdItem
    index, itemJump = self.readUsdItem(prim, index)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/crate_file.py", line 659, in readUsdItem
    index, itemJump = self.readUsdItem(prim, index)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/crate_file.py", line 659, in readUsdItem
    index, itemJump = self.readUsdItem(prim, index)
  [Previous line repeated 3 more times]
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/crate_file.py", line 664, in readUsdItem
    valueType = getValueTypeFromStr(valueTypeStr)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/value_types.py", line 172, in getValueTypeFromStr
    return ValueType[typeStr]
  File "/Applications/Blender.app/Contents/Resources/2.81/python/lib/python3.7/enum.py", line 352, in __getitem__
    return cls._member_map_[name]
KeyError: 'color4f'

UPDATED:: Installed now, but now import errors

n00b here, but what file am supposed to install exactly?

The instructions say to instal "io_export_usdz.zip", but all I see are files called "BlenderUSDZ-master.zip" and "io_scene_usdz.zip". Following through with the instructions anyway produces expected results of nothing showing up in add-ons menu to add on.

Where do I go from here? Is this no longer an operational plugin?

Importing USDZ Model Bug

I imported the Toy Robot Vintage example from Apple, I am getting this:

Screen Shot 2019-11-21 at 11 11 59 am

Is it because of the animation data that comes with the robot?

Exporting Blender animation to USDZ

Great converter. Thanks for building this. When I try to export a blender animation with key frames, I can only get the animation to export a still object at the position of the play head. Am I missing a step in conversion process or setting up animation in Blender incorrectly? Thanks!

Exporting light/emissive textures

Hi there,

I was wondering if there's support for exporting emissive textures for the purpose of making a lamp/light?

So far I haven't been able to get it to work with Principled BDSF or Emissive textures in Blender.

Thanks for your help

I have questions about the method here:

Not to be critical, I'm sure this is a useful plugin but it seems there are two other (better?) methods this could be done:

  • Blender can now (2.82) create USD files. You could then use the usdzip utility to create a usdz file
  • USD now has Python3 bindings (in fact if you used the NVidia distribution had them for a while so could use that to write out files

Again, not saying this isn't a nice addon, but I'd recommend moving to one of the above methods rather than writing out files by hand. Seems to be re-inventing the wheel, or at least if the api changes will not work.

files only allowed to have one dot char

the importer crashes if a file name contains more than one dot char

Python: Traceback (most recent call last):
  File "/Users/xxxx/Library/Application Support/Blender/2.91/scripts/addons/io_scene_usdz/__init__.py", line 54, in execute
    return import_usdz.import_usdz(context, **keywords)
  File "/Users/xxxx/Library/Application Support/Blender/2.91/scripts/addons/io_scene_usdz/import_usdz.py", line 19, in import_usdz
    fileName, fileType = fileName.split('.')
ValueError: too many values to unpack (expected 2)

location: <unknown location>:-1

Strange error exporting

Every now and then I am getting this error, wondering if this is because I name the object with dots or maybe because of my setup with Sverchok nodes etc... not having the mesh in Collection?

location: <unknown location>:-1
Smart Projection time: 20.18
Info: Baking map saved to internal image, save it externally or pack it
Info: Deleted 1 object(s)
Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/__init__.py", line 123, in execute
    return export_usdz.export_usdz(context, **keywords)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/export_usdz.py", line 54, in export_usdz
    writeCrateFile(usdcPath, usdData)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/export_usdz.py", line 103, in writeCrateFile
    crate.writeUsd(usdData)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/crate_file.py", line 628, in writeUsd
    self.writeUsdPrim(child)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/crate_file.py", line 597, in writeUsdPrim
    self.writeUsdPrim(child)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/crate_file.py", line 605, in writeUsdPrim
    self.writeUsdAttribute(attribute)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/crate_file.py", line 569, in writeUsdAttribute
    fset.append(self.addField('default', usdAtt.value, usdAtt.valueType))
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/crate_file.py", line 416, in addField
    return self.addFieldItem(field, type, False, True, False, value)
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.81/scripts/addons/io_scene_usdz/crate_file.py", line 159, in addFieldItem
    rep = (vType.value << 48) | (payload & PAYLOAD_MASK)
TypeError: unsupported operand type(s) for &: 'list' and 'int'

location: <unknown location>:-1

location: <unknown location>:-1

Unable to Install in Blender 2.93

Hello, I am unable to install this through Blender 2.93. After selecting the BlenderUSDZ-master.zip, I see Blender processing the install but it never appears in the list of addons. Has anyone else had this issue? Do I need to revert back to 2.8 to use this addon?
Thanks

Baking Textures Suggestion and AO query

Hi. Could you make the baking of the textures linked to the material instead of objects. Right now it exports texture map for every objects even if they have the same material. This is the gramaphone I downloaded from apple website. I imported and exported it again. Also how do I input custom AO map from blender. I dont see any AO Map when I import the USDZ File.

AO
Bake_Export

Value Error

I'm getting a value error with this on import of a USDZ model. Does this mean the model is too complex?

Traceback (most recent call last):
  File "/Users/samdelara/Library/Application Support/Blender/2.90/scripts/addons/io_scene_usdz/__init__.py", line 54, in execute
    return import_usdz.import_usdz(context, **keywords)
  File "/Users/samdelara/Library/Application Support/Blender/2.90/scripts/addons/io_scene_usdz/import_usdz.py", line 19, in import_usdz
    fileName, fileType = fileName.split('.')
ValueError: too many values to unpack (expected 2)

location: <unknown location>:-1


Model doesn't show on iPhone

Hi, when I export a model to usdz, it does not show in AR Quick Look on my iPhone (not in AR View, nor in Object View). However, it shows perfectly in Quick Look on my Mac.
Does anyone have an idea where the problem could be?
I'm using Blender 2.82a and iOS 13.3.1 on my iPhone X

usdz importer throws exception

bpy.ops.object.delete(use_global=False, confirm=False)
Deleted 1 object(s)
bpy.context.space_data.bookmarks_active = 0
bpy.context.space_data.bookmarks_active = 0
Traceback (most recent call last):
File "C:\Users\marku\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz_init_.py", line 48, in execute
return import_usdz.import_usdz(context, **keywords)
File "C:\Users\marku\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\import_usdz.py", line 33, in import_usdz
usdData = crate.readUsd()
File "C:\Users\marku\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\crate_file.py", line 698, in readUsd
index, jump = self.readUsdItem(data, index)
File "C:\Users\marku\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\crate_file.py", line 659, in readUsdItem
index, itemJump =

self.readUsdItem(prim, index)
File "C:\Users\marku\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\crate_file.py", line 659, in readUsdItem
index, itemJump = self.readUsdItem(prim, index)
File "C:\Users\marku\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\crate_file.py", line 659, in readUsdItem
index, itemJump = self.readUsdItem(prim, index)
File "C:\Users\marku\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\crate_file.py", line 664, in readUsdItem
valueType = getValueTypeStr(valueTypeStr)
File "C:\Users\marku\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_scene_usdz\value_types.py", line 167, in getValueTypeStr
return ValueType[typeStr]
File "C:\blender-2.81-695cbf5eef79-windows64\2.81\python\lib\enum.py", line 352, in getitem
return cls.member_map[name]
KeyError: 'double3'

location: :-1

I tried multiple models. All of them were created using the usdzconvert script that Apple provides. Attached one of the models for you to reproduce.

Russian Doll.zip

Bake Texture Option is slightly vague

From my first test of the addon, I noticed that if I did not enable "Bake Texture" option, the Image Texture that I assign to Material does not actually get exported out. It will simply have Material with no texture.

So I need to use Bake Image Texture, specify the (optimized) size and only then I am getting USDZ with material + texture.

It might be slightly confusing for user however. Maybe they just want to export the Material + Texture as is, and not realizing "Bake Texture".

"Non-Color" not found in ('Linear', 'sRGB')

Python: Traceback (most recent call last):
  File "/home/allie/.config/blender/3.0/scripts/addons/io_scene_usdz/__init__.py", line 66, in execute
    return import_usdz.import_usdz(context, **keywords)
  File "/home/allie/.config/blender/3.0/scripts/addons/io_scene_usdz/import_usdz.py", line 38, in import_usdz
    importData(context, usdData, tempDir, materials, animations)
  File "/home/allie/.config/blender/3.0/scripts/addons/io_scene_usdz/import_usdz.py", line 81, in importData
    materials = importMaterials(usdData, tempDir) if materials else {}
  File "/home/allie/.config/blender/3.0/scripts/addons/io_scene_usdz/import_usdz.py", line 440, in importMaterials
    mat = createMaterial(matData, tempDir)
  File "/home/allie/.config/blender/3.0/scripts/addons/io_scene_usdz/import_usdz.py", line 454, in createMaterial
    setMaterialInput(data, 'metallic', 'Metallic')
  File "/home/allie/.config/blender/3.0/scripts/addons/io_scene_usdz/import_usdz.py", line 495, in setMaterialInput
    setShaderInputTexture(data, inputData, inputName)
  File "/home/allie/.config/blender/3.0/scripts/addons/io_scene_usdz/import_usdz.py", line 582, in setShaderInputTexture
    connectTextureToValueInput(data, texNode, input)
  File "/home/allie/.config/blender/3.0/scripts/addons/io_scene_usdz/import_usdz.py", line 552, in connectTextureToValueInput
    texNode.image.colorspace_settings.name = 'Non-Color'
TypeError: bpy_struct: item.attr = val: enum "Non-Color" not found in ('Linear', 'sRGB')

location: <unknown location>:-1

Happens when trying to import this:
playdate-flat.zip

Non-Colour Data issue on import

I got an error when importing also textures along with an usdz file.
I was able to fix the issue on a couple of lines of code and now it works correctly for me on 2.83.
Here the link to the fixed addon if someone else needs this: http://u.pc.cd/khvrtalK

Does not work with Transparency or Alpha PNG?

Hi I tested the USDZ export, so far so good! It seems to be working for simple material, but if I use transparency shader or PNG with alpha, it does not seem to work:

PinClipart_com_snow-flake-clip-art_4527047

Screen Shot 2019-11-21 at 9 16 36 am

Any idea on this?

UDSZ Import?

Is it possible for this addon to import the latest version of USDZ (circa Object Capture API)?

Running in headless mode documentation

Hello, I'm planning to use the file to import usdz to other file types via purely python script and CL, I was wondering if that would be possible with the use of this library?

Bug when exporting USDZ with baking ambient occlusion option?

I was making a video on this addon and finding a bug when I tried to export out a simple Duck mesh + texture and bake the AO.

Screen Shot 2019-11-21 at 10 42 53 am

I wonder if this is something to do with Mesh not selected or not inside expected Collection Set or something.

We need probably option to export Selected Objects only or everything in the scene, without having to actually select them manually.

Doesnt work for a few usdz files

I tried it on a bunch of usdz files provided by apple APIs, but there in no geometry I can see in blender.

This usdz file Toy drummer usdz for example doesnt work.
This is with blender 3.2 .
Any thoughts on how this can be fixed?

Selectively call usdcat instead of xcrun usdconvert

It seems your dependency to macOS and installed XCode with usdconvert is because you use the wrong (meaning not official) tool to convert from .usda to .usdc

Pixar has the python script usdcat to translate between USDA and USDC.
And this not only is installed on macOS, but can be installed on Linux and Windows as well.

There is a binary release of the USD Tools version 19.11 for Windows under Github VictorYudin

Glare export

Hello, the glare (Fog glow) export isn't really happening. Is it meant to work?

Export usdz issue

Hi! I'm trying to export a model with your plugin. however, it throws an exception. Could you explain what's going wrong?

Traceback (most recent call last):
File "/Users/roman/Library/Application Support/Blender/2.82/scripts/addons/io_scene_usdz/init.py", line 123, in execute
return export_usdz.export_usdz(context, **keywords)
File "/Users/roman/Library/Application Support/Blender/2.82/scripts/addons/io_scene_usdz/export_usdz.py", line 40, in export_usdz
globalScale = globalScale)
File "/Users/roman/Library/Application Support/Blender/2.82/scripts/addons/io_scene_usdz/export_usdz.py", line 74, in exportUsdData
scene.loadContext(context)
File "/Users/roman/Library/Application Support/Blender/2.82/scripts/addons/io_scene_usdz/scene_data.py", line 830, in loadContext
bpy.ops.object.mode_set(mode='OBJECT')
File "/Applications/Blender.app/Contents/Resources/2.82/scripts/modules/bpy/ops.py", line 201, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.mode_set.poll() failed, context is incorrect

location: :-1

I used export options:
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)
bpy.data.window_managers["WinMan"].(null) = True
bpy.data.window_managers["WinMan"].(null) = True
bpy.data.window_managers["WinMan"].(null) = 128
bpy.data.window_managers["WinMan"].(null) = 512

Add-on won't install.

Hi, when im installing add-on by choosing zip file, blender seems to be installing. but i cant find it in my add-on list. i have looked everywhere. It is just not exist.

Cannot import models from Apple's website

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

Import of *.usdz from iOS app "Capture" doesnt work

Hello,

I made test 3D scan of my face using the Capture app on iphone xs (https://apps.apple.com/us/app/capture-3d-scan-anything/id1444183458) which saves the 3D scans as *.usdz files.
I sent it to myself via email from the app and tried to import into Blender using your script, but theres nothing imported in the scene.
In Blender console it says "No usdc file found"

I know usdz is just zip file with other usd* files. so i tried to manually export the *.usdc file from the usdz and tried also to import directly *.usdc file, but nothing is imported, and with *.usdc theres no message in the log at all.

Then as last thing i tried to "zip" the exported usdc file again with zero compression (and putting the usdc file at the root of the zip), and renamed it to *.usdz. That actually imported something into Blender, i see vertex and face counts, but nothing really visible on screen and the location of the imported model was waay out somewhere - see first screenshot.
I moved the whole object to 0 0 0 and now i see single vertex like object in the middle of the screen which i tried to resize, but doenst help, it stays like that.

import1
import2

Capture is one of the fully free 3D scan apps afaik (for now and hopefully forever) supporting the TrueDepth camera on newer iphones so it would be really cool if this was fixed :)

BR,
Adam

'NoneType' object has no attribute 'value' when importing this model

Python: Traceback (most recent call last):
  File "C:\Users\allie\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_scene_usdz\__init__.py", line 54, in execute
    return import_usdz.import_usdz(context, **keywords)
  File "C:\Users\allie\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_scene_usdz\import_usdz.py", line 38, in import_usdz
    importData(context, usdData, tempDir, materials, animations)
  File "C:\Users\allie\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_scene_usdz\import_usdz.py", line 81, in importData
    materials = importMaterials(usdData, tempDir) if materials else {}
  File "C:\Users\allie\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_scene_usdz\import_usdz.py", line 435, in importMaterials
    mat = createMaterial(matData, tempDir)
  File "C:\Users\allie\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_scene_usdz\import_usdz.py", line 454, in createMaterial
    setMaterialInput(data, 'emissiveColor', 'Emission')
  File "C:\Users\allie\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_scene_usdz\import_usdz.py", line 490, in setMaterialInput
    setShaderInputTexture(data, inputData, inputName)
  File "C:\Users\allie\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_scene_usdz\import_usdz.py", line 571, in setShaderInputTexture
    texNode = getImageTextureNode(data, inputData.value.parent)
  File "C:\Users\allie\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\io_scene_usdz\import_usdz.py", line 532, in getImageTextureNode
    filePath = data['tempDir'] + usdTexture['inputs:file'].value
AttributeError: 'NoneType' object has no attribute 'value'

location: <unknown location>:-1

Here's the model: https://play.date/static/assets/media/playdate.usdz

Can't Find Zip File

I am a little confused as I cannot find the file mentioned (io_export_usdz.zip ). I can find io_scene_usdz.zip but not the export variant.
I click on Code and do not see that particular file name.
Regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.