diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2017-02-16 04:51:40 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2017-02-16 04:53:11 +0300 |
commit | 781507d2dded2a0fb2720ee045d31cc9f12d4696 (patch) | |
tree | 1f7595f1536855f7672269b3b0e0195f712449b6 /release/scripts | |
parent | 9b3d415f6a315d8f79c58de189dbce18a4c2b5f0 (diff) |
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.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/freestyle/modules/parameter_editor.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/release/scripts/freestyle/modules/parameter_editor.py b/release/scripts/freestyle/modules/parameter_editor.py index 93305cb7c5a..b093920a4cb 100644 --- a/release/scripts/freestyle/modules/parameter_editor.py +++ b/release/scripts/freestyle/modules/parameter_editor.py @@ -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 |