Skip to content

Commit

Permalink
Merge pull request #63 from monkeez/typecheckfix
Browse files Browse the repository at this point in the history
Fix Node.isA bug when checking multiple types
  • Loading branch information
mottosso authored Jun 20, 2021
2 parents 13c5022 + 035b54a commit 7453deb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,14 +834,16 @@ def isA(self, type):
True
>>> node.isA(kShape)
False
>>> node.isA((kShape, kTransform))
True
"""
if isinstance(type, om.MTypeId):
return type == self._fn.typeId
elif isinstance(type, string_types):
return type == self._fn.typeName
elif isinstance(type, (tuple, list)):
return self._fn.typeName in type or self._fn.typeId in type
return any(self.isA(t) for t in type)
elif isinstance(type, int):
return self._mobject.hasFn(type)
cmds.warning("Unsupported argument passed to isA('%s')" % type)
Expand Down

0 comments on commit 7453deb

Please sign in to comment.