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

    Catching when an ID collision occurs

    Cinema 4D SDK
    c++ sdk
    3
    5
    566
    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.
    • D
      d_schmidt
      last edited by

      Hello,

      If there is a ID collision with a plugin, if you have a duplicate of a plugin for example, is it possible to somehow catch when an ID collision occurs?

      With something I'm working on there might be multiple versions, a demo for example, and I'd want that to use the same ID, so saved files could carry over, but I'd want to alert the user if they had the demo and the full version installed at the same time.

      Thanks,
      Dan

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        Hi,

        before registering your plugin in PluginStart, you can use FindPlugin with your plugin ID.

        Another solution is to just use GetModulePaths and see if your modules is there twice. (maybe using some filename that are hardcoded)

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • ferdinandF
          ferdinand
          last edited by

          Hi,

          for the FindPlugin approach your plugin initialisation priorities should be correct though, so that you can load them in the correct order. Or alternatively you would have to check crosswise in both plugins if one of the others already has been loaded.

          See here and here for details.

          Cheers,
          zipit

          MAXON SDK Specialist
          developers.maxon.net

          1 Reply Last reply Reply Quote 2
          • ManuelM
            Manuel
            last edited by Manuel

            thanks a lot @zipit

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • D
              d_schmidt
              last edited by

              Thanks, this is exactly what I needed!

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