On 18/04/2017 at 03:15, xxxxxxxx wrote:
Hi,guys.
I try to create an selection effector with plain effector(as in the screenshot).I don't know how to delete xpresso tag when Idelete an polygon selection from taglist.In other words,I want to keep the counts of xpresso tags equel to the counts of taglist all the time.This is my first question.I know how to add xpresso tags according to the polygon selection in the taglist,but the xpresso tags can't be update,but I delete some xpresso tags,they can be update,I don't know how to fix it,This is my second question.
Thanks in advanced!
import c4d
def main() :
plain = op.GetObject()
taglist = plain[c4d.ID_USERDATA,1]
xptag = plain.GetTag(c4d.Texpresso,0)
cnt = taglist.GetObjectCount()
if len(plain.GetTags()) <= cnt-1:
for i in xrange(1,cnt) :
xptag1 = plain.MakeTag(c4d.Texpresso,xptag)
xptag.CopyTo(xptag1,0)
for i in xrange(cnt) :
seltag = taglist.ObjectFromIndex(doc,i)
plain.GetTag(c4d.Texpresso,i)[c4d.ID_USERDATA,1] = seltag
Thank you!
Best wishes!
Ching.