Quantcast
Channel: Maya – Arnold Support Corner
Viewing all 53 articles
Browse latest View live

The case of the blue render view

$
0
0

Reason #35 why you should check the Arnold log

In this case, a scene that used to render yesterday, now just resulted in a blue render view, like this:

blue_render_view

Anytime the render view doesn’t update when your render, you can be fairly sure there’s some ERROR in the Arnold log.

In this case, the problem was a broken path to the IES file used by a photometric light. In the Arnold log, there was this ERROR:

00:00:04 870MB ERROR | [photometric] can't open C:/Assets/IES/example.ies

It’s easy to say “check the log”, but where do you find the log? It’s not like there’s a nice, color-coded button (red for error) on the render view UI that will pop up the log for you.

  • On Windows, you should see the Arnold log in the Output Windows. However, I find that this happens only when I start Maya from the command line. If I start Maya from the Windows Start menu, the Arnold log messages don’t show up in the Output Window. So I have to enable file logging, and check the log file.
  • On OSX and Linux, you’ll also have to enable file logging, unless you start Maya from a terminal.

 

 


[MtoA] Adding per-face and per-vertex user data

$
0
0

With Maya and MtoA, there’s no easy way to add per-face and per-vertex user data attributes to objects. You’ve got to do it with scripting: add an array attribute with addAttr and then provide the values. For example, here’s how to add per-face and per-vertex attributes, which MtoA will translate to UNIFORM (per-face) and VARYING (per-vertex) user data on the shape.

import maya.cmds as cmds
# Add UNIFORM (per-face) user data
cmds.addAttr("pPlaneShape1", dataType="vectorArray", longName="mtoa_uniform_myPerPolyColor")
cmds.setAttr("pPlaneShape1.mtoa_uniform_myPerPolyColor", 4,(0.48, 0.39, 0.35), (0.62, 0.63, 0.44), (0.47, 0.69, 0.33), (0.70, 0.38, 0.29), type="vectorArray")

# Add VARYING (per-face vertex) user data
cmds.addAttr("pPlaneShape2", dataType="vectorArray", longName="mtoa_varying_myPerPointColor")
cmds.setAttr("pPlaneShape2.mtoa_varying_myPerPointColor", 9, (0.46, 0.55, 0.66), (0.29, 0.40, 0.38), (0.69, 0.43, 0.68), (0.36, 0.58, 0.55), (0.59, 0.48, 0.27), (0.55, 0.52, 0.70), (0.48, 0.35, 0.26), (0.46, 0.46, 0.47), (0.34, 0.55, 0.31), type="vectorArray" )

After you run the script to add the attributes, you can use the aiUserData shaders to get the user data values and use them in your shader trees.

aiUserDataColor

For example, here’s the per-face and per-vertex user data colors on a simple grid:

uniform_varying_user_data

[MtoA] mtoa missing from Plug-in Manager

$
0
0

If mtoa.mll is not listed in the Plug-in Manager, that means that Maya did not find the MtoA module file (mtoa.mod). And if you try to manually load mtoa.mll, you’ll get errors like this:

// Error: file: C:/Program Files/Autodesk/Maya2016/scripts/others/pluginWin.mel line 781: Unable to dynamically load : C:/solidangle/mtoadeploy/2016/plug-ins/mtoa.mll
The specified module could not be found. // 
// Error: file: C:/Program Files/Autodesk/Maya2016/scripts/others/pluginWin.mel line 781: The specified module could not be found. (mtoa) //

To load MtoA, you need to make sure that Maya finds the MtoA module file.

By default, the MtoA installer puts the mtoa.mod file in the user’s modules folder. For example:

C:\Users\StephenBlair\Documents\maya\2016\modules

If you installed MtoA using one user account, and try to run Maya with a different user account, Maya will not find the module file.

The module file has to be in the MAYA_MODULE_PATH. For example, for the user account “StephenBlair”, here are the default places where Maya looks for modules:

  • C:/Program Files/Autodesk/Maya2016/modules
  • C:/Users/StephenBlair/Documents/maya/2016/modules
  • C:/Users/StephenBlair/Documents/maya/modules
  • C:/Program Files/Common Files/Alias Shared/Modules/maya/2016
  • C:/Program Files/Common Files/Alias Shared/Modules/maya
  • C:/Program Files/Common Files/Autodesk Shared/Modules/maya/2016

If you want MtoA to available to all users, then you could copy mtoa.mod to one of the common locations.

[MtoA] Exporting XGen archives

$
0
0

Finally, I have XGen > Generate > Export Selection as Archive working with Maya 2016 Extension 1 + SP5 on Windows 7.

I recently updated to SP5 from SP4, but I don’t know if that’s part of why the export works now. But I do know that I had to install mental ray for Maya 2016. I didn’t need to load Mayatomr, I just needed it installed. And then Export Selection as Archive worked!

PS I did see that thread on cgtalk about modifying xgenMR.py and xgenMRExport.py, but that didn’t work on my Windows 7 machine.

[MtoA] Renderman performance warning

$
0
0

If you have both Renderman and MtoA installed, you may see a warning that says “Arnold for Maya degrades Renderman performance.” Unless you are running a version of MtoA from 20 months ago, this performance warning is false. MtoA does not degrade Renderman performance.

This was fixed in Arnold 4.2.3.1 (fix #4393 main thread was pinned to a single core) back in January 2015.

[MtoA] The curse of pymel.log

$
0
0

PyMEL is great. But…if pymel.log can’t be accessed, any plugin that uses PyMEL will fail to load.

And MtoA uses PyMEL, so every now and again I see a case where MtoA doesn’t load, and you get something like this in the script history:

import arnold
// Successfully imported python module 'arnold'
import mtoa
// Successfully imported python module 'mtoa'
import mtoa.cmds.registerArnoldRenderer;mtoa.cmds.registerArnoldRenderer.registerArnoldRenderer()
# Error: line 1: IOError: file C:\Program Files\Autodesk\Maya2016\bin\python27.zip\logging\__init__.py line 926: 13 #
// Error: Failed to register renderer 'arnold' //
// Error: line 1: initializePlugin function failed (mtoa) //

The important bit is this error:

# Error: line 1: IOError: file C:\Program Files\Autodesk\Maya2016\bin\python27.zip\logging\__init__.py

That error means that PyMELcannot create a log file in your user folder.

By default, the PyMEL log file is created in your Documents folder. For example, if your Windows user account name is Stephen, then this would be the log file:

C:\Users\Stephen\Documents\pymel.log

You need to check the permissions on that log file, or delete it so that PyMel can create a new log file.

Note that the pymel.log file may be a hidden file.

[MtoA] The renderer ‘arnold’ used by this scene, is not currently available

$
0
0

warning_renderer_not_currently_available

// Warning: file: C:/Program Files/Autodesk/Maya2017/scripts/others/supportRenderers.mel line 64: The renderer "arnold" used by this scene, is not currently available. The "mayaSoftware" renderer will be used instead. //

By itself, this warning doesn’t mean there’s a problem with MtoA or Arnold. The warning means that the MtoA plugin isn’t loaded, so all you have to do is load MtoA:

  1. Click Windows > Settings/Preferences > Plug-in Manager
  2. Scroll down until you see mtoa.mll
    plug-in_manager_mtoa
  3. Click the Loaded and Auto load check boxes.

However, if you get a “Unable to dynamically load : ../mtoa.mll The specified module could not be found.” error, then that’s a different problem.

[MtoA] Unable to dynamically load : mtoa.mll The specified module could not be found.

$
0
0

I have another, more general, version of this post here. This one is for new Arnold users with Maya 2017.

Here’s what to do if you get errors like this:

// Error: file: C:/Program Files/Autodesk/Maya2017/scripts/startup/autoLoadPlugin.mel line 32: Unable to dynamically load : C:/solidangle/mtoadeploy/2017/plug-ins/mtoa.mll
The specified module could not be found.
//
// Error: file: C:/Program Files/Autodesk/Maya2017/scripts/startup/autoLoadPlugin.mel line 32: The specified module could not be found.

Check if your processor supports SSE4.2

If this is the first time you’ve tried to use the Maya to Arnold (MtoA) plugin, then check whether your processor supports SSE4.2.

Reinstall MtoA

If MtoA used to load, but now it doesn’t, then something happened to the MtoA installation. I’ve seen several cases where DLLs were missing from the MtoA bin folder; most importantly, Arnold itself was missing (Arnold is ai.dll on Windows, or libai.so on Linux, or libai.dylib on OSX).

If you make a backup copy of the MtoA install folder, we can investigate after you fix things by installing MtoA.

Get a Process Monitor log

If a clean install of MtoA doesn’t work (and the computer does support SSE4.2), then “The specified module could not be found.” usually means there’s a missing dependency. Dependency Walker is a decent, if aging, tool for checking out dependencies, but for leaving no stone unturned, I prefer Process Monitor.

The MtoA plugin (mtoa.mll) depends on a handful of files only. Here’s the log of loaded DLLs for a working MtoA:

process_monitor_mtoa

Here’s a quick walkthrough (no audio) of how to get a Process Monitor log:


[MtoA] The case of the machine that was unable to dynamically load mtoa.mll

$
0
0

In this case, a Windows 7 machine did support SSE4.2, but Maya 2017 still couldn’t load mtoa.mll.

I didn’t get a full Process Monitor log from the client, but I did get a Dependency Walker log, and this case, that was enough.

When you first open a Dependency Walker (dwi) file, it’s easy to focus on the wrong thing. In this case, the missing MSVCR90.DLL (Visual Studio 2008 redistributable) might catch your eye.

dwi_01.jpg

But you can ignore that, because if you take a closer look, you’ll see that MSVCR90.DLL is indeed found and loaded.

dwi_02.jpg

Likewise, you can ignore all these. You’ll almost always see most of those in a Dependency Walker log for Windows 7 and up.

dwi_03

What’s important in this depends log is the warning for AI.DLL.

dwi_04

That warning means that there’s missing functions: MtoA (MTOA.MLL) expects to use certain functions provided by Arnold (AI.DLL), but those functions aren’t there. For example:

dwi_05

And finally, if we click View > Full Paths, we see the reason for the problem:

dwi_06

There’s some older version of Arnold on the system, and that old version is being loaded by MtoA.mll. Most likely, the system PATH includes this location.

With a Process Monitor log, we would have seen right away that ai.dll was being loaded from a non-standard location.

 

[MtoA] Warning: Renderer “arnold” does not provide batch rendered options

$
0
0

Not all renderers have batch render options, so if you click the box beside the Batch Render menu command:

menu_options_box

then you’ll get a warning:

// Warning: file: C:/Program Files/Autodesk/Maya2017/scripts/others/batchRenderOptions.mel line 19: Renderer "arnold" does not provide batch rendered options. //
// Warning: file: C:/Program Files/Autodesk/Maya2017/scripts/others/batchRenderOptions.mel line 19: Renderer "mayaHardware" does not provide batch rendered options. //
// Warning: file: C:/Program Files/Autodesk/Maya2017/scripts/others/batchRenderOptions.mel line 19: Renderer "mayaHardware2" does not provide batch rendered options. //
// Warning: file: C:/Program Files/Autodesk/Maya2017/scripts/others/batchRenderOptions.mel line 19: Renderer "mayaVector" does not provide batch rendered options. //

All the rendering options for Arnold are in the Arnold Render Settings.

To start a batch render, click the Batch Render text in the Render menu:
render_menu

[MtoA] Getting the MtoA build ID

$
0
0

When you contact support or log bugs, it’s nice to provide the version number and build ID of the MtoA version that you’re using.

This information is displayed in the Arnold > About box.

mtoa_buildid

But the build id (circled in the screenshot) is kinda a pain to type out. Fortunately, you can get the build ID with the arnoldPlugins command:

arnoldPlugins -gbi;
// Result: 261bd4ca (master) //

You can get both the MtoA version and the MtoA build ID like this:

print( "MtoA " + `pluginInfo -v -q "mtoa.mll"` + " - " + `arnoldPlugins -gbi`);

In Python:

print( "MtoA {} - {}".format( cmds.pluginInfo( 'mtoa', query=True, version=True), cmds.arnoldPlugins(getBuildID=True) ) )
# MtoA 1.4.2.2 - 261bd4ca (master)

Removing MtoA from Maya scenes

$
0
0

If you don’t use Arnold, but someone has saved your scene files with MtoA loaded, then you’ll get some errors and warnings when you open that scene without MtoA.

// Error: line 0: The camera 'perspShape' has no 'ai_translator' attribute. // 
// Error: line 0: Node "perspShape" has no attribute "ai_translator". // 
// Error: line 0: The camera 'topShape' has no 'ai_translator' attribute. // 
// Error: line 0: Node "topShape" has no attribute "ai_translator". // 
// Error: line 0: The camera 'frontShape' has no 'ai_translator' attribute. // 
// Error: line 0: Node "frontShape" has no attribute "ai_translator". // 
// Error: line 0: The camera 'sideShape' has no 'ai_translator' attribute. // 
// Error: line 0: Node "sideShape" has no attribute "ai_translator". // 
// Error: line 0: The mesh 'pPlaneShape1' has no 'ai_translator' attribute. // 
// Error: line 0: Node "pPlaneShape1" has no attribute "ai_translator". // 
// Error: line 0: The mesh 'pSphereShape1' has no 'ai_translator' attribute. // 
// Error: line 0: Node "pSphereShape1" has no attribute "ai_translator". // 
// Error: line 0: The mesh 'pCubeShape1' has no 'ai_translator' attribute. // 
// Error: line 0: Node "pCubeShape1" has no attribute "ai_translator". // 
// Warning: line 0: Unrecognized node type for node 'defaultArnoldRenderOptions'; preserving node information during this session. // 
// Warning: line 0: Unrecognized node type for node 'defaultArnoldFilter'; preserving node information during this session. // 
// Warning: line 0: Unrecognized node type for node 'defaultArnoldDriver'; preserving node information during this session. // 
// Warning: line 0: Unrecognized node type for node 'defaultArnoldDisplayDriver'; preserving node information during this session. //

Here’s how to remove all the MtoA (aka Arnold) attributes and nodes.

First, don’t load MtoA. Uninstall MtoA.

Now, just loading and saving your scene will get rid of the ai_translator attributes. All that’s left to do is get rid of the unknown nodes. There’s just four (assuming nobody created any Arnold shaders or lights or standins in the scene): the four defaultArnold nodes:

ls -typ "unknown";
// Result: defaultArnoldDisplayDriver defaultArnoldDriver defaultArnoldFilter defaultArnoldRenderOptions //

Here’s a MEL script to remove all unknown MtoA nodes from a scene:

string $mtoaNodes[] = `ls -typ "unknown"`;

for ($node in $mtoaNodes){
	if (`objExists $node` && `unknownNode -q -p $node` == "mtoa"){
		print("Deleting mtoa node " + $node + "\n");
		delete $node;
	}
}

[mtoa] Using dirmap to update paths

$
0
0

How can you update the paths used to load textures, standins, or volumes? Use dirmap.

You can use dirmap to update the paths for the following nodes:

  • aiImage (Image Name)
  • aiStandin (Path)
  • aiVolume (Filename)
  • MayaFile (Image Name)

For example, if I have a scene file that uses Linux paths like /server/assets/textures/noicon.tx, I can do this:

dirmap -en true;
dirmap -m "/server/assets" "D:/Assets/";

After I run that, when I load a scene Maya will replace “/server/assets” with “D:/Assets” in all file paths.

You can test your directory mapping (dirmap) like this:

dirmap -cd "/server/assets/textures/noicon.tx";
// Result: D:/Assets/textures/noicon.tx //

So:

  • Enable dirmap with dirmap -en, and then create a directory mapping with dirmap -m
  • Load a scene and the dirmap is applied.

TIP For batch rendering, you can use a pre-render script to apply dirmap.

BONUS TIP: dirmap does not update a path if the path is valid. dirmap replaces paths that cannot be resolved.

Viewing all 53 articles
Browse latest View live