USD: add export option that adds a Root 'Xform' node #104506

Closed
Ashley wants to merge 3 commits from expenses/blender:usd-root-node into main

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

This is a feature that's mentioned on the old USD project page: https://web.archive.org/web/20220718104224/https://developer.blender.org/tag/usd/. It's also especially useful for me as it makes it easy to sublayer Z-up blender-exported scenes in a Y-up scene. This can be done like this:

#usda 1.0
(
    upAxis = "Y"
    subLayers = [
        @blender.usda@,
    ]
)

over "Root" {
    double3 xformOp:rotateXYZ = (-90.0, 0, 0)

    uniform token[] xformOpOrder = ["xformOp:rotateXYZ"]
}

I initially used a 'Scope' for this but as they can't have transforms, I switched to an 'Xform'.

This is a feature that's mentioned on the old USD project page: https://web.archive.org/web/20220718104224/https://developer.blender.org/tag/usd/. It's also especially useful for me as it makes it easy to sublayer Z-up blender-exported scenes in a Y-up scene. This can be done like this: ``` #usda 1.0 ( upAxis = "Y" subLayers = [ @blender.usda@, ] ) over "Root" { double3 xformOp:rotateXYZ = (-90.0, 0, 0) uniform token[] xformOpOrder = ["xformOp:rotateXYZ"] } ``` I initially used a 'Scope' for this but as they can't have transforms, I switched to an 'Xform'.
Ashley added 2 commits 2023-02-09 12:33:39 +01:00
Brecht Van Lommel changed title from [USD Export] Add an option that adds a Root 'Xform' node to USD: add export option that adds a Root 'Xform' node 2023-02-09 12:41:15 +01:00
Brecht Van Lommel requested changes 2023-02-09 14:53:23 +01:00
@ -337,0 +342,4 @@
"add_root",
false,
"Add Root",
"Add a Root 'Scope' node to the stage.");

I think this would be more clear:

root_transform
Root Transform
Add root transform used to transform all primitives in the stage
I think this would be more clear: ``` root_transform Root Transform Add root transform used to transform all primitives in the stage ```
Author
Contributor

I'm not sure that this would be an accurate description, as the node is just grouping all the other nodes, not changing their transformations.

I'm not sure that this would be an accurate description, as the node is just grouping all the other nodes, not changing their transformations.

It's not changing the transform, but as I understand it, the purpose is that it can then be used later on somewhere to transform the primitives? If so, perhaps:

Add root transform to the stage, that can be used in other applications to transform all primitives in the stage
It's not changing the transform, but as I understand it, the purpose is that it can then be used later on somewhere to transform the primitives? If so, perhaps: ``` Add root transform to the stage, that can be used in other applications to transform all primitives in the stage ```

Any reason not to use root_transform, Root Transform, and the more detailed that can be used in other applications to transform all primitives in the stage description?

Many things in USD files are nodes, I don't think it's necessary to put that in the name of the option.

Any reason not to use `root_transform`, `Root Transform`, and the more detailed `that can be used in other applications to transform all primitives in the stage` description? Many things in USD files are nodes, I don't think it's necessary to put that in the name of the option.
Author
Contributor

Yep, you're probably right.

Yep, you're probably right.
Ashley added 1 commit 2023-02-09 15:40:39 +01:00
Ashley requested review from Brecht Van Lommel 2023-02-09 15:58:25 +01:00
Brecht Van Lommel requested changes 2023-02-09 16:30:10 +01:00
Brecht Van Lommel left a comment
Owner

Marking as request changes.

Marking as request changes.
Bastien Montagne added the
Interest
USD
Module
Core
labels 2023-02-09 18:23:19 +01:00
Bastien Montagne added this to the USD project 2023-02-09 18:24:00 +01:00
Bastien Montagne added
Module
Pipeline, Assets & IO
and removed
Module
Core
labels 2023-02-10 12:20:36 +01:00
Author
Contributor

Since making this PR I realised that there is a USD dev branch which commits are first made on: https://projects.blender.org/blender/blender/src/branch/universal-scene-description. This branch already contains a similar export option, so it would be better to port that from the branch to main. I'm currently testing out the dev branch so this PR is on hold for now.

Since making this PR I realised that there is a USD dev branch which commits are first made on: https://projects.blender.org/blender/blender/src/branch/universal-scene-description. This branch already contains a similar export option, so it would be better to port that from the branch to `main`. I'm currently testing out the dev branch so this PR is on hold for now.

Since making this PR I realised that there is a USD dev branch which commits are first made on: https://projects.blender.org/blender/blender/src/branch/universal-scene-description. This branch already contains a similar export option, so it would be better to port that from the branch to main.

@expenses As you've noted, the work in this PR overlaps with similar functionality already implemented in the universal-scene-description branch. The work you've done here is excellent, but it's missing a couple of features in that branch, namely:

  • The /_materials namespace containing exported materials should be created under the root prim as well. This is important for material assignment to work when the USD is referenced.

  • It's very useful to allow the user to specify a custom path for the root prim, rather than hard coding the name to Root.

I think it would be great to include this for Blender 3.6, if possible, but the deadline for doing so is in about a week (May 17).

Have you had a chance to work on this PR any further? If not, I'd be more than happy help out to build on top of what you have here to add the above features, perhaps in a new PR. I should be able to do this quite quickly, as I'm very familiar with the existing code in the universal-scene-description branch. You would be fully acknowledged as a contributor, of course.

Please let me know if you'd like me to do this. Thanks!

> Since making this PR I realised that there is a USD dev branch which commits are first made on: https://projects.blender.org/blender/blender/src/branch/universal-scene-description. This branch already contains a similar export option, so it would be better to port that from the branch to `main`. @expenses As you've noted, the work in this PR overlaps with similar functionality already implemented in the `universal-scene-description` branch. The work you've done here is excellent, but it's missing a couple of features in that branch, namely: - The `/_materials` namespace containing exported materials should be created under the root prim as well. This is important for material assignment to work when the USD is referenced. - It's very useful to allow the user to specify a custom path for the root prim, rather than hard coding the name to `Root`. I think it would be great to include this for Blender 3.6, if possible, but the deadline for doing so is in about a week (May 17). Have you had a chance to work on this PR any further? If not, I'd be more than happy help out to build on top of what you have here to add the above features, perhaps in a new PR. I should be able to do this quite quickly, as I'm very familiar with the existing code in the `universal-scene-description` branch. You would be fully acknowledged as a contributor, of course. Please let me know if you'd like me to do this. Thanks!

@expenses Per my comments above, I created this pull request to combine your work with what was done in the universal-scene-description branch: #107855

I hope this is okay, and I very much welcome your feedback on this extended implementation.

@expenses Per my comments above, I created this pull request to combine your work with what was done in the `universal-scene-description` branch: https://projects.blender.org/blender/blender/pulls/107855 I hope this is okay, and I very much welcome your feedback on this extended implementation.

Changes for #107855 committed in 42342124f8.

Changes for https://projects.blender.org/blender/blender/pulls/107855 committed in https://projects.blender.org/blender/blender/commit/42342124f8d6c28d69ddd8ce1c363f7961ff11aa.

I think this can be closed then.

I think this can be closed then.
Howard Trickey referenced this issue from a commit 2023-05-29 02:51:39 +02:00
Bastien Montagne removed this from the USD project 2023-08-25 23:52:13 +02:00

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
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#104506
No description provided.