From 50c0b0b1a99143490e7723f20fad98e08b977b05 Mon Sep 17 00:00:00 2001 From: Pullusb Date: Mon, 25 Oct 2021 20:11:59 +0200 Subject: [PATCH] fix redner scene creation error 0.6.1: - fix: in generated bat use %Username% variable (still limited to studio path model) - fix: error when creating render scene --- CHANGELOG.md | 5 +++++ OP_render_scenes.py | 13 ++++++++++++- __init__.py | 2 +- fn.py | 6 +++--- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f5809d..7704a8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ Activate / deactivate layer opaticty according to prefix Activate / deactivate all masks using MA layers --> +0.6.1: + +- fix: in generated bat use %Username% variable (still limited to studio path model) +- fix: error when creating render scene + 0.6.0: - feat: button to generate a background rendering script to batch multi-scene diff --git a/OP_render_scenes.py b/OP_render_scenes.py index 647bb4a..50c2af3 100644 --- a/OP_render_scenes.py +++ b/OP_render_scenes.py @@ -178,7 +178,18 @@ class GPEXP_OT_bg_render_script_selected_scene(bpy.types.Operator): print('batch_file: ', batch_file) for scn_name in scn_to_render: - cmd = f'"{bpy.app.binary_path}" -b "{bpy.data.filepath}" -S "{scn_name}" -a' + if platform.startswith('win'): + import re + pattern = r'users[\/\\](.*?)[\/\\]softs' # or point to user dit with %UserProfile% + re_user = re.search(pattern, bpy.app.binary_path) + if not re_user: + cmd = f'"{bpy.app.binary_path}" -b "{bpy.data.filepath}" -S "{scn_name}" -a' + else: + bin_path = bpy.app.binary_path.replace(re_user.group(1), '%USERNAME%') + cmd = f'"{bin_path}" -b "{bpy.data.filepath}" -S "{scn_name}" -a' + + else: # Unix : point same for each user + cmd = f'"{bpy.app.binary_path}" -b "{bpy.data.filepath}" -S "{scn_name}" -a' script_text.append(cmd) script_text.append('echo --- END BATCH ---') diff --git a/__init__.py b/__init__.py index 6d1f29e..eb3c131 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, 6, 0), + "version": (0, 6, 1), "blender": (2, 93, 0), "location": "View3D", "warning": "", diff --git a/fn.py b/fn.py index 57c464a..c77d01f 100644 --- a/fn.py +++ b/fn.py @@ -178,7 +178,7 @@ def new_scene_from(name, src_scn=None, regen=True, crop=True, link_cam=True, lin if link_light and ob.type == 'LIGHT': scn.collection.objects.link(ob) - # set adapted render settings (no AA) + # set adapted render settings set_settings(scn) if crop: @@ -210,8 +210,8 @@ def get_render_scene(): # TODO Clear node tree (initial view layer stuff) - set_settings(render_scn, with_aa=False) # set adapted render settings (no AA by default) - render_scn.use_aa = True + set_settings(render_scn) + render_scn['use_aa'] = True return render_scn def get_view_layer(name, scene=None):