autobuild: Set single user

1.2.3

- added: autobuild set each gp objects data to single user
main
pullusb 2023-02-28 15:58:55 +01:00
parent e03593bb1a
commit 6624c45228
3 changed files with 26 additions and 8 deletions

View File

@ -14,6 +14,10 @@ Activate / deactivate layer opacity according to prefix
Activate / deactivate all masks using MA layers
-->
1.2.3
- added: autobuild set each gp objects data to single user
1.2.2
- changed: autobuild disabled merge adjacent layer by default

View File

@ -69,6 +69,9 @@ class GPEXP_OT_render_auto_build(bpy.types.Operator):
# timer : bpy.props.FloatProperty(default=0.1, options={'SKIP_SAVE'})
make_gp_single_user : bpy.props.BoolProperty(name='Set Single User Data', default=True,
description='Set single user on all objects GP data')
excluded_prefix : bpy.props.StringProperty(
name='Excluded Layer By Prefix', default='GP, RG, PO, MA',
description='Exclude layer to send to render by prefix (comma separated list)')
@ -84,25 +87,29 @@ class GPEXP_OT_render_auto_build(bpy.types.Operator):
description='Comma separated prefix to render. Set the other prefix and non-prefixed layer to exluded viewlayer')
set_layers_colors : bpy.props.BoolProperty(name='Set Layers Colors', default=True,
description='')
description='Set colors for on layers according to prefix (hadrcoded color set)')
trigger_rename_lowercase : bpy.props.BoolProperty(name='Trigger Rename Lowercase', default=True,
description='')
description='Rename all layer names lowercase')
trigger_renumber_by_distance : bpy.props.BoolProperty(name='Trigger Renumber By Distance', default=True,
description='')
description='Renumber object accordind to distance from camera and In-Front value')
export_layer_infos : bpy.props.BoolProperty(name='Export Layer Infos', default=True,
description='')
description='Export layers infos to a Json file')
group_all_adjacent_layer_type : bpy.props.BoolProperty(name='Group All Adjacent Layer Type', default=False,
description='')
description='Fuse output Viewlayer according to adjacent Prefix in layer stack')
change_to_gp_workspace : bpy.props.BoolProperty(name='Change To Gp Workspace', default=True,
description='')
description='Switch to "GP Render" workspace shipped with addon')
batch_setup_render_scene : bpy.props.BoolProperty(name='Batch Setup Render Scene', default=True,
description='')
description='- Renumber fileoutputs\
\n- Clean compo Tree\
\n- Go to camera view in visible viewports\
\n- Swap to bg cam'
)
def invoke(self, context, event):
@ -117,6 +124,7 @@ class GPEXP_OT_render_auto_build(bpy.types.Operator):
row.prop(self, 'prefix_filter')
row.active = self.clean_name_and_visibility
col.prop(self, 'make_gp_single_user')
col.prop(self, 'clean_material_duplication')
col.prop(self, 'set_layers_colors')
@ -208,6 +216,12 @@ class GPEXP_OT_render_auto_build(bpy.types.Operator):
print('Export layer infos (skip if json already exists)')
bpy.ops.gp.export_infos_for_compo('INVOKE_DEFAULT', skip_check=True)
## Set GP object data to single user (Individual viewlayers)
if self.make_gp_single_user:
for o in ob_list:
if o.data.users > 1:
o.data = o.data.copy()
## Send all GP to render scene
print('Send all GP to render scene')
# bpy.ops.gp.add_object_to_render(mode="ALL") # Ops to send all

View File

@ -2,7 +2,7 @@ bl_info = {
"name": "GP Render",
"description": "Organise export of gp layers through compositor output",
"author": "Samuel Bernou",
"version": (1, 2, 2),
"version": (1, 2, 3),
"blender": (2, 93, 0),
"location": "View3D",
"warning": "",