Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Here we will discuss how to properly link and load the AppSDK App SDK and V-Ray dynamic libraries.

UI Text Box
typenote

 Where we refer to .dll files for Windows, just treat this as lib.so or lib*.dylib for Linux and macOS.

...


There are four DLL files or groups that need to be loaded at various stages:

...

You can use a static method to add a search path for VRaySDKLibrary.dll if it is not in the system PATH. You have to do this before calling any other AppSDK App SDK methods.

.Net

Use Globals.SetSDKLibraryPath(search_path).

...

The directory containing vray.dll and the other DLLs from the original AppSDK App SDK bin directory needs to be on the system library search path (PATH on Windows, LD_LIBRARY_PATH on Linux, DYLD_LIBRARY_PATH). The VRAY_PATH environment variable can be set to an alternative location.

...

You should make sure that the respective runtime or a compatible one is available where you deploy the SDK. Currently the AppSDK App SDK is built using:

Fancy Bullets
  • The Visual Studio 2017 runtime on Windows (vcruntime140.dll, msvcp140.dll)
  • glibc 2.17 on Linux
  • macOS SDK 10.9 (macOS x64)
  • macOS SDK 11.1 (macOS universal, with support for macOS 10.14 and higher)

...

Tabs Container
directionhorizontal
Tabs Page
titlePython
Code Block
languagepy
# The directory containing the vray shared object - vray.pyd/so - should be present in the PYTHONPATH environment variable
import vray
renderer = vray.VRayRenderer()
Tabs Page
titleC++
Code Block
languagecpp
// link against VRaySDKLibrary.lib or with -lVRaySDKLibrary and have VRaySDKLibrary accessible through the OS library path
#include "vraysdk.hpp"

void main() {
    VRay::VRayInit init(NULL, true);
    VRay::VRayRenderer renderer;
}
Tabs Page
titleC#.NET
Code Block
languagec#
// VRaySDK.Net.dll has a reference in the current .csproj
using VRay;
class Program {
    static void Main(string[] args) {
        VRayRenderer renderer = new VRayRenderer();
    }
} 
Tabs Page
titleNode.js
Code Block
languagejs
// vray.js is in node_modules with the rest of the files from the App AppSDKSDK package
var vray = require('vray');
var renderer = vray.VRayRenderer(); 

...

Tabs Container
directionhorizontal
Tabs Page
titlePython
Code Block
languagepy
# The directory containing the vray shared object - vray.pyd/so - should be present in the PYTHONPATH environment variable
import vray
# These paths are optional. Only pass them if it is necessary for your project
# You have to call this before any other API methods
vray.setSDKLibraryPath("/some/path") # vray.dll should be here or on the OS path
renderer = vray.VRayRenderer(pluginLibraryPath="/some/other/path")
Tabs Page
titleC++
Code Block
languagecpp
// main.cpp
#define VRAY_RUNTIME_LOAD_PRIMARY
#include "vraysdk.hpp"
 
void main() {
    // These paths are optional. Only pass them if it is necessary for your project
    // You have to call this before any other API methods
    VRay::VRayInit init("C:/some/path/VRaySDKLibrary.dll", true); // vray.dll should be here or on the OS path
    VRay::RendererOptions options;
    options.pluginLibraryPath = "C:/some/other/path";
    VRay::VRayRenderer renderer(options);
}
 
------------------------
// other.cpp
#define VRAY_RUNTIME_LOAD_SECONDARY
#include "vraysdk.hpp"
Tabs Page
titleC#.NET
Code Block
languagec#
// VRaySDK.Net.dll has a reference in the current .csproj
using VRay;

class Program {
    static void Main(string[] args) {
        // These paths are optional. Only pass them if it is necessary for your project
        // You have to call this before any other API methods
        Globals.SetSDKLibraryPath("C:/some/path"); // vray.dll should be here or on the OS path
        RendererOptions options = new RendererOptions();
        options.PluginLibraryPath = "C:/some/other/path";
        VRayRenderer renderer = new VRayRenderer(options);
    }
}
Tabs Page
titleNode.js
Code Block
languagejs
// vray.js is in node_modules with the rest of the files from the AppSDKApp SDK package
var vray = require('vray');
// These paths are optional. Only pass them if it is necessary for your project
// You have to call this before any other API methods
vray.setSDKLibraryPath("/some/path"); // vray.dll should be here or on the OS path
var renderer = vray.VRayRenderer({ "pluginLibraryPath": "/some/other/path" });

...