USD: custom properties export improvements #124067
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#124067
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "makowalski/blender:usd-export-props-namespace"
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 a new custom_properties_namespace USD export option, to
allow replacing or omitting the current default "userProperties"
namespace prefix.
Note that this option does not apply to names that already have a prefix
(e.g., it would apply to name 'bar' but not 'foo:bar'). It also does not apply
to the internal Blender "object_name" and "data_name" properties which
always have the prefix "userProperties:blender".
Also added logic to handle ':' namespace delimiters in property names.
This introduces some asymmetry with Import. Given an object with custom property "prop", if you export as
userProperties:prop
then on Import this will just be read back in asprop
- as expected. With this PR, if you export ascustomNs:prop
then on Import this will now be listed ascustomNs:prop
. Basically the Importer treats theuserProperties
namespace as special as well.@ -273,6 +273,9 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "root_prim_path", root_prim_path);
process_prim_path(root_prim_path);
char custom_properties_namespace[FILE_MAX];
Better to use MAX_IDPROP_NAME here too I think.
Yes, I see what you mean. However, without this PR, there is currently an asymmetry with export. I.e., if the original USD coming from some other DCC had a namespace
customNs:prop
then it would always be exported asuserProperties:customNs:prop
which is not usually what the user wants. With the current PR the user at least has the option to keep the original namespace by clearing thecustom_properties_namespace
option.In my opinion, the asymmetry introduced by this PR is less of an issue than the original one. But am open to discussing this, of course.
Hmm, if a blender property is currently called "customNs:prop" then it will become "customNs_prop" during export since invalid USD identifier characters are turned to underscores. I suppose this also exists in main too, so either way the user is kind of stuck if they want to round-trip. Maybe we need to adjust the processing of these properties on export further to treat all ':' as namespaces and leave them unchanged when writing out?
Ah, good point! I apologize, I made hasty assumptions about the behavior by looking at the high level code.
Handling the nested namespaces should be an easy fix and I think will improve the implementation anyway. I'll make the fix now.
USD export: custom properties namespace optionto USD: custom properties export improvements@deadpin I updated the logic to handle ':' delimiters in the name. Also, per the updated description, the default namespace is no longer applied if the property already has a namespace prefix.
This is really nice now, and makes the behavior more intuitive and flexible! Thanks for taking the time and adjusting things here.