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
main
Pullusb 2021-10-25 20:11:59 +02:00
parent 1a992a1092
commit 50c0b0b1a9
4 changed files with 21 additions and 5 deletions

View File

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

View File

@ -178,6 +178,17 @@ class GPEXP_OT_bg_render_script_selected_scene(bpy.types.Operator):
print('batch_file: ', batch_file)
for scn_name in scn_to_render:
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)

View File

@ -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": "",

6
fn.py
View File

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