Initial version of USD Importer #81257
Closed
opened 2020-09-28 17:23:23 +02:00 by Sybren A. Stüvel
·
47 comments
No Branch/Tag Specified
main
blender-v3.6-release
universal-scene-description
temp-sculpt-dyntopo
blender-v3.3-release
asset-browser-frontend-split
brush-assets-project
asset-shelf
anim/armature-drawing-refactor-3
temp-sculpt-dyntopo-hive-alloc
tmp-usd-python-mtl
tmp-usd-3.6
blender-v3.5-release
blender-projects-basics
blender-v2.93-release
temp-sculpt-attr-api
realtime-clock
sculpt-dev
gpencil-next
bevelv2
microfacet_hair
xr-dev
principled-v2
v3.6.3
v3.3.11
v3.6.2
v3.3.10
v3.6.1
v3.3.9
v3.6.0
v3.3.8
v3.3.7
v2.93.18
v3.5.1
v3.3.6
v2.93.17
v3.5.0
v2.93.16
v3.3.5
v3.3.4
v2.93.15
v2.93.14
v3.3.3
v2.93.13
v2.93.12
v3.4.1
v3.3.2
v3.4.0
v3.3.1
v2.93.11
v3.3.0
v3.2.2
v2.93.10
v3.2.1
v3.2.0
v2.83.20
v2.93.9
v3.1.2
v3.1.1
v3.1.0
v2.83.19
v2.93.8
v3.0.1
v2.93.7
v3.0.0
v2.93.6
v2.93.5
v2.83.18
v2.93.4
v2.93.3
v2.83.17
v2.93.2
v2.93.1
v2.83.16
v2.93.0
v2.83.15
v2.83.14
v2.83.13
v2.92.0
v2.83.12
v2.91.2
v2.83.10
v2.91.0
v2.83.9
v2.83.8
v2.83.7
v2.90.1
v2.83.6.1
v2.83.6
v2.90.0
v2.83.5
v2.83.4
v2.83.3
v2.83.2
v2.83.1
v2.83
v2.82a
v2.82
v2.81a
v2.81
v2.80
v2.80-rc3
v2.80-rc2
v2.80-rc1
v2.79b
v2.79a
v2.79
v2.79-rc2
v2.79-rc1
v2.78c
v2.78b
v2.78a
v2.78
v2.78-rc2
v2.78-rc1
v2.77a
v2.77
v2.77-rc2
v2.77-rc1
v2.76b
v2.76a
v2.76
v2.76-rc3
v2.76-rc2
v2.76-rc1
v2.75a
v2.75
v2.75-rc2
v2.75-rc1
v2.74
v2.74-rc4
v2.74-rc3
v2.74-rc2
v2.74-rc1
v2.73a
v2.73
v2.73-rc1
v2.72b
2.72b
v2.72a
v2.72
v2.72-rc1
v2.71
v2.71-rc2
v2.71-rc1
v2.70a
v2.70
v2.70-rc2
v2.70-rc
v2.69
v2.68a
v2.68
v2.67b
v2.67a
v2.67
v2.66a
v2.66
v2.65a
v2.65
v2.64a
v2.64
v2.63a
v2.63
v2.61
v2.60a
v2.60
v2.59
v2.58a
v2.58
v2.57b
v2.57a
v2.57
v2.56a
v2.56
v2.55
v2.54
v2.53
v2.52
v2.51
v2.50
v2.49b
v2.49a
v2.49
v2.48a
v2.48
v2.47
v2.46
v2.45
v2.44
v2.43
v2.42a
v2.42
v2.41
v2.40
v2.37a
v2.37
v2.36
v2.35a
v2.35
v2.34
v2.33a
v2.33
v2.32
v2.31a
v2.31
v2.30
v2.28c
v2.28a
v2.28
v2.27
v2.26
v2.25
Labels
Clear labels
This issue affects/is about backward or forward compatibility
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
Apply labels
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
This issue affects/is about backward or forward compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest: Wayland
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest: Wayland
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Set Project
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
16 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#81257
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
The goal of this task is to create a USD importer loosely based on the Alembic importer. This means the following:
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @dr.sybren
Added subscriber: @fsiddi
Tested a build based on the usd-importer-#81257 branch . The basic Pixar kitchen loads fairly quickly, and instancing saves memory as expected.
Without instancing
With instancing
Added subscriber: @Noto
Added subscriber: @Pipeliner
As an update, I recently extended the USD importer experimental instancing option to support collection instances, to allow editing of instance prototypes after import. (The change is committed to the usd-importer-#81257 branch .)
Added subscriber: @slumber
@makowalski Please don't include icons from proprietary software in any comment. These are covered by copyright and other nastyness; see Ton's recent post on devtalk for more context.
Thanks for pointing this out, Sybren, and I apologize for the oversight. I've removed the video.
Added subscriber: @PhilippeCrassous
Added subscriber: @semimetallic
Added subscriber: @bao007fei
Added subscriber: @jta
Added subscriber: @Zandman
I love this gets added to Blender! I just tested the "usd-importer-#81257-merge" branch on a couple of USDs of Apple products I downloaded from Apple's website (like this AirTag ). In fact they are USDZ files. I noticed these aren't supported. Are there any plans to support USDZ files?
I extracted the USDs from the USDZ archives and imported them. But unfortunately the results weren't very good. Materials were off/missing. I had better results using an old Blender USDZ add-on ( https://github.com/robmcrosby/BlenderUSDZ ). Did I expect too much? Is there still a lot of work to do on this feature?
Another issue I noticed: when I select an USD file in the USD import file dialog the background of the filename input box turns red. This normally only happens when you try to save/overwrite an existing file. But since I'm only importing the file I don't think it should turn red.
@Zandman Hi Leon. Thank you very much for the feedback regarding the USD importer! I'll reply to your second comment first.
Indeed, there was a bug where the USD import file selection dialog was being opened incorrectly. Thank you for catching this! I just pushed a fix to the branch.
I will reply to your first question about usdz and materials shortly.
@Zandman To reply to your first comment: importing USDZ wasn't a specific requirement of this task, but I'm sure the importer will be extended to handle this format at some point.
As for materials, by default the importer creates materials without nodes, just setting the material's color, metallic and roughness properties. If a material with the same name already exists in the Blender scene, the existing material will be assigned. This is roughly equivalent to what the Alembic importer does.
However, there is an experimental feature for converting USD Preview Surface shaders to Blender Principled BSDF node networks. This can be enabled by checking the 'Import USD Preview' option in the 'Experimental' section at the bottom of the USD import dialog. This feature is still a work in progress, in that it doesn't handle all USD Preview node types. There is certainly work to be done to improve this and there are some bugs that I intend to fix (e.g., incorrect color space settings in some cases).
However, I haven't noticed missing materials. (I believe all the materials in the AirTag example imported for me.) Do you have an example where some materials didn't import?
I just imported the AirTag file on a build that includes your latest changes. The file dialog bug has indeed been fixed.
However, when I import the USD I do see several materials. But in the viewport it doesn't look right. The object is all gray in all modes (resembles Solid Preview Mode). When I enable that experimental feature things look a little bit better. The Material Preview mode now shows the metallic material of the AirTag. But when I switch to Render Preview the AirTag consists of grey material. Or when I switch to Cycles, it is all black. Even when I add more light.
Maybe I'm doing something wrong?
Another issue is that some of Apple's USDs contain textures in HEIC format (like this iMac USD). This format currently isn't supported by Blender, so they will fail to load. I've converted them to JPG, which fixed the Material Preview. But still the render preview is black.
@Zandman Hi Leon. I found the issue: due to an oversight on my part, the render preview worked for Eevee but not Cycles. I pushed a fix to the branch. I very much appreciate your testing and feedback, which helped me address these two bugs. Thank you!
(As I previously mentioned, the material import is a work in progress and more improvements and fixes will be coming to get a closer match.)
Added subscriber: @gopi.vfx
Great! This is much needed addition.
Couldn't find the latest windows version in daily builds section.
When can we expecting instance geometry import?
@gopi.vfx I developed an experimental prototype for importing USD scene graph instances as Blender collection instances, but this is not included in the current patch under review. I plan to work on integrating the instancing support after the current patch has been merged into master, and I will try to make a temporary branch available with instancing support for testing sometime in the next few weeks.
@makowalski Great work so far. Cant wait to load test the instance feature.
@gopi.vfx Thank you so much. I will post an update here when the build with instancing support is available.
Added subscriber: @kevinzhow
Added subscriber: @mr.marcodivita
I imported the Playdate game console USDZ (unzipped it first; used the experimental USD preview option). When switching to Cycles and to Render Preview I noticed the whole thing turned purple. This of course implied missing textures. A little experimenting showed all materials had a faulty node setup connected to the Emission node of the Principled BSDF. When I disconnected it the model had its original colors again.
Did I stumble upon a bug? Or am I holding it wrong? ;-)
@Zandman Hi Leon. Thank you for reporting this! I looked at that USD and it turns out that some of the UsdUVTexture shaders don't have file inputs specified. The material reader prints warnings about this in the Blender console, e.g.,
Inspecting the USD confirms that the file inputs are missing. For example:
The USD importer still creates Image Texture nodes for these shaders, but with empty file paths, hence the missing texture color. I'm not sure why the waning color goes away after disconnecting and reconnecting those nodes.
Again, thank you for testing, and I always welcome your feedback!
Incidentally, as I mentioned before, I'm working on some additional bug fixes and improvements to the UsdPreviewSurface translation code. For example, the code currently creates redundant UV Map nodes, instead of sharing a single UV Map instance, and the texture inputs aren't always handled correctly (e.g., the code fails to create Separate RGB nodes to split out the channels). These improvements are coming soon.
Does that mean the Playdate USD itself contains errors (so it's not a Blender import error)? And why does this only show up when using Cycles? The original file displays just fine in EVEE.
I didn't reconnect the nodes. I just disconnected the Emission nodes and it looked fine. I don't even understand what the Emission nodes would add. That would mean all those materials should emit light, right?
@Zandman Hi Leon. The
emissive_map
andnormal_map
UsdUVTexture
shaders are definitely in the USD and these shaders are connected to theemmissiveColor
andnormal
inputs of theUsdPreviewSurface
shader, respectively. But theemissive_map
andnormal_map
shaders are missing thefile
inputs, so they are not well formed, in that sense.I'm not sure why Evee doesn't generate the same error, but I don't think this is a bug in the USD importer. I think one could argue that the missing inputs should be handled differently in the importer, and this is open to discussion. But please let me know if I'm missing something. Thanks!
Added subscriber: @brecht
Unfortunately I have nothing to add to this as I don't know anything about this. I just regularly have the need for importing USD(Z)s and your project came along at the right time :-) I just find it strange that the EVEE and Cycles output differ that much. But maybe that's perfectly logical. Maybe rendering engine guru @brecht knows why this is.
Added subscriber: @aplus
Changed status from 'Confirmed' to: 'Resolved'
Since the initial USD importer has been added to Blender, I suggest to close his task and create further tasks based on the list at https://developer.blender.org/tag/usd/.
I was going to check the status of this to see whether this is now part of the latest 3.0 releases - Since I could not leave a comment on the usd task page I adding one here just in case
so I just checked the https://developer.blender.org/tag/usd/ page,
it is not clear what the status is on the import of usd files with UDIM textures (did not see import of Udims it listed in tasks)
As far as I can tell the feature isn't working yet in the blender 3.0 version I downloaded blender-3.0.0-alpha+master.53af51ad50ec-linux.x86_64-release/blender
Blender 3.0.0 Alpha
build date: 2021-10-12
build time: 23:43:06
build commit date: 2021-10-12
build commit time: 22:43
Hi Alain. I have a fix for this issue but have not yet created a patch for the changes. I'll follow up to get this done.
Added subscriber: @brurpo
Hi! Thanks a lot for the work!
When exporting USD from maya to blender none of the textures comes with the correct color space, they are all srgb.
Importing on maya again, on a clean scene, does not have this issue, all textures are loaded with the correct color space.
Is there a workaround for this, or is this planned?
Thanks!
Hi @brurpo . Thanks for reporting this! The importer does have logic for setting the color space on the textures, so I'd like to see what is failing. If it's not too much trouble, could you provide me with an example asset (USD/textures) that reproduces the issue? I'd very much like to debug and fix the problem. Thanks!
Hi @makowalski !! Absolutelly! Would you like the usd to be binary or ASCII?
Hey @makowalski ! Here is a drive link
https://drive.google.com/file/d/1_A0ToOwqLMqVslG374xWoaNFr_LrFSB-/view?usp=sharing
Ive included both usd versions and the textures. If you are on windows, you can extract it to the root of c: and all files will be on the correct path.
If you want the maya file, let me know, but it does not export correctly the materials and textures by default, Ive made a tool to do this. If you want, I can send you both the maya file and the tool.
Cheers!
Please do not use this as a general discussion board. New messages will go to everybody who's subscribed to this task.
My apologies, Sybren. For anyone interested, since this requires following up as a possible bug or feature request for the USD importer, I created a new task for this, which I've assigned to myself:
https://developer.blender.org/T93904
and we can continue the discussion there.