question

Nick Burdan avatar image
Nick Burdan asked ·

flags for maya.cmds.arnoldExportAss()

Where can I find a list of the flags that

maya.cmds.arnoldExportAss() accepts?

10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

Quick Help in the script editor shows the flags

mask is a bit mask that represents what nodes you want to export.

# Node types
#
AI_NODE_UNDEFINED = 0x0000
AI_NODE_OPTIONS = 0x0001
AI_NODE_CAMERA = 0x0002
AI_NODE_LIGHT = 0x0004
AI_NODE_SHAPE = 0x0008
AI_NODE_SHADER = 0x0010
AI_NODE_OVERRIDE = 0x0020
AI_NODE_DRIVER = 0x0040
AI_NODE_FILTER = 0x0080
AI_NODE_ALL = 0xFFFF

For example, to export just shapes and shaders, the mask would be 24 (or 0x0030 or AI_NODE_SHAPE | AI_NODE_SHADER)

In decimal, the flags are:

Options = 1
Camera = 2
Light = 4
Shape = 8
Shader = 16
Override = 32
Driver = 64
Filter = 128

For all of the above, you can use 255 (which is the sum of all of the above)

NOTE:
In 2017 with later versions of MtoA, there's an additional value just for the colormanager node: 2048
But you don't need to export the colormanager, unless you have a custom rendering space, or unless you don't convert your textures to tx before the render.




For "Force Translate Shading Engine", you need to use the -fsh flag.


exportSelected is going to end up calling the arnoldExportAss command, which you can use in Python like this:

import maya.cmds as cmds
cmds.arnoldExportAss( f="C:/Support/scenes/test.ass", mask=223, lightLinks=0, shadowLinks=0, cam="perspShape" )


There's no documentation for the command. Another customer put together this:

-b, -batch
Looks like this flag is never used. I could be wrong.

-s -selected
This flag will export selection, or a list of object at the end of the argument
E.g. arnoldExportAss -s -sf 10 -ef 14 pCube3 pCube1

-f, -filename
filename to export to. this argument can take tokens.
eg. arnoldExportAss -sf 10 -ef 12 -f "/tmp/<Scene>/<RenderLayer>"

-cam, -camera
This will force the provided camera to be exported and set as renderCamera and ignore the one set in renderGlobals
E.g. arnoldExportAss -cam topShape

-sf, -startFrame
self explanatory

-ef, -endFrame
self explanatory

-o -options
Not implemented, but i guess the idea is to be able to export a aiOptions node as the default options.
E.g. createNode -n myCustomOptions aiOptions; arnoldExportAss -o myCustomOptions

-c, --compressed
Export a gzipped ass archive. .ass.gz

-bb -boundingBox
Export an asstoc file along with the ass file to use as a fast lookup of the ass scenes bounding box.
Used to know the bounds of a deferred loaded procedural, and to show the bounding box of a standin in the maya viewport without the need to open the ass file.

-a -asciiAss
Force everything in the ass to bee ascii text, otherwise some parts will be binary encoded.

-m -mask
This is a mask of what objects to be exported.
These are the node types you can filter on.
-------------------------------------------
AI_NODE_UNDEFINED 0x0000
AI_NODE_OPTIONS 0x0001
AI_NODE_CAMERA 0x0002
AI_NODE_LIGHT 0x0004
AI_NODE_SHAPE 0x0008
AI_NODE_SHADER 0x0010
AI_NODE_OVERRIDE 0x0020
AI_NODE_DRIVER 0x0040
AI_NODE_FILTER 0x0080
AI_NODE_ALL 0xFFFF
-------------------------------------------
You can use bitwise operations to create combinations of types.
This is easiest shown in python.
To create a filter that only contains light and cameras, use OR operator ( | ):
_______________________________________________
>>>from arnold import *
>>>mask = AI_NODE_LIGHT | AI_NODE_CAMERA
>>>print mask
6
_______________________________________________
The mask is 6, this is what you pass as argument.
To create a filter tha contains everything except shaders use EXCLUSIVE OR operator ( ^ )
_______________________________________________
>>>from arnold import *
>>>mask = AI_NODE_ALL ^ AI_NODE_SHADER
>>>print mask
65519
_______________________________________________
The mask is 65519, this is what you pass as argument.
Checkout something like http://www.moock.org/asdg/technotes/bitwise/ to learn more about bitwise operations.

-ll -lightLinks
Disable light linking or use mayas light links
0 = Disable
1 = Use Maya light linking

-sl, -shadowLinks
Disable shadow linking, use the same as for light links or force shadow linking
0 = Disable
1 = Use the same as specified for -lightLinks, Disabled if -ll 0 or enabled if -ll 1.
2 = Force Shadow linking on.

-ep -expandProcedurals
Export the content of procedurals into the exported ass file instead of exporting them as procedural nodes in the ass file.

-fsh -forceTranslateShadingEngines
Export shaders and assignments even if the mask is specified to not export shader.
The filter will still apply when the ass i written. The difference is that without -fsh, shapes will not have the shader parameter set at all.
But with this flag the shapes will have the shader parameter and it will be pointing to the non existing shader that got filtered when the ass was written.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Nick Burdan avatar image
Nick Burdan answered ·

I notice that in full maya gui, if no camera is set as renderable then the -cam/-camera flag can be used for a successful export. On the other hand if running thru mayapy, if no camera is set as renderable, then using the -cam/-camera flag will still result in a failure with message:

Warning: Did not find a renderable camera. (use the -cam/-camera option to specify one)

followed by an error on the arnoldExportAss() call:

RuntimeError: Maya command error

Are you able to duplicate this behaviour? I'm running maya2018 on el7

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.