Skip to content

Commit

Permalink
Don't try to set mesh properties if there is no mesh available, nbt #84
Browse files Browse the repository at this point in the history
  • Loading branch information
joepal1976 committed Dec 27, 2018
1 parent 4fed22e commit f75bc97
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions makehuman/shared/proxy.py
Expand Up @@ -159,19 +159,20 @@ def loadMeshAndObject(self, human):
import files3d
import guicommon

obj = False
mesh = files3d.loadMesh(self.obj_file, maxFaces = self.max_pole)
if not mesh:
log.error("Failed to load %s", self.obj_file)

mesh.priority = self.z_depth # Set render order
mesh.setCameraProjection(0) # Set to model camera

obj = self.object = guicommon.Object(mesh, human.getPosition())
obj.proxy = self
obj.material = self.material
obj.setRotation(human.getRotation())
obj.setSolid(human.solid) # Set to wireframe if human is in wireframe
# TODO perhaps other properties should be copied from human to object, such as subdivision state. For other hints, and duplicate code, see guicommon Object.setProxy()
else:
mesh.priority = self.z_depth # Set render order
mesh.setCameraProjection(0) # Set to model camera
obj = self.object = guicommon.Object(mesh, human.getPosition())
obj.proxy = self
obj.material = self.material
obj.setRotation(human.getRotation())
obj.setSolid(human.solid) # Set to wireframe if human is in wireframe
# TODO perhaps other properties should be copied from human to object, such as subdivision state. For other hints, and duplicate code, see guicommon Object.setProxy()

# TODO why return both obj and mesh if you can access the mesh easily through obj.mesh?
return mesh,obj
Expand Down

0 comments on commit f75bc97

Please sign in to comment.