Community
from pyfbsdk import *
################################
def FindAnimationNode( pParent, pName ):
lResult = None
for lNode in pParent.Nodes:
if lNode.Name == pName:
lResult = lNode
break
return lResult
################################
def createSourceBox (sourceObj):
sourceBox = lConstraintRelation.SetAsSource (sourceObj)
return sourceBox
###############################
def createTargetBox (targetObj):
targetBox = lConstraintRelation.ConstrainObject (targetObj)
return targetBox
###############################
def connectThem (sourceBox, sourceChannel, targetBox, targetChannel):
OUT = FindAnimationNode (sourceBox.AnimationNodeOutGet(),sourceChannel)
IN = FindAnimationNode (targetBox.AnimationNodeInGet(),targetChannel)
FBConnect (OUT, IN)
###############################
lConstraintRelation = FBConstraintRelation('Test')
myBox = FBModelMarker('My_Box')
myBox.Show = True
myBox.PropertyCreate('Test', FBPropertyType.kFBPT_int, 'Integer', True, True, None)
myBox1 = FBModelMarker('My_Box1')
myBox1.Show = True
myBox1.PropertyCreate('Test', FBPropertyType.kFBPT_int, 'Integer', True, True, None)
x = createSourceBox (myBox)
y = createTargetBox (myBox1)
connectThem (x, 'Rotation', y, 'Rotation')
connectThem (x, 'Translation', y, 'Translation')
connectThem (x, 'Test', y, 'Test')
connectThem (x, 'Translation', y, 'Translation')
lConstraintRelation = FBConstraintRelation('Test')
myBox = FBModelMarker('My_Box')
myBox.Show = True
lBoxProp = myBox.PropertyCreate('Test', FBPropertyType.kFBPT_int, 'Integer', True, True, None)
# Set the new property to Animatable
lBoxProp.SetAnimated(True)
myBox1 = FBModelMarker('My_Box1')
myBox1.Show = True
lBoxProp1 = myBox1.PropertyCreate('Test', FBPropertyType.kFBPT_int, 'Integer', True, True, None)
# Set the new property to Animatable
lBoxProp1.SetAnimated(True)
x = createSourceBox (myBox)
y = createTargetBox (myBox1)
connectThem (x, 'Rotation', y, 'Rotation')
connectThem (x, 'Translation', y, 'Translation')
connectThem (x, 'Test', y, 'Test')
myBox = FBModelMarker('My_Box')
myBox.Show = True
myBox.PropertyCreate('Test', FBPropertyType.kFBPT_int, 'Integer', True, True, None)
editProperty = myBox.PropertyList.Find('Test')
editProperty.SetAnimated(True)
Can't find what you're looking for? Ask the community or share your knowledge.