Notifications
Clear all

[Closed] Rollouts based on number of shapes present in scene

Hello there! What I want is to create multiple identical roll outs based on the number of shapes in scene. If there are no shapes in scene then no rollouts should be created. So what i want is for each shape, create a separate rollout for it where the person can select the two groups that should be linked to the shape. In essence i want to create a portal (represented as shape) which links two groups. Here is a code i had wrote but it doesn’t work.

global GroupIndex = #()
if shapes.count != 0 then
(
	ShapeExterior = #()
	ShapeInterior = #()
	for i=1 to shapes.count do
		(
			GroupIndex[i] = #()
			rollName = "Shapes Relationship" + (i as string)
			rollout subRollout1 rollName (
		
			dropdownlist ShapeExterior "Exterior" items: groups -- Groups in array
			dropdownlist ShapeInterior "Interior" items: groups
			 
			 on ShapeExterior selected num do
			 (
				 index = findItem groups num
				 GroupIndex[i][1] = index - 1
			 )
			 on ShapeInterior selected num do
			 (
				 index = findItem groups num
				 GroupIndex[i][2] = index - 1
			 )
		 )
	 )
)

As you can see this doesn’t work. I just want to know if there is another way or a way to fix this. Even if the code would run probably, would this actually create a rollout for each shape?