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

    How to reload the resource? [CLOSED]

    SDK Help
    0
    5
    465
    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
      Helper
      last edited by

      On 09/07/2015 at 09:17, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :

      ---------
      Hi! How can we reload the resource of a plugin library so that it will affect the registered plugins? There's
      GeResource::ReloadResource(), but that does not seem to work the way I expected it to.

      Bool PluginMessage(Int32 type, void* pData)
      {
      	switch (type) {
      		case C4DPL_INIT_SYS:
      			return ::resource.Init();
      		case MSGPL_RELOADRESOURCE:
      			GePrint("Reloading Resource");
      			return ::resource.ReloadResource();
      	}
      	return false;
      }
      
      import c4d
      MSGPL_RELOADRESOURCE = 1035545
      c4d.GePluginMessage(MSGPL_RELOADRESOURCE, None)
      

      The message is received when I run the Python script, but the reload does not seem to have any effect.
      Description resources are still the same as they were loaded the first time the plugin object was created.
      My goal is to not require to close and re-open Cinema 4D for every change to the description resource.

      Thanks!
      Niklas

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 10/07/2015 at 05:08, xxxxxxxx wrote:

        Hi Niklas,

        ReloadResource() is not only marked private, but we also need to strongly disadvise using this function. It could have potentially harmful effects.
        Even worse, I'm not aware of any option to reload descriptions. Sorry.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 10/07/2015 at 05:45, xxxxxxxx wrote:

          you have to use GetDDescription()

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 11/07/2015 at 06:27, xxxxxxxx wrote:

            Hi! I somehow thought that descriptions would be reloaded for Python
            Plugins when you "Reload Python Plugins". But that only counts for
            dialog resources 🙂 Is there a way at least to reload them for C++ plugins
            as well? Since you disadvise me to use ReloadResource(), I don't see
            another way, besides maybe calling Init()?

            Thanks,
            Niklas

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 13/07/2015 at 04:48, xxxxxxxx wrote:

              Sorry, Niklas, we are not aware there's any option to reload description resources. 😢

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