Get MODATA_FLAGS data [SOLVED]

On 04/11/2015 at 10:00, xxxxxxxx wrote:

Hello,

How can I call MODATA_FLAGS data? I'm trying to check with python effector is the clone visible or not.

  
def main() :  
  
  md = mo.GeGetMoData(op)  
  if md==None: return False  
   
  cnt = md.GetCount()  
  marr = md.GetArray(c4d.MODATA_MATRIX)  
  farr = md.GetArray(c4d.MODATA_FLAGS)  
    
  for i in xrange(cnt) :  
      if (farr(c4d.MOGENFLAG_CLONE_ON)) :  
          marr[i].Scale(1)  

I get "TypeError: 'list' object is not callable"

On 04/11/2015 at 10:19, xxxxxxxx wrote:

  
if farr[i] == 1:  

:neutral_face:

On 05/11/2015 at 01:22, xxxxxxxx wrote:

Hello,

MODATA_FLAGS stores a bit mask. You find an example on how to edit the bits in the "Push Apart Effector" example. You also find symbols for the bits in the documentation.

A simple effector that hides every second clone could look like this:

  
md = mo.GeGetMoData(op)  
if md is None: return False  
  
farr = md.GetArray(c4d.MODATA_FLAGS)  
cnt = md.GetCount()  
  
for i in xrange(0, cnt) :  
     if i % 2 == 1:  
             farr[i] &= ~(c4d.MOGENFLAG_CLONE_ON)  
               
md.SetArray(c4d.MODATA_FLAGS, farr, True)  

You find more information on bit manipulation in the Python Wiki.

best wishes,
Sebastian

On 13/11/2015 at 09:37, xxxxxxxx wrote:

Hello aturtur,

was your question answered?

Best wishes,
Sebastian

On 18/11/2015 at 11:43, xxxxxxxx wrote:

Yes, thank you!