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
    • Recent
    • Tags
    • Users
    • Login

    Plugin load priority

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 274 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 15/12/2008 at 09:19, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R10-11 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hello All,

      i need to set a environment path variable inside my code before the plugin is loaded.
      What i need to do is to make another plugin that load before the VrayBridge.. and set this env variable.

      How i can force my plugin to load before my bridge? Is case sensitive?

      Another question: How i can set the Path variable inside cinema?

      thanks a lot
      renato

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

        Ok, is case sensitive..
        to set the env i just used the
        putenv("Path=etc/etc/etc/) 🙂

        thanks all
        renato

        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/12/2008 at 01:06, xxxxxxxx wrote:

          Is the VrayBridge another plugin?  If so, you can make your plugin load later with:

              
              
                
              //*---------------------------------------------------------------------------*  
              Bool PluginMessage(LONG id, void* data)  
              //*---------------------------------------------------------------------------*  
              {  
                  if (id == C4DPL_INIT_SYS)  
                  {  
                      // initialize global resource object  
                      if (!resource.Init())  
                          return false;  
                      return true;  
                  }  
                  else if (id == C4DMSG_PRIORITY)  
                  {  
                      // make plugin load after other plugins...  
                      SetPluginPriority(data, C4DPL_INIT_PRIORITY_PLUGINS-1);  
                      return true;  
                  }  
                  return false;  
              }  
              
          
          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/12/2008 at 04:00, xxxxxxxx wrote:

            Hello Giblet,

            i made this code to set the variable:

            > <code>
            > #include "c4d.h"
            > Bool PluginStart(void) {return TRUE; }
            >
            > void PluginEnd(void) {}
            >
            > Bool PluginMessage(LONG id, void *data)
            > {
            >      if (id==C4DMSG_PRIORITY) {
            > #ifdef _PATH32
            >           Filename path = GeGetStartupPath() + "plugins" + "Vraybridge" + "Libs32";
            > #endif
            >
            > #ifdef _PATH64
            >           Filename path = GeGetStartupPath() + "plugins" + "Vraybridge" + "Libs64";
            > #endif
            >           String pathString = "PATH=" + path.GetString();
            >           char *charPath = (char* ) GeAlloc(pathString.GetLength()+1);
            >           pathString.GetCString(charPath,pathString.GetLength()+1);
            >           int res = putenv(charPath);
            >           if (res) GePrint("Vray Path Environment Variable OK!"); else GePrint("Error set env!!!!");
            >           GeFree(charPath);
            >      }
            >      return TRUE;
            > }
            > </code>

            Cheers 🙂
            renato

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