CAM: Do not show models of the toolbits in Job dialog (#22893)

This commit is contained in:
tarman3
2025-08-23 20:10:38 +03:00
committed by GitHub
parent d5361929f6
commit 9bcbc17433
3 changed files with 33 additions and 7 deletions

View File

@@ -77,10 +77,10 @@ def getPropertyValueString(obj, prop):
def setProperty(obj, prop, value):
"""setProperty(obj, prop, value) ... set the property value of obj's property defined by its canonical name."""
o, attr, name = _getProperty(obj, prop)
if not attr is None and type(value) == str:
if type(attr) == int:
if attr is not None and isinstance(value, str):
if isinstance(attr, int):
value = int(value, 0)
elif type(attr) == bool:
elif isinstance(attr, bool):
value = value.lower() in ["true", "1", "yes", "ok"]
if o and name:
setattr(o, name, value)
@@ -99,6 +99,10 @@ def isValidBaseObject(obj):
if hasattr(obj, "BitBody") and hasattr(obj, "ShapeName"):
# ToolBit's are not valid base objects
return False
if hasattr(obj, "ToolBitID"):
return False
if any(hasattr(ob, "ToolBitID") for ob in getattr(obj, "InListRecursive", [])):
return False
if obj.TypeId in NotValidBaseTypeIds:
Path.Log.debug("%s is blacklisted (%s)" % (obj.Label, obj.TypeId))
return False