How to use vray commands in python?

Is there an equivalent of mel.eval(“vray objectProperties add_single VRayDisplacement”) but in clean python code?

…for example:

import vray.utils as vr
myVrayDisplNode = vr.create(“VrayDisplacement”, add_single=True)

I noticed this crashes Maya:

import vray.utils as vr
myVrayDisplNode = vr.create(“VrayDisplacement”, “thisWouldProbablyBeTheNameOfTheCreatedNode”)

No unfortunately. We only have the MEL commands.

import vray.utils as vr
myVrayDisplNode = vr.create(“VrayDisplacement”, “thisWouldProbablyBeTheNameOfTheCreatedNode”)The vrayDisplacement node is a Maya node, not a V-Ray plugin, so this won’t work. In the V-Ray scene, displacement is translated in a completely different way. The crash itself should be fixed for newer builds, but don’t expect this command to do anything meaningful.

Best regards,
Vlado

Ok, thank you.

So I presume this won’t work either?


import vray.utils as vr
vr.create("texture", "ColorCorrection") 

Is there currently any way to create this texture via either Python or MEL?

This code works only in the post translate callback.

The mel code for creating such texture is something like:


vrayCreateNodeFromDll("tex", "texture", "ColorCorrect", 2);

Ah, many thanks!