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

    Get selected Mograph

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 400 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 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) 
      

      __

      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 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).

        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 17/11/2011 at 00:36, xxxxxxxx wrote:

          That all very useful stuff

          many thanks

          Paul

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