Updating Polygon Selection Tag
Graeme last edited by
Hi there, I'm writing a script in python & I wanted to ask how I can update a polygon selection tag (Exactly as if you call the 'Select' -> 'Set Selection' command with the polygon selection tag selected).
Basically, I am Getting the C4d.BaseSelect from the c4d.SelectionTag & altering the C4d.BaseSelect - afterwards, I want to update the c4d.SelectionTag with the changes.
Here is a very simplified sample code:
curr_sel = sel_tag.GetBaseSelect()
comp_sel = comp_tag.GetBaseSelect()
Now I would like to write my modified curr_sel back to the sel_tag Polygon Selection Tag, but I don't know how.
I am prepared to select it in the interface & use CallCommand as a last resort, but it's not very elegant & I won't be able to add undos.
Thanks in advance for your help.
mp5gosu last edited by mp5gosu
since the docs say you get the selection instance by calling
GetBaseSelect(), you simply can modify the BaseSelect and update the object accordingly.
The BaseSelect itself comes with some useful functions, like CopyTo() that may do what you want.
Graeme last edited by Graeme
Firstly, thanks for your reply.
Secondly, for the Q&A, it seems like the way the forum works has updated since I last used it. I will be sure to follow the correct protocol in future.
Well, I just typed out a big answer & then I saw that you're right - the Polygon Selection Tags are already updated, without me having to do anything more !
Is there some message I should send to the tags for safety, like a MSG_CHANGE from the c4dAtom ?
r_gigante last edited by
Hi @Graeme, thanks for reaching out us.
Feel free to come with any further consideration.