From ccde13acd925330a3dd41c5b7a4fb789c7167040 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Sun, 27 Apr 2014 00:00:10 -0300 Subject: [PATCH] Arch: allow to set a custom camera position in webgl export --- src/Mod/Arch/importWebGL.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/Arch/importWebGL.py b/src/Mod/Arch/importWebGL.py index 3222da164..62f86e372 100644 --- a/src/Mod/Arch/importWebGL.py +++ b/src/Mod/Arch/importWebGL.py @@ -37,6 +37,7 @@ else: tab = " " # the tab size wireframeStyle = "faceloop" # this can be "faceloop", "multimaterial" or None +cameraPosition = None # set this to a tuple to change, for ex. (0,0,0) template = """ @@ -129,7 +130,9 @@ def getCameraData(): "returns the position and direction of the camera as three.js snippet" result = "" - if FreeCADGui: + if cameraPosition: + result += "camera.position.set("+str(cameraPosition[0])+","+str(cameraPosition[1])+","+str(cameraPosition[2])+");\n" + elif FreeCADGui: # getting camera position pos = FreeCADGui.ActiveDocument.ActiveView.viewPosition().Base result += "camera.position.set( "