diff --git a/OP_auto_build.py b/OP_auto_build.py index a8a48da..743ba87 100644 --- a/OP_auto_build.py +++ b/OP_auto_build.py @@ -164,10 +164,10 @@ class GPEXP_OT_render_auto_build(bpy.types.Operator): render_scn = fn.get_render_scene(create=False) if self.scene: - render_scn = bpy.data.scenes.get(self.scene) - if render_scn: - self.report({'ERROR'}, f'Abort, scene "{render_scn.name}" already exists') + if bpy.data.scenes.get(self.scene): + self.report({'ERROR'}, f'Abort, scene "{self.scene}" already exists') return {'CANCELLED'} + render_scn = fn.get_render_scene(scene_name=self.scene, create=True) if self.node_scene: node_scene = fn.get_compo_scene(scene_name=self.node_scene, create=True) # create if not exists diff --git a/README.md b/README.md index 1b46b78..29bb2ee 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,24 @@ Organise export of gp layers through compositor output ### Environment variables -`FILE_FORMAT` : Define file_format used for output. If not specified, use `OPEN_EXR_MULTILAYER` (set `OPEN_EXR` for separate sequences) \ No newline at end of file +`FILE_FORMAT` : Define file_format used for output. If not specified, use `OPEN_EXR_MULTILAYER` (set `OPEN_EXR` for separate sequences) + + +### Notable operator arguments for automatisation + +- `scene` (str) Define scene where GP object will be linked and rendered, if ommited scene use name `renderGP` (create scene if needed) +- `node_scene` (str) Define scene where renderlayer nodes are addes and connected (create scene if needed), if ommited use `scene` arg above + +Following string template can be set to customize file-output paths : base_path, file_slot, layer_slot. +- `base_path` : file output base path +- `file_slot` : file output slots +- `layer_slot`: file output slots when using multilayer EXR (EXR layer names) + +Available template keywords: +- {object} : Object name +- {gplayer} : GP layer name + +Default template if nothing is passed: +- `base_path` = `//render/{object}` (if using multilayer-EXR: `//render/{object}/{object}_`) +- `file_slot` = `{gplayer}/{gplayer}_` +- `layer_slot` = `{gplayer}` diff --git a/gen_vlayer.py b/gen_vlayer.py index d34eb3b..a906c5a 100644 --- a/gen_vlayer.py +++ b/gen_vlayer.py @@ -334,8 +334,8 @@ def get_set_viewlayer_from_gp(ob, l, scene=None, node_scene=None, scene = scene or fn.get_render_scene() node_scene = node_scene or fn.get_compo_scene() or scene - print('Viewlayer Scene: ', scene.name) - print('Compo Scene: ', node_scene.name) + # print('Viewlayer Scene:', scene.name) #Dbg + # print('Compo Scene:', node_scene.name) #Dbg ## If not passed, identical to scene holding viewlayers @@ -468,11 +468,16 @@ def get_set_viewlayer_from_gp(ob, l, scene=None, node_scene=None, # cp.location = (top_loc[0], top_loc[1] + 100) # temp location to adjust x loc - # list of layer names in nodes order - rl_names = [n.layer.split(' / ')[1] for n in rl_nodes] # get True layer name from rl - # names with the right order WITH the new layer included - names = [lay.info for lay in ob.data.layers if lay.info in rl_names or lay == l] + # List of layer names in nodes order + rl_names = [n.layer.split(' / ')[1] for n in rl_nodes] # Get True layer name from rl + + ## Names with the right order WITH the new layer included + # names = [lay.info for lay in ob.data.layers if lay.info in rl_names or lay == l] # <- Character limit problem + ## Consider viewlayer name length of 63 char max + char_limit = 63 - len(ob.name + ' / ') + names = [lay.info[:char_limit] for lay in ob.data.layers if lay.info[:char_limit] in rl_names or lay == l] + rl_nodes.append(cp) # filter by getting index(layer_name)