'
' This example illustrates how to use the Offload method on an ActionSource
'
NewScene , false
set oRoot = Application.ActiveProject.ActiveScene.Root
' These commands were cut-and-pasted from scripting history and modified to work in a
' script. They create a simple actionsource from animation on the null's position
set oNull = oRoot.AddNull
strPosParams = oNull & ".kine.local.posx," & oNull & ".kine.local.posy," & oNull & ".kine.local.posz"
Translate oNull, -8.153, 7.015, -0.702, siRelative, siView, siObj, siXYZ
SaveKey strPosParams, 1.000
Translate oNull, 8.350, -8.935, 0.894, siRelative, siView, siObj, siXYZ
SaveKey strPosParams, 50.000
Translate oNull, 9.413, 8.935, -0.894, siRelative, siView, siObj, siXYZ
SaveKey strPosParams, 100.000
' Create a new model so that we can have another null called "null"
set oModel = oRoot.AddModel(,"Model")
' Create a new ActionSource
set oActionSource = oModel.AddActionSource("MyActionSource")
' Use the fcurves on the null object to create the actionsource items
set oPosx = oNull.Posx
set oPosy = oNull.Posy
set oPosz = oNull.Posz
oActionSource.AddSourceItem oPosx.FullName, oPosx.Source
oActionSource.AddSourceItem oPosy.FullName, oPosy.Source
oActionSource.AddSourceItem oPosz.FullName, oPosz.Source
' Create a new null
set oNull2 = oModel.AddNull( "null" )
' Set the action storage to external (text)
SetValue oActionSource & ".storage", 2
' Add a clip for the source
AddClip "Model", "Sources.Animation.Model.MyActionSource", , , 16, , , , false
' Offload the sources
oActionSource.Offload |