1
2
3
4
5
6
7
8from pyfbsdk import FBConstraintRelation, FBModelMarker, FBConnect
9
10
11
12def FindAnimationNode( pParent, pName ):
13 lResult = None
14 for lNode in pParent.Nodes:
15 if lNode.Name == pName:
16 lResult = lNode
17 break
18 return lResult
19
20
22
23
25lModel.Translation.SetAnimated(True)
26lModel.Visible = True
27
28
29lSineRampBox = lConstraintRelation.CreateFunctionBox( 'Sources', 'Sine Ramp' )
30lConstraintRelation.SetBoxPosition( lSineRampBox, 30, 30 )
31
32
33lNumberToVectorBox = lConstraintRelation.CreateFunctionBox( 'Converters', 'Number to Vector' )
34lConstraintRelation.SetBoxPosition( lNumberToVectorBox, 400, 30 )
35
36
37lPlaceHolderBox = lConstraintRelation.ConstrainObject( lModel )
38lConstraintRelation.SetBoxPosition(lPlaceHolderBox, 700, 30)
39
40
41
42
43
44lSineRampOut = FindAnimationNode( lSineRampBox.AnimationNodeOutGet(), 'Result' )
45lNumberToVectorIn = FindAnimationNode( lNumberToVectorBox.AnimationNodeInGet(), 'Y' )
46if lSineRampOut and lNumberToVectorIn:
47 FBConnect( lSineRampOut, lNumberToVectorIn )
48
49
50lNumberToVectorOut = FindAnimationNode( lNumberToVectorBox.AnimationNodeOutGet(), 'Result' )
51lModelIn = FindAnimationNode( lPlaceHolderBox.AnimationNodeInGet(), 'Translation' )
52if lNumberToVectorOut and lModelIn:
53 FBConnect( lNumberToVectorOut, lModelIn )
54
55
56lConstraintRelation.Active = True
57
58
59del( lModelIn, lNumberToVectorOut, lNumberToVectorIn, lSineRampOut, lPlaceHolderBox, lNumberToVectorBox, lSineRampBox, lModel, lConstraintRelation )
60
61
62del( FindAnimationNode )
63
64
65del( FBConstraintRelation, FBModelMarker, FBConnect )
ConstraintRelation class.
Definition: pyfbsdk_generated.h:5087
Model marker class.
Definition: pyfbsdk_generated.h:11380