Skip to content
Roy Nieterau edited this page Dec 10, 2013 · 43 revisions

#V-ray for Maya documentation (Mel & Python)

Here's a brief overview of the commands that I've seen being used by Vray scripts and the User Interface.

Since there's no documentation from Chaosgroup on these scripting functions all functionality described is based on (in some cases quick and dirty) testing. Though for general documentation I can recommend this v-ray for maya documentation: V-Ray for Maya, version 2.0 (documentation)

Note that the short code examples below show only vray() as command. Though in Maya (python) it will be in the maya.cmds module.

For example if you do import maya.cmds as mc then the function calls should be done like mc.vray()

Note: The arguments below are not actual Python keyword arguments, they are plain arguments and can't be set as an keyword. They should just be the Nth argument.

vrayformaya commands

Here's an overview of the commands that come with the v-ray for maya plug-in and how you can use them.

vray

This is the most(-widely) used vray command and allows you to manage most of v-ray's data.

vray addAttributesFromGroup

Create and remove vray attributes

vray("addAttributesFromGroup", node, attrGroup, state)

vray addAttributesFromDll

Usage unknown. Used in vrayMenuCreate.mel in global proc vrayCreateNodeFromDll().

vray("addAttributesFromDll", node, pluginType, pluginName)

vray createAEMenu

Internal command for building vray attribute menus (Attribute Editor)

vray("createAEMenu", node)

vray getAHint

Get data information from a vray data structure, i.e. RenderElement and RenderElementAttribute.

vray("getAHint", dataType, dataName, data)

vray getGUIHint

Internal use to get information about attributes to build up relevant Attribute Editor widgets.

vray("getGUIHint", node, attr, func)

vray getBlackBodyColor

vray("getBlackBodyColor", temperatureAttr)

vray getConfValue

Get a v-ray configuration value.

vray("getConfValue", configName)

vray getOptionalAttrs

Returns the optional attrs

vray("getOptionalAttrs", "")

vray getRenderElements

vray("getRenderElements")

vray getRequiredAttrs

Returns the required attrs (returns an empty list?)

vray("getRequiredAttrs", "")

vray getMtlsList

WARNING: Fatal Error if used without loadFromFileInit.

Used by vrayMenuCreate.mel in global proc vrayImportVRayMaterial().

Returns v-ray materials list from vrscene.

vray("getMtlsList")

vray listLoadedPlugins

Usage unknown. Used in vrayMenuCreate.mel

vray("listLoadedPlugins", pluginType)

vray loadFromFileInit

Initializes vray scene importer/reader to fileName. Used in vrayMenuCreate.mel.

Chaosgroup seems to change backslashes to forward slashes so make sure to use forward slashes for the filepath to be sure.

vray("loadFromFileInit", fileName)

vray loadFromFile

Imports node from the vray scene at fileName location.

isDuplicate should be a string value of either: "d" or "n". Note sure what it's about.

Chaosgroup seems to change backslashes to forward slashes so make sure to use forward slashes for the filepath to be sure.

vray("loadFromFile", fileName, isDuplicate, node)

vray loadFromFileEnd

Uninitializes the vray scene importer/reader. Used in vrayMenuCreate.mel.

vray("loadFromFileEnd")

vray objectProperties

Create and remove vray object properties.

vray("objectProperties", subCommand, _type_)

vray resolveServers

Resolves the distributed rendering servers?

vray("resolveServers")

vray setConfValue

Set a v-ray configuration value.

vray("setConfValue", configName, value)

vray showVFB

Displays the vray frame buffer window.

vray("showVFB")

vray vfbControl

Manipulate the V-ray Framebuffer

vray("vfbControl", *args)

Starts the vray render

vrayRenderInfo

Allows you to acquire data from the renderer.

Returns the path to where v-ray is installed. (Likely somewhere inside your Maya installation's folder)

vrayCreateProxy

Creates a v-ray proxy

Example in mel (from vrayMenuCreate.mel):

vrayCreateProxy -previewFaces $previewFaces -dir $path -fname $filename
$animOnStr $velocityOnStr $backupStr $overwriteStr $lastSelectedAsPreviewStr $vertexColorsOnStr $ignoreHiddenObjectsOnStr $createProxyNodeStr $includeTransformationStr
-node $newNodeName -animType $animType -startFrame $startFrame -endFrame $endFrame -exportType $exportType
-velocityIntervalStart $velocityIntervalStart -velocityIntervalEnd $velocityIntervalEnd;

Vray Maya Python API

We hope to document this as well. Currently if you want more info check out the python scripts in:

PATH/TO/maya/vray/scripts/vray/

Or check out: V-Ray Scene Access Python API