group.ofs 1.08 KB
Newer Older
Matthias Möller's avatar
Matthias Möller committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

//Group 20 Objects
for (i=0; i < 20;++i)
	primitivesgenerator.addSphere()
datacontrol.setAllTarget()
var list = datacontrol.getTargetObjects(DataType("TriangleMesh"));
groupid = datacontrol.groupObjects(list)
if (datacontrol.groupCount() != 1)
{
	print("unexpected group count")
	print("number of groups: " + datacontrol.groupCount())
	print("expected number of groups: 1") 
	core.exitFailure()
}
datacontrol.clearAllTarget()

//Group Object and Group
id = primitivesgenerator.addSphere()
list = [groupid,id]
datacontrol.groupObjects(list)
if (datacontrol.groupCount() != 2)
{
	print("unexpected group count")
	print("number of groups: " + datacontrol.groupCount())
	print("expected number of groups: 2") 
	core.exitFailure()
}
datacontrol.clearAllTarget()

//Group multiple Groups
id = primitivesgenerator.addSphere()
id2 = primitivesgenerator.addSphere()
list = [id2,id]
groupid2 = datacontrol.groupObjects(list)

36
37
38
39
40
41
42
if (datacontrol.groupCount() != 3)
{
  print("unexpected group count")
  print("number of groups: " + datacontrol.groupCount())
  print("expected number of groups: 3") 
  core.exitFailure()
}