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

    Function when Plugin is Loaded

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 378 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 11/09/2012 at 14:54, xxxxxxxx wrote:

      Is there a function that is only called when a plugin is loaded in a scene?  For example I have a generator object plugin that when it loads I want it to insert to other objects into the scene.  Is there a function to do that or should I be using a command plugin?

      Dan

      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 11/09/2012 at 15:01, xxxxxxxx wrote:

        I take it you mean when a plugin is created in a scene, not loaded when a scene file loads? When an ObjectData plugin like a generator is created, the Init() function is called. You could do this there.

        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 11/09/2012 at 15:06, xxxxxxxx wrote:

          MSG_MENUPREPARE is a message sent when the object was initially created. Init() is called more often (for example for Undo steps).

          -Niklas

          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 12/09/2012 at 08:49, xxxxxxxx wrote:

            Thanks Spedler and Niklas.

            Yes, I meant when loaded into a scene, I should have classified that.  That's the problem I ran into Niklas, the Init() was called frequently, thanks for answer.

            Dan

            Edit:  I don't want to make a new thread, but i have another question.  Are global variables declared within a plugin  shared between all instances of that plugin in the same scene?  It seems to be that way from what I see.   I'm checking if two link fields are filled and if they are I want to grey out a button.  If I have two instances of the plugin in the scene and one has an empty field they are both counted as missing one.   If that's how global variables are handled is there a way to declare a valuable that all functions in that plugin can access it but each instance of the plugin has there own?  I hope that makes sense.

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