Python - Set Take render state
-
-
Okay I searched for the wrong terms I think. I found it:
TakeName.SetChecked(True)
-
Hey @j_vogel,
thank you for reaching out to us. Yes, that is how you do it. Please remember to consolidate your posting in the future (you should edit your initial posting until we have answered).
Cheers,
FerdinandResult
Code
"""Demonstrates how to iterate over takes and toggle their state. This example requires Cinema 4D 2025.0 or higher. """ import c4d import mxutils from c4d.modules.takesystem import TakeData, BaseTake doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`. def main() -> None: """Called by Cinema 4D when the script is being executed. """ data: TakeData = mxutils.CheckType(doc.GetTakeData()) root: BaseTake = data.GetMainTake() take: BaseTake for take in mxutils.IterateTree(root): old: bool = take.IsChecked() take.SetChecked(not old) print(f"Take: {take.GetName()}, Old State: {old}, New State: {not old}") c4d.EventAdd() if __name__ == '__main__': main()
-
@ferdinand Okay I will do it in the future. Thanks for the code snippet, always helps to learn!