Arnold plugin for Blender

Recently had a chat with one of the developers at Autodesk, and he mentioned the Arnold-USD Hydra Delegate to me. I’ve started working on integrating it into blender but Im (once again), stuck with how to use Blender’s HydraRenderEngine.

I’ve got the ArnoldSDK working, and Arnold-USD built correctly. However, when I try linking it into Blender I’m getting this error.

Coding Error: in _Load at line 260 of /src/build_linux/deps/build/usd/src/external_usd/pxr/base/plug/plugin.cpp -- Failed to load plugin 'hdArnold': libai.so: cannot open shared object file: No such file or directory in '/home/hoske/.btoa/arnold-usd/plugin/hdArnold.so'
Coding Error: in CreateRenderDelegate at line 100 of /src/build_linux/deps/build/usd/src/external_usd/pxr/imaging/hd/rendererPluginRegistry.cpp -- Couldn't find plugin for id HdArnoldRendererPlugin

I’ve got the parent directory to libai.so in LD_LIBRARY_PATH, (as well as some other ones when I was testing). But Blender is not recognizing the library at all.

@classmethod
    def register(cls):
        import pxr.Plug
        btoa = os.path.join(os.path.expanduser("~"), ".btoa")
        arnoldsdk = os.path.join(btoa, "arnoldsdk", "Arnold-7.3.4.1-linux")
        arnoldusd = os.path.join(btoa, "arnold-usd")
        
        os.environ["ARNOLD_PLUGIN_PATH"] = os.path.join(arnoldusd, "procedural")

        os.environ["PYTHONPATH"] = os.environ.get("PYTHONPATH", "") + ":" + os.path.join(arnoldsdk, "python")
        os.environ["PXR_PLUGINPATH_NAME"] = os.environ.get("PXR_PLUGINPATH_NAME", "") + ":" + os.path.join(arnoldusd, "plugin") + ":" + os.path.join(arnoldsdk, "plugins", "usd")
        os.environ["LD_LIBRARY_PATH"] = os.environ.get("LD_LIBRARY_PATH", "") + ":" + os.path.join(arnoldsdk, "bin")

        print(os.environ.get("PXR_PLUGINPATH_NAME"))
        print(os.environ.get("LD_LIBRARY_PATH"))

        pxr.Plug.Registry().RegisterPlugins([os.path.join(arnoldusd, "plugin")])

Some info on what system im using.

Arnold: 7.3.4.1
Blender: 4.1.1 - USD 23.11
OS: RHEL 9

As you’ve probably noticed, we don’t have much experience here about hooking up Hydra delegates in general. Those Coding Error traces are coming directly from USD though, not from Blender, making things more difficult to debug.

Because your Moonray effort got farther along than this, I’m guessing it might be an environmental problem somehow. One thing to try, if you are really sure those paths are correct, is to set the environment variables before even starting Blender, rather than injecting them into the python environment at runtime to see if that makes any difference. Try with and without the --python-use-system-env Blender command line option. This option controls whether Python uses the system environment variables such as PYTHONPATH and your user site-packages directory or not.

Included some environment paths outside of blender and used --python-use-system-env.

------------------------------ blender terminated ------------------------------
blender crashed. FATAL ERROR: [TF_DEBUG_ENVIRONMENT_SYMBOL] multiple debug symbol definitions for 'TF_DEBUG_REGISTRY'.  This is usually due to software misconfiguration, such as multiple versions of the same shared library loaded simultaneously in the process.  Please check your build configuration.
in _Register at line 139 of /src/build_linux/deps/build/usd/src/external_usd/pxr/base/tf/debug.cpp
writing crash report to [ cj-rhel:/var/tmp/st_blender.819473 ] ... done.
--------------------------------------------------------------------------------

Back to some errors that I’m familiar with. This is a good sign

If you like, get in contact with Aaron:

Maybe join forces?

I’ll send him a message, thanks!

1 Like