ScriptSpot

Forum topic · General Scripting

Grouping problems

By Mrjacks2o · 2015-10-12

Description

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 (2)

.

miauu · 2015-10-13


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

Thanks allot!!

Mrjacks2o · 2015-10-17

Thanks allot works perfect. :)