how to make array and select this after cloning
hi, can anyone help me with this, its very simple, i simply want to select the clones after script has run,
select mycyl does not work, and i have tried others stuff as well (also reading anubis array tutorial), i still cant get it, and cannot find help in maxscript documentation
isnt mycyl already an array, or if not, how do i make this one, and then how do i select this array?
thanks for your help!
on btndo pressed Do (sel = getCurrentSelection()
sf = sel
if (Clone.state == 1) then(
c=objCount.value
for i=1 to c do (
mycyl = copy sf
)
)
Comments
I've replied to your email
I've replied to your email philz
nice to see you wish to learn :)
hehe, i see you made 2 forum topics for the same question.
ok, i'll write (soon) an example to help on understanding difference btw single/multiple cloning ;-)
my recent MAXScripts RSS (archive here)
thanks anubis your code
thanks anubis
your code worked perfectly
and nicer to have only small amount of code
but since i do want to understand it
i do not understand the error still, single noder or cloned collection of objects
i dont understand waht the problem was :)
// www.v-motion.co //
hmm, i wrote about this. then
hmm, i wrote about this. then you clone collection of nodes Max return OK, and that 'value' cant helps to do anything with it :)
my recent MAXScripts RSS (archive here)
>> MAXScript Rollout Handler
>> MAXScript Rollout Handler Exception: -- No ""append"" function for undefined <<
rollout roClone "clone"
(
spinner objCount "#:" range:[1,100,50] type:#integer across:2 align:#left width:60
button btndo
radiobuttons clone labels:#("Copy", "Instance","Reference") across:2
on btndo pressed Do
(
sel = getCurrentSelection()
sf = sel
if (Clone.state == 1) then
(
c=objCount.value
for i=1 to c do
(
mycyl = copy sf
append obj_copy mycyl
)
)
select obj_copy
)
)createDialog roClone 120 100
// www.v-motion.co //
your array is undefined
-- No ""append"" function for undefined
of course :) , you miss/remove array definition for 'obj_copy'
see the Budi example:
also check my example below.
my recent MAXScripts RSS (archive here)
try this
my recent MAXScripts RSS (archive here)
:( >> MAXScript Rollout
:(
>> MAXScript Rollout Handler Exception: -- Runtime error: operation requires a collection of nodes, got: OK <<
the way you said it now is the way i implemented it
with this error :(
// www.v-motion.co //
it come from multi-cloning
if you copy single node then the return value is the node, else - then clone collection of objects - Max return OK. there is why you get this error ;-)
quote form the help:
my recent MAXScripts RSS (archive here)
hi budi, thanks alot for your
hi budi, thanks alot for your help
but i get runtime error when inserting into my script:
>> MAXScript Rollout Handler Exception: -- Runtime error: operation requires a collection of nodes, got: OK <<
also i try .ms with just this nothing else:
rollout roClone "clone"
(
spinner objCount "#:" range:[1,100,50] type:#integer across:2 align:#left width:60
button btndo
radiobuttons clone labels:#("Copy", "Instance","Reference") across:2
on btndo pressed Do
(
obj_copy=#() ---make empty array colection
----------------------
-- put here your other script
for i=1 to c do
(
mycyl = copy sf -- copy the object
append obj_copy mycyl -- this add new object into obj_copy colection
)
----------------------
--- select array colection after looping
)select obj_copy
)createDialog roClone 120 100
and with this script i get this error:
>> MAXScript Rollout Handler Exception: -- Unable to convert: undefined to type: Integer <<
// www.v-motion.co //