Hi,
I currently work on a script that would allow automatic retargeting of skeletal meshes.
I have two skeletons with the same naming convention, i match the position of the bones and then lock my rigged skeleton to the mocap skeleton via Constraint tag with PSR enabled.
The problem is: when in the PSR section of the constraint tag, i need to manually set the targets for each obejct.
I have started writing a script, but dont know how to set a target via code. Also could not find it in the MAXON Python SDK.
def GetNextObject(op):
if op==None:
return None
if op.GetDown():
return op.GetDown()
while not op.GetNext() and op.GetUp():
op = op.GetUp()
return op.GetNext()
def IterateHierarchy(op):
doc = c4d.documents.GetActiveDocument() # Get active Cinema 4D document
if op is None:
return
while op:
tags = op.GetTags() # Get tags of object
for t in tags: # Loop Through tags
if t.GetType() == 50045 and t = [c4d.ID_CA_CONSTRAINT_TAG_PSR] = True: # If tag is a constraint tag
name = op.GetName()
This is how far i got with some script bashing - Im saving the name of the object with a given tag, and would like to later aplly an object with a different tag and same name as a target in my PSR constraint tag. Im new to python.
Would be great if somebody could help me:)
Thanks,
Pio