max script help!

I’ve been trying to get a section of a script which can do a clone & align without a dialog box popping up and i’m having some trouble.

I was trying to use this as a base - http://www.scriptspot.com/3ds-max/scripts/copy-align-link
but i cant figure out whats essential for the script and whats for the dialog box because i’m awful at this.

Like the ‘local SourceOBJ’ - is this it telling it what to do, or a temporary name for the object which I could edit mine into? I want it to pick a source object called ‘ctv_src’ and clone/align it over all objects called ‘ctv_dest’ but none of this is making any sense and i cant even follow the names and references properly.

…Does anyone have any recommendation of a book to read too? It bothers me that I cant do this :frowning:

Adapting that script with the above would be


SourceOBJ = $ctv_src
TargetOBJ = $ctv_dest*

	for i in TargetOBJ do

               (	
		Temp_SourceCopy = Copy SourceOBJ
		Temp_SourceCopy.transform = i.transform
		Temp_SourceCopy.parent = i
		Temp_SourceCopy.name = (SourceOBJ.name)+"_"+(i.name as string)
		)

You can change ‘Copy’ to ‘Instance’ if you want instances :slight_smile:

There’s no error checking in there and it could be more effecient but that should do the trick.

As for learning this stuff, I strongly recommend Bobo’s CG Academy dvd’s (although I think I’m right in remembering that he’s had problems with them paying him or something similar…?) and a couple of talented bods have started blogs with some maxscript stuff on them which should be helpful

:smile:

You’re the best! :slight_smile:

That works perfectly, thanks!

i’ll get onto all of that tonight. :smile:

The maxscript help is very good for learning, there are examples to get you started and for almost all methods and interfaces.

I think the best way to learn is do what you’re doing now, start with a simple idea and develop it. You might be surprised how quickly it starts to make sense. And if you get stuck ask for help.

Yup u guys are amazing and epic !