mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
changed get children method
This commit is contained in:
parent
4bf0e796b9
commit
d3bcf2cdd3
1 changed files with 13 additions and 9 deletions
|
|
@ -35,15 +35,6 @@ class CreateFolders(BaseAction):
|
|||
return False
|
||||
return True
|
||||
|
||||
def getShotAsset(self, entity):
|
||||
if entity not in self.importable:
|
||||
if entity['object_type']['name'] != 'Task':
|
||||
self.importable.add(entity)
|
||||
|
||||
if entity['children']:
|
||||
children = entity['children']
|
||||
for child in children:
|
||||
self.getShotAsset(child)
|
||||
|
||||
def launch(self, session, entities, event):
|
||||
'''Callback method for custom action.'''
|
||||
|
|
@ -134,6 +125,19 @@ class CreateFolders(BaseAction):
|
|||
'message': 'Created Folders Successfully!'
|
||||
}
|
||||
|
||||
def get_notask_children(self, entity):
|
||||
output = []
|
||||
if entity.get('object_type', {}).get(
|
||||
'name', entity.entity_type
|
||||
).lower() == 'task':
|
||||
return output
|
||||
else:
|
||||
output.append(entity)
|
||||
if entity['children']:
|
||||
for child in entity['children']:
|
||||
output.extend(self.get_notask_children(child))
|
||||
return output
|
||||
|
||||
def get_presets(self):
|
||||
fpath_items = [pypelib.get_presets_path(), 'tools', 'sw_folders.json']
|
||||
filepath = os.path.normpath(os.path.sep.join(fpath_items))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue