Hello! @ferdinand
Proud to be a part of the community.
Wow, how close the solution to the problem was, but I couldn't find any mention of it anywhere.
Thank you so much for the ready-made solution and quick help!
Hello! @ferdinand
Proud to be a part of the community.
Wow, how close the solution to the problem was, but I couldn't find any mention of it anywhere.
Thank you so much for the ready-made solution and quick help!
Hi everyone!
I'm trying to set up the constraint tag, so this will pick the movement from another object. I need to do it strictly with Transform Constraint Tag.
I was playing around with code and different parameters, but one is driving me crazy, I just can't figure out how to set an object as a target. Likewise, I used SearchObject, I got GUID nothing is going to help.
I digged through the forums and found out that the UI ID of the target matters (10001), but I find no samples how to use the ID properly in Python scripts. Appreciate any help!
I work on Windows 11
Cinema 4D 2023.2.2
import c4d
from c4d import gui
doc = c4d.documents.GetActiveDocument()
target_obj = doc.SearchObject("Test")
def addConstraint():
objects = doc.GetActiveObjects(1)
print(objects)
my_obj = doc.SearchObject("Test")
for obj in objects:
tag = obj.MakeTag(c4d.Tcaconstraint)
print(f"Your tag: {tag}")
my_obj = doc.SearchObject("Test")
tag()[c4d.ID_CA_CONSTRAINT_TAG_PSR] = True
tag()[c4d.ID_CA_CONSTRAINT_TAG_PSR_LINK] = my_obj
tag()[c4d.ID_CA_CONSTRAINT_TAG_PSR_P_OFFSET] = c4d.Vector(5,0,0)
tag()[c4d.ID_CA_CONSTRAINT_TAG_PSR_MAINTAIN] = True
tag.SetName("Boo")
c4d.EventAdd()
addConstraint()