USD: export to a single root prim by default #113187

Closed
Michael B Johnson wants to merge 8 commits from wave/blender_wave_Apple:single_root_io into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

This PR adds the following changes:

  • A single root is always set as default. After talking to Wave and Spiff, we settled on root being the best default. Users who don't want a single root prim inserted, can choose to clear the field
  • The root prim no longer requires the user to prefix the field with /. It will implicitly insert that for them.
  • On export, the root_prim hierarchy is now defined all as Xform instead of just the final prim in the path. Each prim also has custom metadata added to show that it was generated by Blender. This follows convention in other DCCs as well.
  • On import, the code now finds the hierarchy of generated prims using that metadata. It then skips importing them. This means that you can roundtrip hierarchies even with an inserted root.
This PR adds the following changes: - A single root is always set as default. After talking to Wave and Spiff, we settled on root being the best default. Users who don't want a single root prim inserted, can choose to clear the field - The root prim no longer requires the user to prefix the field with /. It will implicitly insert that for them. - On export, the root_prim hierarchy is now defined all as Xform instead of just the final prim in the path. Each prim also has custom metadata added to show that it was generated by Blender. This follows convention in other DCCs as well. - On import, the code now finds the hierarchy of generated prims using that metadata. It then skips importing them. This means that you can roundtrip hierarchies even with an inserted root.
Michael B Johnson added 6 commits 2023-10-03 06:22:53 +02:00
Matt McLin added this to the USD project 2023-10-05 02:06:33 +02:00
Matt McLin changed title from single_root_io to USD: export to a single root prim by default 2023-10-05 02:07:27 +02:00
Michael Kowalski was assigned by Matt McLin 2023-10-05 02:07:43 +02:00
Matt McLin added the
Interest
USD
Interest
Pipeline, Assets & IO
labels 2023-10-05 02:10:57 +02:00
Matt McLin requested review from Michael Kowalski 2023-10-05 02:13:00 +02:00
Michael Kowalski was unassigned by Matt McLin 2023-10-05 02:13:04 +02:00

I'm currently reviewing this. Sorry for the delay.

I'm currently reviewing this. Sorry for the delay.
Michael Kowalski reviewed 2023-10-13 23:16:36 +02:00
@ -372,3 +379,3 @@
RNA_def_string(ot->srna,
"root_prim_path",
nullptr,
"root",

Maybe the default string should be "/root", so we don't have to prepend the leading slash each time?

Maybe the default string should be "/root", so we don't have to prepend the leading slash each time?
First-time contributor

Changed! Thanks for that note

Changed! Thanks for that note

If you don't mind, can you please run 'make format' to fix the formatting, please?

Otherwise, apart from the minor comment regarding adding a leading slash to the default root path, this looks good!

If you don't mind, can you please run 'make format' to fix the formatting, please? Otherwise, apart from the minor comment regarding adding a leading slash to the default root path, this looks good!
Michael B Johnson added 1 commit 2023-10-16 20:10:15 +02:00
Michael B Johnson added 1 commit 2023-10-16 20:12:03 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
1423f77920
Address notes on default root prim value
First-time contributor

If you don't mind, can you please run 'make format' to fix the formatting, please?

@makowalski Done. Thanks for catching that!

> If you don't mind, can you please run 'make format' to fix the formatting, please? @makowalski Done. Thanks for catching that!

@blender-bot build

@blender-bot build
Michael Kowalski approved these changes 2023-10-19 16:47:40 +02:00
Michael Kowalski left a comment
Member

Thanks for the updates! The changes look good!

Thanks for the updates! The changes look good!

I merged this manually in order to fix a conflict and am closing this PR.

I merged this manually in order to fix a conflict and am closing this PR.
Michael Kowalski closed this pull request 2023-10-20 17:00:14 +02:00

Reminder to use BLI_snprintf which ensures null termination instead of snprintf, committed fix to main.

Reminder to use `BLI_snprintf` which ensures null termination instead of `snprintf`, committed fix to `main`.
Bastien Montagne removed this from the USD project 2023-11-02 16:14:21 +01:00
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.

Pull request closed

Sign in to join this conversation.
No reviewers
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
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
4 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#113187
No description provided.