USD: basic support for on_import USD hooks #117822
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#117822
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "makowalski/blender:usd-import-hooks"
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?
Added support for defining an on_import() function in
bpy.types.USDHook subclasses. If on_import() is defined
on a given USD hook, it will be invoked in import_endjob().
The implementation closely follows the existing design of
export hooks. USDHook.on_import() takes as an argument
an instance of an internally defined USDSceneImportContext
class which provides an accessor to the USD stage.
Also updated the USDHook documentation with an example
on_import() callback implementation.
Testing
The attached
usd_hook
add-on provides a basic (somewhatcontrived) example of an
on_import()
implementation whichcreates a Text object in the scene to display the root layer
custom data. Examples of USDZ files with custom data can
be found on the quick-look page.
@blender-bot build
@Matt-McLin for visibility.
@brecht @deadpin I know there are only a couple of days left in Bcon2, but this is a relatively small, localized patch and hopefully can be included in 4.1. However, I would understand if you feel there is insufficient time to review this.
I'm fine with this going in for 4.1. It seems to work as advertised and the only comments I have pre-date this patch to when hooks were initially added.
You are correct. The intent was to future-proof hook implementations to allow for use cases when the return value could matter as the USD hook API evolves. The return value could be helpful for recognizing when the hook function is a no-op so that the IO code can provide fallback behavior (e.g., if a user-specified material conversion hook does nothing, the USD import code could still convert the standard USD Preview Surface material by default). But this is something we can certainly discuss.
Thanks so much for the reviews!