RenderElements crashing maya

I was trying to make a script for loading vray, and it works fine.
It just seems to have permanently broken the render elements tab.

cmds.loadPlugin( ‘vrayformaya.mll’, quiet = True )
cmds.pluginInfo( ‘vrayformaya.mll’, edit=True, autoload=True)
cmds.setAttr (‘defaultRenderGlobals.currentRenderer’, “vray”, type = “string” )
mel.eval(‘vrayCreateVRaySettingsNode();’)

Even if I do it manually now it still crashes. Any ideas why, and how to fix it?
I’ve tried on multiple machines.

I forgot to mention that reinstalling vray doens’t have any effect.

Do you have the crash dump? Also, is this in an interactive Maya session, or with mayapy?

Best regards,
Vlado

Not at this time, but I can get one in a few hours.
It’s an interactive session.

okay I have the dump file now, but it says its 0 kb?

Tried reinstalling both maya and vray, but the problem still persists.
So now it’s actually broken permanently.

If I add a render element with mel I get this error message just before it crashes:
// Warning: file: C:\Program Files\Autodesk\Maya2013\vray\scripts\vrayInit.mel line 218: New procedure definition for “vrayRenderElements” has a different argument list and/or return type. //
MayaCrashLog130518.2141.zip (152 Bytes)

Tried to uninstall everything, cleaning out every related folder I could find. But Vray or maya must keep something somewhere because it still crashes ?
Honestly I think my only alternative is to wipe the computer. Which is ridiculous.

Just a wild guess - do you have more than one versions of Maya on your machine? Maybe there are some maya files that are shared between the versions or something of the sort that keep some information. How exactly did you start running your script when you first started having these problems?

no only maya 2013.
When I sourced the script inside maya.

import vrayLoad
vrayLoad.load()

Can you try to uninstall V-Ray and then manually delete the folder “C:\Program Files\Autodesk\Maya2013\vray” in case anything remains there by mistake. Also, check the MAYA_SCRIPT_PATH in case it contains a path to old scripts.

Best regards,
Vlado

The vray folder disappears when I uninstall.
How do I check the MAYA_SCRIPT_PATH ? Is it like an environment variable, because there is nothing called MAYA_SCRIPT_PATH.

It’s an environment variable, yes.

Nothing there.
I have:
MAYA_PLUG_IN_PATH, but that’s for royal render
VRAY_FOR_MAYA2013_MAIN_x64
VRAY_TOOLS_MAYA2013_x64

Ok, next question: is it possible that your script (or some other non-V-Ray script) defines a function ‘vrayRenderElements’ so that it is duplicated with the one from the V-Ray scripts?

Best regards,
Vlado

I made a few scripts, but mostly it just executes a series of mel commands.
I’ve attached them in this post.
vrayScripts.zip (1.23 KB)

Finally! I solved the crashing!
Turns out it was a different script that was the cause.
It’s a mel script to assign a few render elements. But just having it in the script folder would crash maya when I select the render elements tab.
this is the script:

global proc vrayRenderElements()
{
        vrayAddRenderElement reflectChannel;
        vrayAddRenderElement refractChannel;
        vrayAddRenderElement diffuseChannel;
        vrayAddRenderElement giChannel;
        vrayAddRenderElement shadowChannel;
        vrayAddRenderElement specularChannel;
        vrayAddRenderElement lightingChannel;
}

Now the question is just, why is it making maya crash? is it the name vrayRenderElements ?
because this only happens when I source the script, not if I run the commands from within maya.

Very well then :slight_smile: I’m not sure why Maya would crash; that would be something for Autodesk to look into…

Best regards,
Vlado

Also, for anyone who might see this thread in the future.
The reason it crashes is because of the name “vrayRenderElements”
My best guess is that there’s another script somewhere that shares the name, a native vray one and that’s why it crashes? Simply renaming it to something else works!

And thank you for the help!

Generally it is not a good idea to name any functions or global variables vrayXXX.
Because it could cause name collisions and at least strange bugs.
Now or in the future (if it happens that we’ve started to use the same name as you).