Python commands for Arnold?

Python commands for Arnold?

yesthatjohn
Contributor Contributor
8,441 Views
6 Replies
Message 1 of 7

Python commands for Arnold?

yesthatjohn
Contributor
Contributor

Are there Python commands to create lights in Arnold?  I found the arnold module, but I don't see any commands related to lights.  Does anyone have resources to learn how to do this stuff?  Any help appreciated.

0 Likes
Accepted solutions (1)
8,442 Views
6 Replies
Replies (6)
Message 2 of 7

sean.heasley
Alumni
Alumni

Hi @yesthatjohn and welcome to the community!

 

I'm curious as to why you're looking for a python command with Arnold lights.

 

Does manually placing the lights from the arnold drop down not work for you? When you get a chance, please come back with a bit more information so I can properly assist you!

0 Likes
Message 3 of 7

Stephen.Blair
Community Manager
Community Manager
Accepted solution

No, Not for creating lights in Maya.

 

That's actually MtoA, not Arnold, and in this case the distinction is important.

 

If you really want to dig into how MtoA creates the nodes in a Maya scene, you can start with C:\solidangle\mtoadeploy\2017\scripts\mtoa\ui\arnoldmenu.py

 

That's the code for the Arnold menu, including the Arnold > Lights menu. But it's not an API, so it's not designed for public use.

 

 

 

 

Arnold itself is a rendering library with a C++ API. And that API has Python bindings, so you can create Arnold lights using the Arnold Python api. 

 

But that's not what happens inside Maya. Inside Maya you have the MtoA plugin creating Maya nodes (eg a locator for an area light)

 

 


@yesthatjohn wrote:

Are there Python commands to create lights in Arnold?  I found the arnold module, but I don't see any commands related to lights.  Does anyone have resources to learn how to do this stuff?  Any help appreciated.


 



// Stephen Blair
// Arnold Renderer Support
Message 4 of 7

sean.heasley
Alumni
Alumni

Hi @yesthatjohn

 

I'm just checking in to see if you need more help with this. Did the suggestion that @Stephen.Blair provided work for you?

If so, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

0 Likes
Message 5 of 7

yesthatjohn
Contributor
Contributor

Hi,

 

That was a big help.  Thx!  On my Centos 7 distribution I found the file you mentioned here:

 

/opt/solidangle/mtoa/2017/scripts/mtoa/ui

0 Likes
Message 6 of 7

rdavidowitz
Contributor
Contributor

It's been a while. Have Python commands been added for the Arnold lights? 

0 Likes
Message 7 of 7

syby119
Explorer
Explorer
To create an area light in arnold, simply use cmds.createNode("aiAreaLight")
0 Likes