Select node from layers
0.9.7 - feat: `Select Nodes` added in Dopesheet. Select nodes associated with selected gp layers and report if there are errors
This commit is contained in:
@@ -835,6 +835,39 @@ def normalize_layer_name(layer, prefix='', desc='', suffix='', lower=True, dash_
|
||||
print(f' - updated in {ob.name} modifier {m.name}')
|
||||
m.layer = new
|
||||
|
||||
# unused currently
|
||||
def build_dope_gp_list(layer_list):
|
||||
'''Take a list of GP layers return a dict with pairs {gp data : own layer list}'''
|
||||
from collections import defaultdict
|
||||
gps = defaultdict(list)
|
||||
for l in layer_list:
|
||||
gps[l.id_data].append(l)
|
||||
return gps
|
||||
|
||||
def build_layers_targets_from_dopesheet(context):
|
||||
'''Return all selected layers on context GP dopesheet according to seelction and filters'''
|
||||
ob = context.object
|
||||
gpl = context.object.data.layers
|
||||
act = gpl.active
|
||||
dopeset = context.space_data.dopesheet
|
||||
|
||||
|
||||
if dopeset.show_only_selected:
|
||||
pool = [o for o in context.selected_objects if o.type == 'GPENCIL']
|
||||
else:
|
||||
pool = [o for o in context.scene.objects if o.type == 'GPENCIL']
|
||||
if not dopeset.show_hidden:
|
||||
pool = [o for o in pool if o.visible_get()]
|
||||
|
||||
layer_pool = [l for o in pool for l in o.data.layers]
|
||||
layer_pool = list(set(layer_pool)) # remove dupli-layers from same data source with
|
||||
|
||||
# apply search filter
|
||||
if dopeset.filter_text:
|
||||
layer_pool = [l for l in layer_pool if (dopeset.filter_text.lower() in l.info.lower()) ^ dopeset.use_filter_invert]
|
||||
|
||||
return layer_pool
|
||||
|
||||
""" # old show message gox without operator support
|
||||
def show_message_box(_message = "", _title = "Message Box", _icon = 'INFO'):
|
||||
'''get a str to display or a list of [str, str]
|
||||
|
||||
Reference in New Issue
Block a user