Notifications
Clear all
[Closed] How to count the number of Groups in selection
Oct 02, 2022 8:53 pm
Hi all,
I have a script as below, but I don’t know that how can I count the number of Groups.
Actually, I want to count the Groups and make the length of the Keyframe.
My code :
– Set length of the Keyframe by Counting of Groups
(
head_group = #()
for grp in (selection as array) where (isgrouphead grp) and not (isGroupMember grp) do (print (append head_group grp).count)
)
grpcount = ???
framelength = 2*grpcount
animationRange = interval 0 framelength
sliderTime = 0f
)
2 Replies
Oct 02, 2022 8:53 pm
I’m not sure I understood you correctly, but are you looking for something like this?
groupHeads = (for obj in Helpers where (isGroupHead obj == true) collect obj)
animationRange = interval 0 groupHeads.count