Explorar el Código

USDZExporter: Allow to pass {includeAnchoringProperties: false} as options to anchor on wall or floor (#28363)

Vincent Fretin hace 1 año
padre
commit
ce4536ab00
Se han modificado 1 ficheros con 6 adiciones y 4 borrados
  1. 6 4
      examples/jsm/exporters/USDZExporter.js

+ 6 - 4
examples/jsm/exporters/USDZExporter.js

@@ -25,6 +25,7 @@ class USDZExporter {
 				anchoring: { type: 'plane' },
 				anchoring: { type: 'plane' },
 				planeAnchoring: { alignment: 'horizontal' }
 				planeAnchoring: { alignment: 'horizontal' }
 			},
 			},
+			includeAnchoringProperties: true,
 			quickLookCompatible: false,
 			quickLookCompatible: false,
 			maxTextureSize: 1024,
 			maxTextureSize: 1024,
 		}, options );
 		}, options );
@@ -198,6 +199,10 @@ function buildHeader() {
 
 
 function buildSceneStart( options ) {
 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"
 	return `def Xform "Root"
 {
 {
 	def Scope "Scenes" (
 	def Scope "Scenes" (
@@ -211,10 +216,7 @@ function buildSceneStart( options ) {
 			}
 			}
 			sceneName = "Scene"
 			sceneName = "Scene"
 		)
 		)
-		{
-		token preliminary:anchoring:type = "${options.ar.anchoring.type}"
-		token preliminary:planeAnchoring:alignment = "${options.ar.planeAnchoring.alignment}"
-
+		{${alignment}
 `;
 `;
 
 
 }
 }