diff --git a/CHANGELOG.md b/CHANGELOG.md index b9317db..f81c075 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,11 @@ Activate / deactivate layer opaticty according to prefix Activate / deactivate all masks using MA layers --> +0.3.1 + +- fix: renumbering in the right order (since top layers are at bottom of file output) +- fix: renumering error for the last index + 0.3.0 - fix: viewlayer exclude attribution error diff --git a/__init__.py b/__init__.py index 310566d..98fc507 100644 --- a/__init__.py +++ b/__init__.py @@ -2,7 +2,7 @@ bl_info = { "name": "GP Render", "description": "Organise export of gp layers through compositor output", "author": "Samuel Bernou", - "version": (0, 3, 0), + "version": (0, 3, 1), "blender": (2, 93, 0), "location": "View3D", "warning": "", diff --git a/fn.py b/fn.py index 7febb47..a59145d 100644 --- a/fn.py +++ b/fn.py @@ -480,13 +480,21 @@ def delete_numbering(fo): # padding=3 new = '/'.join(elems) fs.path = new -def renumber_keep_existing(fo, offset=10): +def reverse_fileout_inputs(fo): + count = len(fo.inputs) + for i in range(count): + fo.inputs.move(count-1, i) + +def renumber_keep_existing(fo, offset=10, invert=True): '''Renumber by keeping existing numbers and inserting new one whenever possible Big and ugly function that do the trick nonetheless... ''' if fo.type != 'OUTPUT_FILE': return ct = 10 + + if invert: + reverse_fileout_inputs(fo) fsl = fo.file_slots @@ -497,6 +505,8 @@ def renumber_keep_existing(fo, offset=10): # print('-->', idx, fs.path) if idx == last_idx: # handle last + if get_num(fs) is not None: + break if idx > 0: prev = fsl[idx-1] num = get_num(prev) @@ -565,6 +575,8 @@ def renumber_keep_existing(fo, offset=10): prev = fs ct += offset + if invert: + reverse_fileout_inputs(fo) def has_channel_color(layer): '''Return True if gp_layer.channel_color is different than the default (0.2, 0.2, 0.2) '''