Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    InExclude detect 'Remove All' context menu command

    Cinema 4D SDK
    python
    2
    3
    457
    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.
    • mikeudinM
      mikeudin
      last edited by

      Hello!

      1. With MSG_DESCRIPTION_INEX_DELETED we can detect deleting InExclude item event. But in case choosing 'Remove All' context menu command it is not working? How to fix that?
        Thank you!

      Screenshot 2023-02-07 at 17.05.52.png

      Checkout my python tutorials, plugins, scripts, xpresso presets and more
      https://mikeudin.net

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @mikeudin
        last edited by ferdinand

        Hey @mikeudin,

        Thank you for reaching out to us. Just as an FYI, I did delete the duplicate thread. There is no message for that. The best option is to listen for c4d.MSG_DESCRIPTION_CHECKUPDATE which will be emitted when you invoke the command.

        These are all the message IDs which are emitted when one invokes "Remove All":

        1028476
        1041699
        16
        17  // MSG_DESCRIPTION_CHECKUPDATE
        19
        20
        200000169
        31
        431000094
        440000249
        

        MSG_DESCRIPTION_CHECKUPDATE is one of the better message IDs to piggy-back on here, but you could also pick another one. You can look up the message symbol for an integer most easily in Message Manual: Plugin Messages.

        Cheers,
        Ferdinand

        Result:
        message.gif

        I used this code:

        import c4d
        
        op: c4d.BaseObject
        
        def main() -> c4d.BaseObject:
            return c4d.BaseObject(c4d.Onull)
        
        def message(mid, data) -> bool:
            if mid == c4d.MSG_DESCRIPTION_INEX_DELETED:
                print (mid, data)
            elif mid == c4d.MSG_DESCRIPTION_CHECKUPDATE:
                data = op[c4d.ID_USERDATA, 1]
                print (f"{data.GetObjectCount() =  }")
            else:
                # print ("ID/DATA", mid, data)
                pass
            return True
        

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • mikeudinM
          mikeudin
          last edited by

          Thank you @ferdinand ! 👏 Will chek it!

          Checkout my python tutorials, plugins, scripts, xpresso presets and more
          https://mikeudin.net

          1 Reply Last reply Reply Quote 0
          • M m_adam referenced this topic on
          • First post
            Last post