Notifications
Clear all

[Closed] store position values to an array

Hello

I need to align an object to another object over the active time range,
I have seen some useful scripts which align and animate objects to other objects but they do it in one go. What I mean is they must work by aligning the object and keying it into position then advancing to the next frame and then keying it into position and so on until the end of the frame range.

I have a situation where I need to just store an objects position values maybe into an array.

Then at some later point I could press a button and another object could be animated to those positions from the values stored in that array.

I have very little experience with scripting, I think I know how it should work but lack the knowlege to write it, I would imagine in natural language it would go something like:


on button store_position_values pressed do
(
create a snap shot of object 1 position values from each frame from the time range into an array
)

on button transferre_position_values pressed do
(
key a selected object with the position values stored in the array.
)

Any advice to get me started would be greatly appreciated

cheers

Dan

6 Replies

I put these two scripts together pretty quick. There’s no UI, just drop them in the UI/Macroscripts folder and you’ll find them in the “HaywoodTools” category. Drop them onto a toolbar and you’re ready to go.

To use them, select the object whose animation you want to copy, then click the “Copy Position” button. Then select the object you want to inherit the first object’s position and click the “Paste Position” button.

Let me know how it works for you.

Thanks for posting the scripts, I copied it into the macroscripts folder and than ran max but it didnt show up a “HaywoodTools” category. I opend the script to see what might be going on but it was all scrambled? So I couldnt test them out.

Dan

Did you unzip the file? There are two macroscripts in the zip file, and they’re both just text files. I just tried opening the zip file and I can see the two .mcr files fine.

That was strange? I unziped your file which created another new file I added .zip extension to the new file and then had to unziped that one as well.

I got them now thanks, havent tried it yet but they look great.

cheers

Dan

Hmmm, I don’t know what going on. I just downloaded the zip and extracted the macroscripts from it, no problem. But at least you’ve got them now. Let me know if that’s what you wanted.

Just what I was after!

Thanks

Dan