Arnold OSL
Getting Started

return to main index


    Cutter & OSL Shader Writing

Step 1: Setting Up Maya

1.1   Install Maya 2018.
1.2   Add the following environment variable to the maya/2018/Maya.env file.


1.3   Create the Arnold_osl directory within the projects folder.
1.4   Within the directory create a sub-directory and name it src.
The maya directory structure will now be,

        |_ 2018/Maya.env <<-- edited
        |_ projects/
                   |_ Arnold_osl      <<-- created
                   |_ Arnold_osl/src  <<-- created

The source code of your shaders will be kept in the src directory while the compiled shaders will be stored in the Arnold_osl directory.

Step 2: Install the Latest Version of Arnold for Maya

2.1   Download and install the latest version of Arnold for Maya.

OSX and Linux Only

The oslc and oslinfo files may not be executable!
Open a terminal, cd to the bin directory and make a listing. For example,

mt-mkesson:~ malcolm$ cd /Applications/solidangle/mtoa/2018/bin
mt-mkesson:bin malcolm$ ls -l
total 357400
-rwxr-xr-x  1 root  admin  13695680 Oct 18 10:48 maketx
-rwxrwxrwx  1 root  admin   3460576 Oct 18 10:48 oslc
-rwxrwxrwx  1 root  admin   1152800 Oct 18 10:48 oslinfo

If oslc and oslinfo do not have rwxrwxrwx permissions execute the following commands.

    sudo -s
    enter your password
    chmod 777 oslc
    chmod 777 oslinfo

Step 3: Setting Up Cutter

3.1   Make sure you are using Cutter version 7.8.1 or higher.
3.2   Open the Osl prefs panel (Edit->Show Preferences->Languages->Osl).

Figure 1

Make sure the solidangle bin path, the source and the shaders have been set correctly. Select the SolidAngle Arnold button. This will ensure the keyboard shortcut Alt + e, Control + e or Apple + c will compile a shader when editing a .osl document.
3.3   Click the Save Osl button.

Step 4: Compiling a Shader

4.1   From the Templates menu choose Osl->uv2color.osl.

Figure 2

4.2   Save it as uv2color.osl in the maya/projects/Arnold_osl/src directory.
4.3   Use the keyboard shortcut Alt + e, Control + e or Apple + e to compile the shader.
4.4   Make sure the shader has been compiled to the correct directory.

Figure 3

If compilation has been successful the maya/projects/Arnold_osl directory will contain two files, uv2color.oso (the compiled shader) and uv2color.mtd (an Arnold metadata file).

Step 5: Using a Shader

4.1   Launch Maya 2018, open Hypershade and look for uv2color in the Arnold/Utility directory.

Figure 4

© 2002- Malcolm Kesson. All rights reserved.