Community
Arnold for 3ds Max
Rendering with Arnold in 3ds Max using the MaxtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

flags for maya.cmds.arnoldExportAss()

2 REPLIES 2
Reply
Message 1 of 3
n.burdan
4970 Views, 2 Replies

flags for maya.cmds.arnoldExportAss()

Where can I find a list of the flags that

maya.cmds.arnoldExportAss() accepts?

2 REPLIES 2
Message 2 of 3
Stephen.Blair
in reply to: n.burdan

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.



// Stephen Blair
// Arnold Renderer Support
Message 3 of 3
n.burdan
in reply to: n.burdan

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report