changed get children method

This commit is contained in:
Jakub Trllo 2019-04-10 11:34:48 +02:00
parent 4bf0e796b9
commit d3bcf2cdd3

View file

@ -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))