Hello,
I need to setup twist joints (these are leaf joints) in MB using Relation constraints. I know how to set these up manually but hit a wall when doing so through python. Here is a screen grab from the constraint settings of the manual approach:
Notice I’m using a Vector to numbers and a multiply node.
Note: I can already create a relation constraint through Python (seen belwo) but have problems adding the settings. example of the code below:
def create_relation_constraint(self, objParent, objChild, constraint_name, offset = True):
"""
Description: Creates a relation constraint!
"""
##Create "Relation" Constraint
for i in range( FBConstraintManager().TypeGetCount() ):
if "Relation" in FBConstraintManager().TypeGetName(i):
lMyConstraint = FBConstraintManager().TypeCreateConstraint(i)
#for index, element in enumerate(selected_objects):
#lMyConstraint.ReferenceAdd (0, objChild)
#lMyConstraint.ReferenceAdd (1, objParent)
#Snap if user desires
if offset == True:
lMyConstraint.Snap()
#weight of the constraint
lMyConstraint.Weight = 100
##Activate Constraint
lMyConstraint.Active = True
lMyConstraint.Name = "{0}_Relation".format(constraint_name)
return lMyConstraint # Returns FBConstraintRelation
Example of the following commands would really help:
*How to add Sender and Reciever joints. How do you set these to relative and not global.
*How to add and connect the nodes shown in the diagram.
Any help would be great.
Thanks