[MtoA]Rendering to Texture

[MtoA]Rendering to Texture

Anonymous
Not applicable
2,011 Views
2 Replies
Message 1 of 3

[MtoA]Rendering to Texture

Anonymous
Not applicable

hello everyone,

 

I want to write a python-script that batch renders shaders to textures using render to texture from Arnold, but I'm already stuck at step one.

 

cmds.arnoldRenderToTexture("Path")

 

Produces an error "No geometry selected" no matter how many Meshes I have selected in the scene. cmds.ls(sl=1) confirms, that I have selected something. I have inspected the python-file for render to texture and found the line, where the script checks for selected objects.

For reference:

[...]

selList = cmds.ls(sl=1)

        if (len(selList) == 0):
            cmds.confirmDialog( title='Render To Texture', message='No Geometry Selected', button=['Ok'], defaultButton='Ok', cancelButton='Ok', dismissString='Ok' )
            return False

        cmds.arnoldRenderToTexture(folder=outFolder, shader=shader, resolution=resolution, aa_samples=aa_sampling, filter=filter_type, filter_width=filter_width, all_udims=all_udims, udims=udims, uv_set=uv_set, normal_offset=normalOffset, enable_aovs=enableAovs, extend_edges=extendEdges,u_start=uStart, u_scale=uScale, v_start=vStart, v_scale=vScale, sequence= useSequence, frame_start=frameStart, frame_end=frameEnd, frame_step=frameStep, frame_padding=framePadding)

[...]

 

The error should not appear, as long as I have selected something. But it does.

Any help is much appreciated, thank you. 

Btw. Doing the same manually with the Arnold Utilities works just fine.

0 Likes
Accepted solutions (1)
2,012 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

Was able to solve it myself. It appears, that the function has to be called as

 

cmds.arnoldRenderToTexture(folder=path)

 

and for some reason, if the folder argument is not explicitly stated it will produce the above error. Strange. There go 2 hours of my life.

Message 3 of 3

mushu.damaschin
Explorer
Explorer

Your two hours were not wasted good sir, it was quite useful to me.

0 Likes