Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Get MODATA_FLAGS data [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 501 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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"

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

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

          
        if farr[i] == 1:  
        

        😐

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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.

          • BitwiseOperators
          • BitManipulation

          best wishes,
          Sebastian

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

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

            Hello aturtur,

            was your question answered?

            Best wishes,
            Sebastian

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

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

              Yes, thank you!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post