Skip to content

Commit

Permalink
USDZExporter: Allow to pass {includeAnchoringProperties: false} as op…
Browse files Browse the repository at this point in the history
…tions to anchor on wall or floor
  • Loading branch information
vincentfretin committed May 15, 2024
1 parent eea543b commit c001513
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/jsm/exporters/USDZExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class USDZExporter {
anchoring: { type: 'plane' },
planeAnchoring: { alignment: 'horizontal' }
},
includeAnchoringProperties: true,
quickLookCompatible: false,
maxTextureSize: 1024,
}, options );
Expand Down Expand Up @@ -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}"
` : '';
return `def Xform "Root"
{
def Scope "Scenes" (
Expand All @@ -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}
`;

}
Expand Down

0 comments on commit c001513

Please sign in to comment.