autobuild beta
1.1.1 - changed: autobuild beta
This commit is contained in:
+2
-19
@@ -43,23 +43,6 @@ class GPEXP_OT_add_layer_to_render(bpy.types.Operator):
|
||||
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
def export_gp_objects(oblist, exclude_list=[], scene=None):
|
||||
# Skip layer containing element in excluyde list
|
||||
if not isinstance(oblist, list):
|
||||
oblist = [oblist]
|
||||
|
||||
for ob in oblist:
|
||||
for l in ob.data.layers:
|
||||
# if l.hide:
|
||||
# continue
|
||||
if l.hide or any(x + '_' in l.info for x in exclude_list): # exclude hided ?
|
||||
l.viewlayer_render = fn.get_view_layer('exclude', scene=scene).name # assign "exclude"
|
||||
continue
|
||||
|
||||
_vl, _cp = gen_vlayer.get_set_viewlayer_from_gp(ob, l, scene=scene) # scene=fn.get_render_scene())
|
||||
|
||||
|
||||
## send operator with mode ALL or SELECTED to batch build
|
||||
class GPEXP_OT_add_objects_to_render(bpy.types.Operator):
|
||||
bl_idname = "gp.add_object_to_render"
|
||||
@@ -84,14 +67,14 @@ class GPEXP_OT_add_objects_to_render(bpy.types.Operator):
|
||||
|
||||
excludes = [] # ['MA', 'IN'] # Get list dynamically
|
||||
if self.mode == 'SELECTED':
|
||||
export_gp_objects([o for o in context.selected_objects if o.type == 'GPENCIL'], exclude_list=excludes, scene=scn)
|
||||
gen_vlayer.export_gp_objects([o for o in context.selected_objects if o.type == 'GPENCIL'], exclude_list=excludes, scene=scn)
|
||||
|
||||
elif self.mode == 'ALL':
|
||||
# scn = bpy.data.scenes.get('Scene')
|
||||
# if not scn:
|
||||
# self.report({'ERROR'}, 'Could not found default scene')
|
||||
# return {"CANCELLED"}
|
||||
export_gp_objects([o for o in context.scene.objects if o.type == 'GPENCIL' and not o.hide_get() and fn.is_valid_name(o.name)], exclude_list=excludes, scene=scn)
|
||||
gen_vlayer.export_gp_objects([o for o in context.scene.objects if o.type == 'GPENCIL' and not o.hide_get() and fn.is_valid_name(o.name)], exclude_list=excludes, scene=scn)
|
||||
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user