Freestyle: Feature edge selection by nested object groups.

A group of object groups can be formed by means of the dupli_group option in
the Object properties window.  The present revision extends the Selection by
Group option in the Freestyle Line Set so as to support not only flat object
groups but also nested groups.
This commit is contained in:
Tamito Kajiyama 2017-02-16 10:51:40 +09:00
parent 9b3d415f6a
commit 781507d2dd
1 changed files with 11 additions and 1 deletions

View File

@ -1170,6 +1170,7 @@ class Seed:
_seed = Seed()
def get_dashed_pattern(linestyle):
"""Extracts the dashed pattern from the various UI options """
pattern = []
@ -1185,6 +1186,15 @@ def get_dashed_pattern(linestyle):
return pattern
def get_grouped_objects(group):
for ob in group.objects:
if ob.dupli_type == 'GROUP' and ob.dupli_group is not None:
for dupli in get_grouped_objects(ob.dupli_group):
yield dupli
else:
yield ob
integration_types = {
'MEAN': IntegrationType.MEAN,
'MIN': IntegrationType.MIN,
@ -1267,7 +1277,7 @@ def process(layer_name, lineset_name):
# prepare selection criteria by group of objects
if lineset.select_by_group:
if lineset.group is not None:
names = {getQualifiedObjectName(ob): True for ob in lineset.group.objects}
names = {getQualifiedObjectName(ob): True for ob in get_grouped_objects(lineset.group)}
upred = ObjectNamesUP1D(names, lineset.group_negation == 'EXCLUSIVE')
selection_criteria.append(upred)
# prepare selection criteria by image border