Hi, Donovan thanks for reaching us.
The mystery variable is actually an int flag to retrieve if the user cancels the PickSession or not.
def OnPick(flags, active, multi):
if flags & c4d.PICKSESSION_FLAG_CANCELED:
print "User cancel"
print "active: ", active
print "multi: ", multi
def main():
doc.StartPickSession(OnPick, multi=True)
No there is no way.
Actually nothing, it's up to you to detect when the user cancels with PICKSESSION_FLAG_CANCELED and do whatever you want. Cinema 4D handle automatically undo. But you can call BaseDocument.GetSelection before and BaseDocument.SetSelection after if the user cancels the pick session)
Finally, note the C++ version offer to adds userdata ( For more information please read the C++ documentation https://developers.maxon.net/docs/cpp/2023_2/struct_pick_session_data_struct.html)
If you have any question, please let me know.
Cheers,
Maxime.