copy name and wire

Hy guys, is too hard to make a scritp to copy the name and wire color from an object? something like: i have a selected object, and when i run the script, he ask me to pick an object, and then it copies the name and wire color to the selected object.
I looked for a script like that but i never found.
Thanks in advance,

Jsrocha

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jsrocha's picture

ops...

ops...

Anubis's picture

hope this help

--macroScript Copy_NameAndColor category:"Tests" tooltip:"..."
(
	me = selection[1]
	if isValidNode me do
	(
		ref = pickObject count:1
		if isValidNode ref do
		(
			me.name = ref.name
			me.wirecolor = ref.wirecolor
		)
	)
)

my recent MAXScripts RSS (archive here)

jsrocha's picture

Thanks Anubis, this is

Thanks Anubis, this is exactly what i need!!
best regards,

Jsrocha

p.s.: i NEED to learn maxscript.....

jsrocha's picture

Hi Anubis, me again. The

Hi Anubis, me again. The script you wrote does exactly what i asked. But now i figured that it would be good if it worked also with more than one object selected. Is that possible?
thanks again,

Jsrocha

Anubis's picture

maby easy or not

This will assign the wire color from picked object to all selected objects:

ref = pickObject count:1
if isValidNode ref do
	selection.wirecolor = ref.wirecolor

But what about the names... hardly you like to end with dups names. I think you need a ui-dialog where to pick equal (to selected) amount of objects from which to copy their names (in obj-per-obj manner).

my recent MAXScripts RSS (archive here)

jsrocha's picture

Thanks man, the wirecolor

Thanks man, the wirecolor option is very useful, more than the name option.
thanks again for your help,

Jsrocha

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.