USD Import: prim_path_mask does not use or behave like USDStage.OpenMasked #102594

Closed
opened 2022-11-18 02:20:00 +01:00 by Jens Jebens · 7 comments

System Information
Operating system: any
Graphics card: any

Blender Version
Broken: 3.4.0 Alpha)

Apologies if this should not be logged as a bug, but it feels like one.
Opening stages with a population mask is a powerful feature to handle large stages with USD. It's great that blenders' import USD method supports a prim_path_mask, but unfortunately this seems to be limited to a single prim (path). The UsdStage.OpenMasked on the other hand supports a list paths via USD's population mask class.
Additionally, the prim_path_mask causes the prim to be imported at the root of the hierarchy, whilst UsdStage.OpenMasked preserves the SdfPath.

It would be great if this could be implemented by setting the population mask on the stage before it is opened rather than fixing the existing GetPrimAtPath based method here:
https://github.com/blender/blender/blob/master/source/blender/io/usd/intern/usd_reader_stage.cc#L283

Exact steps for others to reproduce the error
Download the Animal Logic Alab

This "works"

bpy.ops.wm.usd_import(filepath="C:\Users\jjebens\Downloads\alab-v2.0.0\ALab\entity\electronics_portable_tv01\electronics_portable_tv01.usda", prim_path_mask="/root/GEO/handle01_M_geo")

This should work, but doesn't

bpy.ops.wm.usd_import(filepath="C:\Users\jjebens\Downloads\alab-v2.0.0\ALab\entity\electronics_portable_tv01\electronics_portable_tv01.usda", prim_path_mask=["/root/GEO/handle01_M_geo", "/root/GEO/dial01_M_geo"])

**System Information** Operating system: any Graphics card: any **Blender Version** Broken: 3.4.0 Alpha) Apologies if this should not be logged as a bug, but it *feels* like one. Opening stages with a population mask is a powerful feature to handle large stages with USD. It's great that blenders' import USD method supports a prim_path_mask, but unfortunately this seems to be limited to a single prim (path). The UsdStage.OpenMasked on the other hand supports a list paths via USD's population mask class. Additionally, the prim_path_mask causes the prim to be imported at the root of the hierarchy, whilst UsdStage.OpenMasked preserves the SdfPath. It would be great if this could be implemented by setting the population mask on the stage before it is opened rather than fixing the existing GetPrimAtPath based method here: https://github.com/blender/blender/blob/master/source/blender/io/usd/intern/usd_reader_stage.cc#L283 **Exact steps for others to reproduce the error** Download the Animal Logic Alab ### This "works" bpy.ops.wm.usd_import(filepath="C:\\Users\\jjebens\\Downloads\\alab-v2.0.0\\ALab\\entity\\electronics_portable_tv01\\electronics_portable_tv01.usda", prim_path_mask="/root/GEO/handle01_M_geo") ### This should work, but doesn't bpy.ops.wm.usd_import(filepath="C:\\Users\\jjebens\\Downloads\\alab-v2.0.0\\ALab\\entity\\electronics_portable_tv01\\electronics_portable_tv01.usda", prim_path_mask=["/root/GEO/handle01_M_geo", "/root/GEO/dial01_M_geo"])
Author

Added subscriber: @jjebens

Added subscriber: @jjebens
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

It is possible that not having more than one path is a limitation of the API, as Blender doesn't support string array as far as I know.
Though I am not knowledgeable enough about USD to triage the other concern about preserving the SdfPath, so I will tag the module fore more information.

It is possible that not having more than one path is a limitation of the API, as Blender doesn't support string array as far as I know. Though I am not knowledgeable enough about USD to triage the other concern about preserving the SdfPath, so I will tag the module fore more information.
Bastien Montagne added this to the Pipeline, Assets & IO project 2023-02-09 15:39:30 +01:00
Philipp Oeser removed the
Interest
Pipeline, Assets & IO
label 2023-02-10 08:53:59 +01:00
Michael Kowalski self-assigned this 2023-04-14 19:18:35 +02:00

This is actually already implemented for Blender's universal-scene-description branch. I am working on creating a pull request to merge this feature into main. This is one of the relevant commits that I am porting to main:

90f1d1f4b6

This is actually already implemented for Blender's `universal-scene-description` branch. I am working on creating a pull request to merge this feature into `main`. This is one of the relevant commits that I am porting to `main`: https://projects.blender.org/blender/blender/commit/90f1d1f4b665fff57da774ced961fadd5424e0db

As for supporting multiple file paths, this will be accomplished by allowing the prim_path_mask option to contain multiple entries delimited by spaces, commas or semicolons.

As for supporting multiple file paths, this will be accomplished by allowing the `prim_path_mask` option to contain multiple entries delimited by spaces, commas or semicolons.

I created a pull request for this feature here:

#106974

I created a pull request for this feature here: https://projects.blender.org/blender/blender/pulls/106974
Michael Kowalski added
Status
Confirmed
and removed
Status
Needs Info from Developers
labels 2023-04-17 18:16:59 +02:00
Michael Kowalski modified the project from Pipeline, Assets & IO to USD 2023-04-17 18:18:51 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-04-25 16:33:00 +02:00
Bastien Montagne removed this from the USD project 2023-08-25 23:52:53 +02:00
Sign in to join this conversation.
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
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#102594
No description provided.