Semi-fix for errors during loading projects that contain lattice objects
This commit is contained in:
parent
e214467a94
commit
0543961ea2
|
@ -163,12 +163,22 @@ class LatticeFeature():
|
||||||
def onChanged(self, obj, prop): #prop is a string - name of the property
|
def onChanged(self, obj, prop): #prop is a string - name of the property
|
||||||
if prop == 'isLattice':
|
if prop == 'isLattice':
|
||||||
if obj.ViewObject is not None:
|
if obj.ViewObject is not None:
|
||||||
if isObjectLattice(obj):
|
try:
|
||||||
obj.ViewObject.DisplayMode = 'Shaded'
|
if isObjectLattice(obj):
|
||||||
obj.ViewObject.ShapeColor = getDefLatticeFaceColor()
|
obj.ViewObject.DisplayMode = 'Shaded'
|
||||||
else:
|
obj.ViewObject.ShapeColor = getDefLatticeFaceColor()
|
||||||
obj.ViewObject.DisplayMode = 'Flat Lines'
|
else:
|
||||||
obj.ViewObject.ShapeColor = getDefShapeColor()
|
obj.ViewObject.DisplayMode = 'Flat Lines'
|
||||||
|
obj.ViewObject.ShapeColor = getDefShapeColor()
|
||||||
|
except App.Base.FreeCADError as err:
|
||||||
|
#these errors pop up while loading project file, apparently because
|
||||||
|
# viewprovider is up already, but the shape vis mesh wasn't yet
|
||||||
|
# created. It is safe to ignore them, as DisplayMode is eventually
|
||||||
|
# restored to the correct values.
|
||||||
|
#Proper way of dealing with it would have been by testing for
|
||||||
|
# isRestoring(??), but I failed to find the way to do it.
|
||||||
|
#--DeepSOIC
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ViewProviderLatticeFeature:
|
class ViewProviderLatticeFeature:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user