Get selected Mograph



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

    On 16/11/2011 at 10:28, xxxxxxxx wrote:

    Trying to get my head back into Python again

    Is there a way to tell if a Mograph clone is part of a selection set?

    And..
    Is there a simpler explanation of what going on here
    Last item below looks like some sort of bit operation?

    #flag list of clones
    farr = md.GetArray(c4d.MODATA_FLAGS)
    if hide==0: #hide the clone (from push apart example)
    farr &= ~(1<<0) 
    

    __



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

    On 17/11/2011 at 00:11, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Is there a way to tell if a Mograph clone is part of a selection set?

    Looping through the selection set you could call GetType() for each object and compare the result with the ID of the Mograph Clone (1018544).
    There's no name ID for it so just use directly the number ID (see this post).

    Originally posted by xxxxxxxx

    Is there a simpler explanation of what going on here
    Last item below looks like some sort of bit operation?

    #flag list of clones
    farr = md.GetArray(c4d.MODATA_FLAGS)
    if hide==0: #hide the clone (from push apart example)
    farr &= ~(1<<0) 
    

    __

    (1<<0) is the MDARRAYFLAG_NOTSEENBYEFFECTOR flag (defined in c4d_baseeffectordata.h) to tell if the data is seen and modified by the Effector.
    And the line

    farr &= ~(1<<0) 
    

    removes this flag.

    About the push appart effector you should read this thread on CGTalk (if not done yet but I think the flag operations are pretty well explained by Per here and here).



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

    On 17/11/2011 at 00:36, xxxxxxxx wrote:

    That all very useful stuff

    many thanks

    Paul


Log in to reply