Switched solid detection to blacklisting instead of whitelisting.
This commit is contained in:
@@ -169,7 +169,7 @@ class ObjectPathJob:
|
||||
@classmethod
|
||||
def isBaseCandidate(cls, obj):
|
||||
'''Answer true if the given object can be used as a Base for a job.'''
|
||||
return PathUtil.isSolid(obj) or (hasattr(obj, 'Proxy') and isinstance(obj.Proxy, ArchPanel.PanelSheet))
|
||||
return PathUtil.isValidBaseObject(obj) or (hasattr(obj, 'Proxy') and isinstance(obj.Proxy, ArchPanel.PanelSheet))
|
||||
|
||||
|
||||
class ViewProviderJob:
|
||||
|
||||
@@ -36,16 +36,14 @@ import PathScripts.PathLog as PathLog
|
||||
|
||||
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
|
||||
def isSolid(obj):
|
||||
NotValidBaseTypeIds = ['Sketcher::SketchObject']
|
||||
def isValidBaseObject(obj):
|
||||
'''isSolid(obj) ... returns true if an object represents a solid.'''
|
||||
|
||||
if hasattr(obj, 'Tip'):
|
||||
return isSolid(obj.Tip)
|
||||
if hasattr(obj, 'Shape'):
|
||||
if obj.Shape.ShapeType == 'Solid' and obj.Shape.isClosed():
|
||||
return True
|
||||
if obj.Shape.ShapeType == 'Compound':
|
||||
if hasattr(obj, 'Base') and hasattr(obj, 'Tool'):
|
||||
return isSolid(obj.Base) and isSolid(obj.Tool)
|
||||
return False
|
||||
|
||||
if not hasattr(obj, 'Shape'):
|
||||
return False
|
||||
if obj.TypeId in NotValidBaseTypeIds:
|
||||
return False
|
||||
if hasattr(obj, 'Sheets') or hasattr(obj, 'TagText'): # Arch.Panels and Arch.PanelCut
|
||||
return False
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user