global float mel script


#1

Hello
i have two button one named Copy and the second Past. i want when i select an object and press copy i can take all attribute from my selection and then pass it to a second object i selected. i write this mel script. it’s works fine with copy but i have problem with past button. i don’t know how to take fe float from the copy proc and pass it to the past proc


#2

You created local variables which cannot be seen outside the function. You have several ways to solve your problem:

[ul]
[li]Simply place the paste code after the copy code. There is no reason to keep them seperated.
[/li][li]If you want to keep two functions, call the second one after the copy code in the Copy() function with all the arguments.
[/li][li]Use global variables (not a good solution).
[/li][li]Do not copy but paste directly setAttr yourobject.tx getAttr anotherObject.tx;
[/li][/ul]


#3

Hello haggi and thank you again.

works fine now with global control. thank you again