Hi.
I'm having a problem with array in max script;
I have one array that I'm filling in one for loop, each time with different faces from selected object.
But, occasionally that array will be empty, or to be exact, there won't be any faces contained inside that array.
When I have faces in array I get this when I print that array:
#{7..8, 17..18, 23..24}
And when array is empty, I get this:
#{}
Problem starts when I want to detect if that array is empty or not; I have tried to use .count, but no mater if array is empty or not, I get value 32 from that:
example 1:
print my_array
I got this: #{}
print (my_array.count)
I got this: 32
example 2:
print my_array
I got this: #{7..8, 17..18, 23..24}
print (my_array.count)
I got this: 32
So, by using .count I wasn't able to detect if that array is empty or not.
Then I tried to use #() in IF loop, to detect if array is empty:
if my_array == #() do
(
print "empty"
)
Result: I never get print out "empty"
So, to shorten things; I need a way to detect if array is empty or not... Please help :(
Anubis · 2011-07-30
miauu · 2011-07-30