1
2import Editor
3import EditorLog
4import GLPolygon
5import Group
6import VertexArray
7import Vertex
8
9
11
12
18
19
21polygon.SetPolygonMode( polygon.POLY_MODE_FILLED )
22polygon.SetName('poly')
23
24
25currentDoc.InsertObject( polygon )
26
27
28
29vertsList = [
34]
35
36
38yellowPolygon.SetPolygonMode( yellowPolygon.POLY_MODE_FILLED )
39yellowPolygon.SetName('yellow')
40
41currentDoc.InsertObject( yellowPolygon )
42
43
51 ],
53)
54
55multiPolygon.SetPolygonMode( multiPolygon.POLY_MODE_FILL_AND_OUTLINE )
56multiPolygon.SetShadingMode( multiPolygon.SHADING_GOURAUD )
57multiPolygon.SetName('multi')
58
59
61group.SetName('group')
62currentDoc.InsertObject(group)
63
64
65group.InsertObject(multiPolygon)
66
67
68group.MoveObjectToGroup(yellowPolygon)
69
70
71
72lookup = currentDoc.GetObjectByName('group')
73
74
76
77
80
83
84
85for x in group:
87
88
89
90def Process(prefix, x):
92
93
94def PrintNames(group, prefix=''):
95 prefix = (prefix + '.' if prefix else '') + group.GetName()
96 for x in group:
97 Process(prefix, x)
99 if subgroup:
100 PrintNames(subgroup, prefix)
101
102PrintNames( currentDoc.GetObjectList() )
Document GetCurrentDocument()
Gets the current document.
void PrintInfo(String str)
Output an info string to the editor log.
Definition: EditorLog.i:89
GLPolygon(VertexArray &vertices)
Creates a polygon with the specified vertices.
static GLPolygon * CastToGLPolygon(DisplayObject *obj)
Casts the Display Object as a GLPolygon NOTE: perform an isNULL check on the returned value to ensure...
Group()
Constructs an empty group.
static Group * CastToGroup(DisplayObject *obj)
Casts a DisplayObject to a Group (returns null on failure to cast)
VertexArray()
default ctor
Vertex()
Default constructor.