USD: fix various import problems with the Alab V2 scene #104515
No reviewers
Labels
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
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
Overlay
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
Interest
Workbench
Interest: X11
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
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#104515
Loading…
Reference in New Issue
No description provided.
Delete Branch "expenses/blender:usd-alab-import-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See #100452.
MA_BM_HASHED
seems to work a lot better as a blend method thanMA_BM_BLEND
.perfuv
primvar is read for UVs as well asst
. This is based on https://usd-alab2.s3.amazonaws.com/documentation.html#display-purpose-render.float inputs:opacity.connect = </root/backpack_M_hrc/MATERIAL/usd_full/full_opacity_texture.outputs:r>
use a Seperate RGB node.Fix various problems with the Alab V2 USD Sceneto [USD Import] Fix various problems with the Alab V2 USD Scene[USD Import] Fix various problems with the Alab V2 USD Sceneto USD: fix various import problems with the Alab V2 scene@ -642,3 +642,3 @@
std::string source_socket_name = usd_source_name == usdtokens::a ? "Alpha" : "Color";
link_nodes(ntree, tex_image, source_socket_name.c_str(), dest_node, dest_socket_name);
if (usd_source_name == usdtokens::r) {
Can it also happen that the g or b channel is used? And if so, can we generalize this?
USD is so adaptable that any token is possible here. In practice I think
:r
is the most likely situation here and that anything else is going to happen rarely.Still might be worth supporting g and b as well?
For game engines channel packing textures is common, where you pack multiple single channel textures into one RGB textures.
@ -805,3 +806,3 @@
}
/* In some cases, the st primvar is stored as float2 values. */
else if (name == usdtokens::st && type == pxr::SdfValueTypeNames->Float2Array) {
else if ((name == usdtokens::st || name == usdtokens::perfuv) && type == pxr::SdfValueTypeNames->Float2Array) {
There's no simple way in Blender to have a final and preview UV (besides creating two entirely separate shader node graphs and material outputs), so supporting
perfuv
for when there is nost
seems fine.However I think this should ensure
usdtokens::st
is the default UV map in case both are specified?As only the preview .jpg textures are loaded by default, having
perfuv
be the default makes sense. If you click 'Import All Materials' during import, it'll load the UDIMs which thest
UVs match (although they still don't seem to render correctly, perhaps related to #101320).Ah, then it can take the "Import All Materials" setting into account to set the appropriate default UV map?
Ah, okay what needs to happen is that
usd_preview
materials needs to explicitly use theperfuv
UV map (if set) andusd_full
materials needs to explicitly usest
(if set).Done in
ae08032f71
.Do you know if
perfuv
is a common naming convention for USD? I haven't seen this convention before, but maybe it's used more widely than I'm aware. I would argue that if this name is specific to the Alab scene conventions, then we shouldn't hard code a check for it. But I'm definitely open to your opinion about this.The crux of the issue is that
perfuv
is represented as afloat2
rather than the more correcttexCoord2f
type. If it were atexCoord*
type, there would be no ambiguity and the current logic would handle it. I've occasionally encountered other examples where texture coordinates are represented asfloat2
but don't follow either thest
orperfuv
naming conventions, so perhaps this is an issue we should try to handle more generally.I'm not sure of the best way to handle this. One strategy could be to broadly assume that any
float2
primvar is a texture coordinate. That could result in false positives, of course, but maybe this is acceptable.I'll bring up this question on the pipeline-asset-io chat, to start the conversation.
Thank you for this work, @expenses!
As a general comment, this overlaps with some of the issues I originally outlined in this task:
https://archive.blender.org/developer/T100452
I pushed some initial fixes (some of which are similar to yours) to this temporary branch:
https://projects.blender.org/blender/blender/src/branch/tmp-usd-alab-v2-T100452
Unfortunately, I had put that work on hold for a while, due to other priorities, and had been meaning to pick it up again recently, so your submission is very timely. It's a good opportunity to discuss some of these issues further.
I will have additional comments and questions about this PR tomorrow.
@makowalski Ah great! I've merged in your changes if that's okay, because the few that didn't overlap looked good.
Hi, sorry for not following through with this. I'm going to close this PR as I believe that most if not all these changes are in the
universal-scene-description
branch and that I'm not knowledgeable enough to try and bring the changes from there intomain
.Pull request closed