'
' Animate a path-constrained null. Then, copy and paste this
' animation onto another (unanimated) path-constrained null.
'
dim oCircle1,oCircle2,oColl
dim oNull1,oNull2
'
' Create two ellipses and put them side by side.
'
set oCircle1 = CreatePrim("Circle", "NurbsCurve")
Rotate oCircle1, 90, 0, 0, siRelative, siAdd, siObj, siXYZ
Scale oCircle1, 1, 0.25, 1, siRelative, siLocal, siObj, siXYZ
'Make a duplicate copy of the circle.
set oColl = Duplicate(oCircle1, 1 , _
siDuplicateHistory, _
siSharedParent, _
siShareGrouping, _
siDuplicateProperties, _
siDuplicateAnimation, _
siShareConstraints, _
siSetSelection, _
siApplyRepeatXForm)
'Get the duplicated circle
set oCircle2 = oColl(0)
'Separate the circles
Translate oCircle1 , 0, 0, -2, siAbsolute, siView, siObj, siXYZ
Translate oCircle2 , 0, 0, 2, siAbsolute, siView, siObj, siXYZ
'
' ApplyPath will path-constrain the null to the circle and animate it
' to travel the entire length of the curve. Copy this animation.
'
set oNull1 = GetPrim("Null")
ApplyPath oNull1, oCircle1, 1, 100, 2, False, False
CopyAllAnimation2 oNull1, siAnySource, siAllParam, False
'
' Create a second null, apply a path constraint
' (no animation), then paste the animation from oNull1
'
set oNull2 = GetPrim("Null")
ApplyCns "Path", oNull2, oCircle2
PasteAllAnimation oNull2
'
' show the constraint relation in top view of viewport A
'
SetValue "Views.ViewA.TopCamera.camvis.*constraint*", True
'
' Play animation to show that it has been copied
'
PlayForwardsFromStart |