|
Hi,
This is the code to create the three nodes you need and how to hook them up. If you have pre-existing nodes you would need to define them and plug them back into this code. Hope it helps…
#CREATE RELATION CONSTRAINT
RollRelation = FBConstraintRelation( ‘RollDriverRelation’ )
#CREATE NODES
SenderBox = RollRelation.SetAsSource( yourSource ) #You need to give your source
RollRelation.SetBoxPosition( SenderBox, 30, 30 )
ConvertBox = RollRelation.CreateFunctionBox( ‘Converters’, ‘Number to Vector’ )
RollRelation.SetBoxPosition( ConvertBox, 400, 30 )
ResultBox = RollRelation.ConstrainObject( yourReceiver) #You need to give your receiver
RollRelation.SetBoxPosition( ResultBox, 700, 30)
ResultBox.UseGlobalTransforms = False # makes translation/rotation local “Lcl”
#POPULATE CONSTRAINT (LINK THEM UP)
SenderOut = FindAnimationNode( SenderBox.AnimationNodeOutGet(), ‘->you fill in<-’ )
ConvertIn = FindAnimationNode( ConvertBox.AnimationNodeInGet(), ‘Y’ )
if SenderOut and ConvertIn: #This checks to make sure everything is there to hook up
FBConnect( SenderOut, ConvertIn )
ConvertOut = FindAnimationNode( ConvertBox.AnimationNodeOutGet(), ‘Result’ )
ResultIn = FindAnimationNode( ResultBox.AnimationNodeInGet(), ‘Lcl Rotation’ )
if ConvertOut and ResultIn:
FBConnect( ConvertOut, ResultIn )
#TURN THE CONSTRAINT ON
RollRelation.Active = True
Author: Newt Zac
|