THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/11/2012 at 06:42, xxxxxxxx wrote:
Hi there,
I working in a smal plugin tag that switches the object it is asigned to to invisible or to visible. everything is working but:
if I , for example, have 2 cubes in a scene. and i put the tag on one of them everything is fine. if I put the tag on both of them the tag only works for one cube (the one that is highest in the object manager). the other one is not affected. of corse I am missing something.. but obviosly I dont know what ;.(
so my init is this:
def Init(self, node) :
tag = node
data = tag.GetDataInstance()
# set camera dependent
priority=c4d.PriorityData()
priority.SetPriorityValue(c4d.PRIORITYVALUE_CAMERADEPENDENT,True)
node[c4d.EXPRESSION_PRIORITY]=priority
# put in values for the user data
data.SetBool(TIMELINEONOFF, True)
data.SetBool(CAMONOFF, True)
return True
my execute is something like this (shorted)
def Execute(self, tag, doc, op, bt, priority, flags) :
visible = 1
# set visibility
if visible == 0:
op[c4d.ID_BASEOBJECT_VISIBILITY_EDITOR]=1
else:
op[c4d.ID_BASEOBJECT_VISIBILITY_EDITOR]=2
and my register is this:
okyn = plugins.RegisterTagPlugin(id=PLUGIN_ID, str="FS_preview_acelerator", info=c4d.TAG_VISIBLE|c4d.TAG_EXPRESSION, g=fs_pa, description="fs_pa", icon=bmp)
print "fs_preview_accelerator initialized, v01: ", okyn
commends ar highly welcome