ScriptSpot

Forum topic · Scripts Wanted

copy name and wire

By jsrocha · 2011-02-16

Description

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 (6)

jsrocha · 2011-02-16

ops...

hope this help

Anubis · 2011-02-16

--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
		)
	)
)

jsrocha · 2011-02-16

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

Jsrocha

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

jsrocha · 2011-02-16

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

maby easy or not

Anubis · 2011-02-17

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).

jsrocha · 2011-02-18

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

Jsrocha