Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Align?

Align?

Anonymous
Not applicable
212 Views
1 Reply
Message 1 of 2

Align?

Anonymous
Not applicable
Hello i am trying to get a macroscript going that aligns a camera to an animated camera each frame and sets a keyframe. The alignment should be on xyz position as well as xyz orientation. I assume that if i have set animate on and sliderTime += 1 after i aligned it, the key frame is set automatically

In my head the code would look like this 🙂

set animate on - get timeline frames - select camera01 - align camera01 to camera 02 - sliderTime += 1 - repeat from select camera until current frame is equal to timeline end

Hope this helps. If someone could give me a hint or give me some code where i could start off would be great.

Cheers

Ralf
0 Likes
213 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Assuming it's an animated camera with keyframes, the following should work. Change the camera names to whatever you need, etc.


startFrame = animationRange.start
endFrame = animationRange.end

set animate on

for f = startFrame to endFrame do
(
sliderTime = f
x = $Camera01.pos
y = $Camera01.rotation
$Camera02.pos = x
$Camera02.rotation = y
)

set animate off


Hope this helps.
0 Likes