mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
fix clone
This commit is contained in:
parent
0c801ba892
commit
88e4a159ca
1 changed files with 8 additions and 0 deletions
|
|
@ -183,6 +183,11 @@ class AbstractAttrDef(metaclass=AbstractAttrDefMeta):
|
|||
def id(self) -> str:
|
||||
return self._id
|
||||
|
||||
def clone(self):
|
||||
data = self.serialize()
|
||||
data.pop("type")
|
||||
return self.deserialize(data)
|
||||
|
||||
@property
|
||||
def hidden(self) -> bool:
|
||||
return not self.visible
|
||||
|
|
@ -275,6 +280,9 @@ class AbstractAttrDef(metaclass=AbstractAttrDefMeta):
|
|||
|
||||
Data can be received using 'serialize' method.
|
||||
"""
|
||||
if "type" in data:
|
||||
data = dict(data)
|
||||
data.pop("type")
|
||||
|
||||
return cls(**data)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue