mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #2378 from pypeclub/bugfix/hiero-fix-workio-flatten
This commit is contained in:
commit
5808884d9c
3 changed files with 13 additions and 15 deletions
|
|
@ -37,10 +37,11 @@ self.default_bin_name = "openpypeBin"
|
|||
AVALON_CONFIG = os.getenv("AVALON_CONFIG", "pype")
|
||||
|
||||
|
||||
def flatten(input_list):
|
||||
for item in input_list:
|
||||
def flatten(_list):
|
||||
for item in _list:
|
||||
if isinstance(item, (list, tuple)):
|
||||
yield from flatten(item)
|
||||
for sub_item in flatten(item):
|
||||
yield sub_item
|
||||
else:
|
||||
yield item
|
||||
|
||||
|
|
|
|||
|
|
@ -28,12 +28,13 @@ self.timeline = None
|
|||
self.include_tags = True
|
||||
|
||||
|
||||
def flatten(l):
|
||||
for i in l:
|
||||
if isinstance(i, (list, tuple)):
|
||||
yield from flatten(i)
|
||||
else:
|
||||
yield i
|
||||
def flatten(_list):
|
||||
for item in _list:
|
||||
if isinstance(item, (list, tuple)):
|
||||
for sub_item in flatten(item):
|
||||
yield sub_item
|
||||
else:
|
||||
yield item
|
||||
|
||||
|
||||
def get_current_hiero_project(remove_untitled=False):
|
||||
|
|
|
|||
|
|
@ -65,13 +65,9 @@ def open_file(filepath):
|
|||
|
||||
def current_file():
|
||||
current_file = hiero.core.projects()[-1].path()
|
||||
normalised = os.path.normpath(current_file)
|
||||
|
||||
# Unsaved current file
|
||||
if normalised == "":
|
||||
if not current_file:
|
||||
return None
|
||||
|
||||
return normalised
|
||||
return os.path.normpath(current_file)
|
||||
|
||||
|
||||
def work_root(session):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue