InExcludeData - GetFlags returns always 1



  • 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()
    


  • 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



  • 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,



  • 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



  • 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



  • 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



  • 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 .. :o

    Thanks,
    Niklas



  • 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


Log in to reply