Arch: Small optimizations in OfflineRenderingUtils module
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user