Last active
August 29, 2015 14:02
-
-
Save GregMalick/0e6fab5f75c0b338df14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a snippet from farfarer | |
# To read the selection sets the polygon belongs to; | |
# Create a StringTag object - this lets you read tags applied to an object. | |
# In this case, we're setting it to read tags for the polygon accessor (called polygon_loc in this code). | |
# Then a quick test to check if it's actually localised OK. | |
tag_loc = lx.object.StringTag() | |
tag_loc.set(polygon_loc) | |
if not tag_loc.test(): | |
return | |
# So now we can use the polygon accessor to grab the polygon. | |
# And use the StringTag object to read the tags of a given type from it - in this case the tags of POLYTAG_PICK type. | |
polygon_loc.Select(myPolygonID) | |
selset = tag_loc.Get (lx.symbol.i_POLYTAG_PICK) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Snippet of code from farfarer on how to read a polygon's Selection Set
Only vertices and edges have their selection sets stored in vertex maps.
Vertices have theirs stored in VMAP_PICK type maps.
Edges have theirs stored in VMAP_EPCK type maps.
Polygons have theirs stored on tags (of type POLYTAG_PICK) that the polygon is tagged with.
Lots of things are stored as tags on polygons - selection sets, material name, part name, smoothing group and a bunch of font/text-related stuff.