Plugin load priority

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

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

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;  
    }  
    

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