Hi,
Is there a way to test for number of objects selected?
$.count works only if there are more than one, $ as array as well.
I tried append myArray $ as well, but in case of several objects it will add only "$selection" as a value.
I'm at a loss here, any ideas?
Thanks!
Comments (5)
Comment policy
Thanks a lot for the answers. It really helped me today as I have been searching for help for quite a considerable time.
mov player download
Why you need to use finction to get the count of the selected objects?
Just use
Try this:
1- create some objects in the scene
2- select some of them
3- in the listener type
and max will print the count of the selected objects. You can select multiple objects or single object.
So in the script you can use
If you want to select only one object from the selection just use
Thanks, it's what MKlejnowski suggested as well. I don't believe I haven't tried that myself!! :p
instead of
use
. It can be used even when no objects are selected
Huh.. Many thanks! Why didn't I think of this?!?
Just for a curiosity value, here's my solution:
At least I learned how to use try/catch... lol