RelationConstraint + integer

RelationConstraint + integer

ztravnicky
Enthusiast Enthusiast
681 Views
2 Replies
Message 1 of 3

RelationConstraint + integer

ztravnicky
Enthusiast
Enthusiast

Hi everyone,

 

if I create integerBox in Relation Constraint, how do I set some value into input 'a' ?

 

lAbsDampFacBox = lConstraintRelation.CreateFunctionBox( 'Number', 'Integer' )

lConstraintRelation.SetBoxPosition( lAbsDampFacBox, -250, -50 )

 

I was trying ...

lAbsDampFacBoxIn = FindAnimationNode( lAbsDampFacBox.AnimationNodeInGet(), 'a' )

lAbsDampFacBoxIn.Add = int(80)

 

and many others approaches, but no success. 😞

 

Zbynek

0 Likes
Accepted solutions (1)
682 Views
2 Replies
Replies (2)
Message 2 of 3

ztravnicky
Enthusiast
Enthusiast
0 Likes
Message 3 of 3

stevkalinowski
Contributor
Contributor
Accepted solution

[code]
def FindAnimationNode(pAnimNode, pPlugName):
   for a in pAnimNode.Nodes:
      if a.Name == pPlugName:
         return a

   return None

 

lConstraintRelation = FBConstraintRelation('StaticDataRelation')
lAbsDampFacBox = lConstraintRelation.CreateFunctionBox( 'Number', 'Integer' )
lConstraintRelation.SetBoxPosition( lAbsDampFacBox, -250, -50 )

lAbsDampFacBoxIn = FindAnimationNode( lAbsDampFacBox.AnimationNodeInGet(), 'a' )
lAbsDampFacBoxIn.WriteData( [80] )

[/code]

 

When calling the "WriteData" method, you have to put the arg in a list.  I'm not certain why.

0 Likes