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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    InExcludeData - GetFlags returns always 1

    Scheduled Pinned Locked Moved PYTHON Development
    8 Posts 0 Posters 1.1k 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 10/07/2011 at 03:29, xxxxxxxx wrote:

      Hi,

      using GetFlags() from an InExcludeData Object returns always 1.
      Or do I use it wrong ?

      """  
      Select a Fracture Object and insert some Effectors into it's  
      Effector - list.  
      """  
        
      import  c4d  
      from    c4d.documents   import GetActiveDocument  
        
      def **inExclude_getFlags** (iedata) :  
          """  
        Returns a generator generating all Flags of the Objects  
        within an InExcludeData Object.  
        """  
        for n in xrange(iedata.GetObjectCount()) :  
            yield iedata.GetFlags(n)  
        
      def **main** () :  
        doc = GetActiveDocument()  
        op  = doc.GetActiveObject()  
          
        if op is None:  
            return  
          
        for e in inExclude_getFlags(op[c4d.ID_MG_MOTIONGENERATOR_EFFECTORLIST]) :  
            print e  
        
      main()
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 10/07/2011 at 08:33, xxxxxxxx wrote:

        Hy nux,

        you have a missing parameter in your xrange() :

        for n in xrange(0,iedata.GetObjectCount()) :

        That should do it.

        Cheers,
        maxx

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 10/07/2011 at 08:50, xxxxxxxx wrote:

          the 0 is not necessary. See the PyDocs, same counts for xrange:

          range([ start ], stop [, step ])

          This is a versatile function to create lists containing arithmetic progressions. It is most often used in for loops. The arguments must be plain integers. If the step argument is omitted, it defaults to 1. If the start argument is omitted, it defaults to 0.

          But thanks anyway.

          Cheers,

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 10/07/2011 at 10:15, xxxxxxxx wrote:

            Oh, yes, right you are .

            Actually, then your code is working fine? Thought it was after my change, but it wasn't.

            So when I put in two effectors and both are enabled, output is:
            1
            1

            If I disable the first one:
            0
            1

            ...

            Not the same for you?

            Cheers,
            maxx

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

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 10/07/2011 at 10:41, xxxxxxxx wrote:

              O___o'

              No it isnt the same for me ! 🤢

              See here.

              Thanks,
              Niklas

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

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 10/07/2011 at 10:50, xxxxxxxx wrote:

                Oh, I see, it is about selections!

                I *disabled* the effector, which gave me the 0 result ...

                Let me check again 🙂

                Cheers,
                maxx

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

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 10/07/2011 at 11:04, xxxxxxxx wrote:

                  Ahhhh !! So GetFlags() is for the enabled state ? I thought for the selection state .. -.-
                  But at least, it should return a container with all possible bits .. 😮

                  Thanks,
                  Niklas

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

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    On 10/07/2011 at 11:05, xxxxxxxx wrote:

                    I think, there is no way to detect the selection-state (here I mean the selection by clicking on it and highlighting them). I don't know about any function or plugin which makes use of a selection "within" the InExclude list.

                    >> A bit field for the selection state of the object.

                    I think in this case, it means, which items are enabled and which not.

                    Cheers,
                    maxx

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