USD export: option to add a root prim. #107855
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#107855
Loading…
Reference in New Issue
No description provided.
Delete Branch "makowalski/blender:usd-root-prim"
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?
This update combines work in pull request #104506 by @expenses and an implementation in the 'universal-scene-description' branch.
This pull request adds a
root_prim_path
USD export string parameter. If this option is set to a well-formed prim path (e.g., '/World'), a transform primitive with the given path will be added to the stage as the parent of all exported primitives. This will allow transforming the scene by this root node in other applications and is also required for loading the exported scene as a reference in other USDs.As part of this change, the
_materials
node, which contains all exported materials, is also created under the root prim. This is required so that materials are imported correctly when the USD is referenced in another stage.Finally, added an
export_params_valid()
function to verify that theroot_prim_path
is valid before starting the export job. This function can be extended in the future to perform additional validation of other export parameters.Contributor: Ashley Ruglys (expenses)
This looks good to me, thanks! Just a minor consideration about the error reporting and question to @brecht about
RNA_string_get
.@ -140,1 +155,4 @@
char root_prim_path[FILE_MAX];
RNA_string_get(op->ptr, "root_prim_path", root_prim_path);
process_prim_path(root_prim_path);
I see this is same convention used everywhere else, so not a problem for this PR, but just a question: it seems
RNA_string_get
doesn't concern itself with potential buffer overflow or null termination (which could impact thestrlen
operation inprocess_prim_path
, among other things). Is this somehow handled in a clever way that I'm missing?The
RNA_def_string
for this property sets the maximum length toFILE_MAX
, so this is ok.@ -67,0 +111,4 @@
bool valid = true;
if (!prim_path_valid(params.root_prim_path)) {
WM_reportf(RPT_ERROR, "USD Export: Root Prim option is invalid");
I wonder if it might be better to remove this
WM_reportf
? If every failure path inprim_path_valid
already reports an error, then this seems superfluous, and also the error reported fromprim_path_valid
provides more explicit guidance to the user about the problem.I agree and will remove the report statement. Thanks very much for the review!
@blender-bot build
@blender-bot build
Thanks for the review, @brecht.