Skip to content

Commit

Permalink
added an example of getting display layer contents
Browse files Browse the repository at this point in the history
  • Loading branch information
theodox authored Jun 20, 2018
1 parent d03d7d1 commit c9afa3a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions minq_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,17 @@ def ik_chain(handle):
no_uvs = Meshes().where_not(lambda p: using(p).get(UVPointCount).first())
print "meshes with no uvs:", list(no_uvs)

# get the contents of a display layer
plain_contents = DisplayLayers().like('layer_name').get(Future).only(DagNodes)

# display layers can contain a mix of shapes and transforms; get
# the parents of any shapes and the children of any transforms. This
# will be equivalent to the _visual_ impact of the layer assignments.
# Use the 'split' feature to branch the original query into 3 streams
results, xforms, shapes = DisplayLayers().like('layer_name').get(Future).only(DagNodes).split(3)
print "layer contents", list(results + xforms.get(AllChildren) + shapes.only(Shapes).get(Parents))





0 comments on commit c9afa3a

Please sign in to comment.