From f5c57ed30dd20e089b88f579f546efaee1150004 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Wed, 15 Jul 2020 16:27:51 +0200 Subject: [PATCH] Arch: Small optimizations in OfflineRenderingUtils module --- src/Mod/Arch/OfflineRenderingUtils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Mod/Arch/OfflineRenderingUtils.py b/src/Mod/Arch/OfflineRenderingUtils.py index f258a71eee..e6c1c08c4b 100755 --- a/src/Mod/Arch/OfflineRenderingUtils.py +++ b/src/Mod/Arch/OfflineRenderingUtils.py @@ -365,8 +365,8 @@ def render(outputfile,scene=None,camera=None,zoom=False,width=400,height=300,bac # create a default camera if none was given camera = coin.SoPerspectiveCamera() cameraRotation = coin.SbRotation.identity() - cameraRotation *= coin.SbRotation(coin.SbVec3f(1,0,0),-0.4) - cameraRotation *= coin.SbRotation(coin.SbVec3f(0,1,0), 0.4) + cameraRotation *= coin.SbRotation(coin.SbVec3f(1,0,0),1.0) + cameraRotation *= coin.SbRotation(coin.SbVec3f(0,0,1),0.4) camera.orientation = cameraRotation # make sure all objects get in the view later zoom = True @@ -409,7 +409,7 @@ def buildScene(objects,colors=None): root = coin.SoSeparator() for o in objects: buf = None - if hasattr(o,'Shape'): + if hasattr(o,'Shape') and o.Shape and (not o.Shape.isNull()): # writeInventor of shapes needs tessellation values buf = o.Shape.writeInventor(2,0.01) elif o.isDerivedFrom("Mesh::Feature"): @@ -444,7 +444,7 @@ def getCamera(filepath): guidata = getGuiData(filepath) if "GuiCameraSettings" in guidata: return guidata["GuiCameraSettings"].strip() - print("no camera found in file") + print("No camera found in file") return None