Installing Maya Shaders

2020. 3. 2. 07:54카테고리 없음

You can import a custom shader library in the following ways:. To interactively load and unload mental ray shader libraries, use the Shader Manager. mental ray, by default, looks for shader libraries in the default install directory.AutodeskMaya201xmentalray.

If your shader libraries are located in this directory, they are automatically loaded by Maya. Using the MICUSTOMSHADERPATH and MILIBRARYPATH environment variables.These methods are explained in more detail below.To import a custom shader library. Copy the declaration file to the shaders/include directory of your mental ray for Maya installation. Copy the library file into the shaders directory of your mental ray for Maya installation.mental ray for Maya is able to load and render with your custom shader library.

Toon Shader Maya

Placing the declaration file in the include directory also uses mental ray for Maya to parse the file and create new Maya node types that correspond to the shaders declared in the library. With the mental ray Shader ManagerThe Shader Manager lets you interactively load and unload mental ray shader libraries and work with them during a Maya session. (You do not need to shut down first, and you do not need to set the environment variable MICUSTOMSHADERPATH.)You can select from a list of.mi library files that contain the mental ray shader declarations. The shaders contained in the selected.mi library files automatically appear in Hypershade, just like the Maya and mental ray for Maya base shader nodes. Mental ray for Maya base shaders are now fully integrated into Hypershade and Create Render Node panel.(You do not need to set the environment variable MAYAMRFMSHOWCUSTOMSHADERS to show custom shaders in Hypershade.)To load or unload custom mental ray shaders.

Select Window Rendering Editors mental ray.The Shader Manager opens and shows which declaration file Window Rendering Editors mental ray are loaded. Click to load or unload a declaration file, auto load the file, or get information on the file. For descriptions of the buttons and options in the mental ray Shader Manager window, see Window Rendering Editors mental ray.

MICUSTOMSHADERPATHThis variable tells mental ray for maya a directory where.mi files are located. Every.mi file located in MICUSTOMSHADERPATH will be parsed on plug-in load.This environment variable should be set prior to loading the plug-in. Mental ray for Maya interprets this variable in different ways.

If it is not empty but does not point to an existing file or directory, a file dialog opens up as the mental ray for Maya plug-in is (auto-)loaded. A.mi file should be selected that contains mental ray shader/phenomenon declarations which the Factory should create Maya node types for. The file dialog comes up again in a loop to allow more than one.mi file to be loaded. It stops when the Cancel button has been pressed.If the Factory should load all required files automatically, then a file or a directory containing.mi files should be given in the environment variable.

To be able to create Arnold shaders, you need these three components installed: a C compiler, the Arnold SDK and the MtoA plugin.You will need a C compiler to create your shaders. If you work in Windows, Visual Studio 2008 or 2010 will be required.You will need to download and extract the Arnold SDK to the folder of your choice. For the purposes of this tutorial, we will assume that you will set the environment variable ARNOLDPATH to the path where the Arnold SDK is located. For example, in Windows, if you have installed Arnold in this folder:C:solidanglereleasesArnold-X.X.X.X-platformYou will set ARNOLD PATH to that folder using this command:set ARNOLDPATH='C:solidanglereleasesArnold-X.X.X.X-platform'The first thing you have to do is to install MtoA, that is the Maya plugin for Arnold in your system. Depending on your OS, follow the corresponding steps to install it (see the ).To create your first Arnold shader, write the following code in a file called simpleShader.cpp. Figure 2: simpleScene ErrorIn order that your shader is correctly recognized by Maya, you need to add some metadata to it. The preferred way to do this is to create a that will be automatically used when the shader is loaded.

Installing Maya Scripts

This way, it willbe easier to make modifications without having to recompile the shader. This will also keep the Maya specific metadata in the MtoA folders, rather than in the shaders themselves (which you might want to re-use outside Maya).This is shown in the following code. If you do not give the shader a maya.name, the shader is automatically assigned a name that is its Arnold node name prefixed by ai.

Installing Maya Shaders

In this case, the name would be aiSimple.From Autodesk help:For plug-ins that will forever be internal to your site use the constructor that takes a single unsigned int parameter. The numeric range 0 - 0x7ffff (524288 ids) has been reserved for such plug-ins.The example plug-ins provided with Maya in the plug-in development kit will use ids in the range 0x80000 - 0xfffff (524288 ids). If you customize one of these example plug-ins, you should change the id to avoid future conflicts.Plug-ins that are intended to be shared between sites will need to have a globally unique id. The Autodesk Developer Network (ADN) will provide such id's in blocks of 256. You will be assigned one or more 24-bit prefixes. Once this has been obtained, use the MTypeId constructor that takes 2 unsigned int parameters. The prefix goes in the first parameter, and you are responsible for managing the allocation of the 256 ids that go into the second parameter. For the purposes of this text, we will use IDs beginning from 0x70000, but feel free to use the IDs that could suit you better.

Maya Shaders Download

Also, if you are developing a quality shader that you would like to share with the MtoA community, feel free to ask us for an ID granted by Autodesk to MtoA.If you also want to create a Maya interface for this shader, create the following file. In the addControl method, the first argument is the shader attribute name or the maya.name metadata of that attribute. So in this case the parameter could be: constantColor or color.Note that the name of the defined class should be: AETemplate and the file name Template.py where is the value of the maya.name metadata of the shader.In order that your shader works correctly in Maya, it is very important that you name and place the files in the correct locations. You should have three files:Compiled ShaderThis is the shader you compiled, and it will be responsible for the shader behaviour.

In this example, it is simpleShader.dll in Windows. You can copy it to:%MTOAPATH%shaders or to any other folder that is included in the environment variable%ARNOLDPLUGINPATH%Metadata FileThis is the file where all the metadata information is located. This will add information that Maya needs about the shader. The name of this file must be the same as the compiled file, but with a.mtd extension. In this example, the file name is simpleShader.mtd. This file will have to be copied to the same folder where the compiled shader is located.Template FileThis is the file where the Maya Template for this shader is defined.

The name of this file and the class name inside it has to follow the rules from previous section. In this example it is mySimpleTemplate.py. This file can be copied to this folder:%MTOA PATH%scriptsmtoauiae or to any other folder that is included in the environment variable%MTOATEMPLATESPATH%Now, with everything in its correct place, when you use the aiSimple shader in Maya, you will be able to see this Attribute Editor for it.