Grouping problems

When i use ungroup in a loop it skips every other group i don't get why?
so if i have 6 groups in my scene all 6 are named (Group1) from 6 groups 3 would get skipped the other 3 would get un-grouped
any help would be appreciated.
thanks

-------------------------------------------
rollout image_button_test "Image Button"
(
button theButton "Un-Group" width:90 height:20

on theButton pressed do
(
for OBJ in helpers where ( OBJ.name == "Group1" ) do
(
print "start"
baseName = OBJ.name
ungroup $
)
)
)
createDialog image_button_test 210 210

------------------------------------------

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

rollout image_button_test "Image Button"
(
button theButton "Un-Group" width:90 height:20
 
on theButton pressed do
(
objsArr = helpers as array
for OBJ in objsArr where( ( OBJ.name == "Group1" )and isGroupHead obj) do
(
print "start"
baseName = OBJ.name
ungroup obj
)
)
)
createDialog image_button_test 210 210
Mrjacks2o's picture

Thanks allot!!

Thanks allot works perfect. :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.