-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USDZExporter: Make including anchoring properties optional. #28363
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ class USDZExporter { | |
anchoring: { type: 'plane' }, | ||
planeAnchoring: { alignment: 'horizontal' } | ||
}, | ||
includeAnchoringProperties: true, | ||
quickLookCompatible: false, | ||
maxTextureSize: 1024, | ||
}, options ); | ||
|
@@ -198,6 +199,10 @@ function buildHeader() { | |
|
||
function buildSceneStart( options ) { | ||
|
||
const alignment = options.includeAnchoringProperties === true ? ` | ||
token preliminary:anchoring:type = "${options.ar.anchoring.type}" | ||
token preliminary:planeAnchoring:alignment = "${options.ar.planeAnchoring.alignment}" | ||
` : ''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is already the const alignment = options.quickLookCompatible === false ? `
token preliminary:anchoring:type = "${options.ar.anchoring.type}"
token preliminary:planeAnchoring:alignment = "${options.ar.planeAnchoring.alignment}"
` : ''; If there are use cases where you want to use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we can use the existing quickLookCompatible here. You may want quickLookCompatible=true for the material fix but still want the anchoring to be floor (alignment horizontal) only. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I'll make the changes tomorrow. With There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok that's done. I also retested my model-viewer build with it. |
||
return `def Xform "Root" | ||
{ | ||
def Scope "Scenes" ( | ||
|
@@ -211,10 +216,7 @@ function buildSceneStart( options ) { | |
} | ||
sceneName = "Scene" | ||
) | ||
{ | ||
token preliminary:anchoring:type = "${options.ar.anchoring.type}" | ||
token preliminary:planeAnchoring:alignment = "${options.ar.planeAnchoring.alignment}" | ||
|
||
{${alignment} | ||
`; | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we set this to
false
by default?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for most models, you want it to be anchored to the floor. Having a model snap to the wall may be confusing if it was not intended, so having it true by default make sense to me. Having the model snap to the wall should be explicitly stated in my opinion. For model-viewer tag, default is ar-placement="floor", and you can change it to ar-placement="wall" (working currently for Android WebXR). For iOS using a-placement="wall" will set includeAnchoringProperties=false in a future PR I'll do once r165 is released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍