Thanks for reply.
Is it possible to detect if object is array or a varaialble.
esteban73
09-02-2009, 09:05 AM
the "$" its the same as to write "selection"
but you can use it as prefix to select objects:
select $b* -- that will select every object witch name starts with "b"
I think, in this case the difference between variable or array isnt to big
- If ony one object is selected then "$" is this object (like a variable)
- if many objects are selected, then "$" its the array for this objects
try this on the MAXScript Listener
aa = Box() -- create a box
select aa -- select the box AA
$ -- check your selected object
$ as array -- try to look into the selection / array
bb = Box() -- create a box
selectMore bb -- add the box BB the your selection
$ -- check your selected object
$ as array -- try to look into the selection / array
you would get this on the listener window
$Box:Box01 @ [0.000000,0.000000,0.000000] -- your box AA
OK -- confirm for select command
$Box:Box01 @ [0.000000,0.000000,0.000000] -- your selection $
-- Unable to convert: $Box:Box01 @ [0.000000,0.000000,0.000000] to type: Array -- in this case (1 object) its a variable
$Box:Box02 @ [0.000000,0.000000,0.000000] -- your box BB
OK -- confirm for select command
$selection -- your selection $
#($Box:Box01 @ [0.000000,0.000000,0.000000], $Box:Box02 @ [0.000000,0.000000,0.000000]) -- your array (many objects)
one object:
$.name = "myname" -- you use it as a variable
two objects:
for i in $ do -- its an array and you have to loop into it
i.name = uniquename "myname"
I dont know it theres a way to check it its a selection or array, but in this case "$" I dont kwno if you really need it, in the script you woldu prefer to name your variables with a unique name.
I hope it helps you a little.
CGTalk Moderation
09-02-2009, 10:15 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.