from pyfbsdk import *
lCube=FBFindModelByName("Cube")
if not lCube:
lCube=FBModelCube("Cube")
lCube.Show = True
if not lCube.Visibility.IsAnimated():
lCube.Visibility.SetAnimated(True)
if not lCube.Visibility.IsFocused():
lCube.Visibility.SetFocus(True)
lUndo = FBUndoManager()
lUndo.TransactionBegin("vis1")
lUndo.TransactionAddModelTRS(lCube)
lCube.Visibility.GetAnimationNode ().KeyAdd(FBTime(3,3,3,0),True)
lUndo.TransactionEnd()
lUndo.TransactionBegin("vis2")
lUndo.TransactionAddModelTRS(lCube)
lCube.Visibility.GetAnimationNode ().KeyAdd(FBTime(0,0,0,10),True)
lUndo.TransactionEnd()
lUndo.TransactionBegin("vis3")
lUndo.TransactionAddModelTRS(lCube)
lCube.Visibility.GetAnimationNode ().KeyAdd(FBTime(0,0,0,11),False)
lUndo.TransactionEnd()
lUndo.TransactionBegin("vis4")
lUndo.TransactionAddModelTRS(lCube)
lCube.Visibility.GetAnimationNode ().KeyAdd(FBTime(0,0,0,20),False)
lUndo.TransactionEnd()
lUndo.TransactionBegin("vis5")
lUndo.TransactionAddModelTRS(lCube)
lCube.Visibility.GetAnimationNode ().KeyAdd(FBTime(0,0,0,21),True)
lUndo.TransactionEnd()
lUndo.TransactionBegin("vis6")
lUndo.TransactionAddModelTRS(lCube)
lCube.Visibility.GetAnimationNode ().KeyAdd(FBTime(0,0,0,30),True)
lUndo.TransactionEnd()
lUndo.TransactionBegin("vis7")
lUndo.TransactionAddModelTRS(lCube)
lCube.Visibility.GetAnimationNode ().KeyAdd(FBTime(0,0,0,31),False)
lUndo.TransactionEnd()
lUndo.TransactionBegin("vis8")
lUndo.TransactionAddModelTRS(lCube)
lCube.Visibility.GetAnimationNode ().KeyAdd(FBTime(0,0,0,40),False)
lUndo.TransactionEnd()