浏览代码

Merge pull request #4774 from RaananW/3dprint-fix

Small fixes for 3D object printing
David Catuhe 7 年之前
父节点
当前提交
b7345ac92a

+ 25 - 0
Viewer/dist/printExample.html

@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+
+    <head>
+        <meta charset="UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <meta http-equiv="X-UA-Compatible" content="ie=edge">
+        <title>BabylonJS Viewer - 3D Print usage</title>
+        <style>
+            babylon {
+                width: 800px;
+                height: 500px;
+            }
+        </style>
+    </head>
+
+    <body>
+        <babylon templates.nav-bar.params.hide-print="false">
+            <model url="https://playground.babylonjs.com/scenes/BoomBox.glb">
+            </model>
+        </babylon>
+        <script src="viewer.js"></script>
+    </body>
+
+</html>

+ 1 - 1
Viewer/src/configuration/types/default.ts

@@ -58,7 +58,7 @@ export let defaultConfiguration: ViewerConfiguration = {
                     fullscreenButton: "Toggle Fullscreen",
                     helpButton: "Help",
                     vrButton: "Toggle VR",
-                    printButton: "Print model in 3D"
+                    printButton: "3D Print Object"
                 }
             },
             events: {

+ 3 - 3
Viewer/src/templating/plugins/printButton.ts

@@ -34,8 +34,8 @@ export class PrintButtonPlugin extends AbstractViewerNavbarButton {
 
     onEvent(event: EventCallback): void {
         if (this._currentModelUrl) {
-            let printUrl = this._currentModelUrl.replace(/https?:\/\//, "com.microsoft.print3d://");
-            window.open(printUrl);
+            let printUrl = this._currentModelUrl.replace(/https?:\/\//, "com.microsoft.builder3d://");
+            window.open(printUrl, "_self");
         }
     }
 
@@ -59,4 +59,4 @@ export class PrintButtonPlugin extends AbstractViewerNavbarButton {
  </button>
  {{/unless}}
 `;
-}
+}