Hello everyone,
I want to hide an object from a cloner, I test in a python effector and work well , but in a python tag in didn't work anymore . what is wrong with the codes?
from typing import Optional
import c4d
doc: c4d.documents.BaseDocument # The document evaluating this tag
op: c4d.BaseTag # The Python scripting tag
flags: int # c4d.EXECUTIONFLAGS
priority: int # c4d.EXECUTIONPRIORITY
tp: Optional[c4d.modules.thinkingparticles.TP_MasterSystem] # Particle system
thread: Optional[c4d.threading.BaseThread] # The thread executing this tag
def main() -> None:
obj = op.GetObject()
moData = c4d.modules.mograph.GeGetMoData(obj)
if moData is None:
return False
cnt = moData.GetCount()
marr = moData.GetArray(c4d.MODATA_MATRIX)
farr = moData.GetArray(c4d.MODATA_FLAGS)
#hasField = op[c4d.FIELDS].HasContent()
#fall = moData.GetFalloffs()
farr[4] &= ~ (c4d.MOGENFLAG_CLONE_ON)
moData.SetArray(c4d.MODATA_FLAGS, farr, 0)
moData.SetArray(c4d.MODATA_MATRIX, marr, 0)
Cheers~
DunHou