Arnold for Maya Forum
Rendering with Arnold in Maya using the MtoA plug-in.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

template file not working for osl shader UI

Message 1 of 29
1709 Views, 28 Replies

template file not working for osl shader UI

hey guys, I'm making an UI for my osl shader and everything compiles fine if I put just one control to the template file. but as soon as I put another control, the template file is no longer compiled by maya...don't know why........

this is the link to the doc.:

it works fine for just one parameter.....asa I do self.addControl(bla bla bla) on another line it doesn't work

Tags (2)
Labels (2)
Message 21 of 29
in reply to: Anonymous

do you know how can i compile all these files(template, mtd and osl) without restarting maya?

cause right now I'm into a recursive process of restarting maya...xd

Message 22 of 29
in reply to: Anonymous

no way, you have to restart Maya each time you change the code

Message 23 of 29
in reply to: Anonymous

If maya.classification STRING "shader/surface" you get automatically normalCamera & hardwareColor.
So you have to use self.suppress!

Message 24 of 29
in reply to: Anonymous

ahhhh! got it....thanks for that

Message 25 of 29
in reply to: Anonymous

Hey, is it possible to share how you got the checkbox working with osl/template file? Can't seem to find the way. Thanks

Message 26 of 29
in reply to: Johanalv

You have to change "string widget" to "boolean" in your osl shader
like this:
string widget = "boolean",

Message 27 of 29
in reply to: rachid_1

Thanks! That actually works. btw, do you if it's possible to add a drop down menu as a widget? Like this:
Currently I have:
string widget = "popup" and just shows a text input where I have to manually input the text.

Message 28 of 29
in reply to: Johanalv

I asked the same question almost 4 years ago, but no answer! any way in Houdini you do that in .mtd file by adding this lines:
houdini.type STRING "menu:replace:menu" STRING "Normal;Normal;Average;Average;Darken;Darken;Multiply;Multiply;Color Burn;Color Burn;Linear Burn;Linear Burn;Lighten;Lighten;Screen;Screen;Color Dodge;Color Dodge;Linear Dodge;Linear Dodge;Spotlight;Spotlight;Spotlight Blend;Spotlight Blend;Overlay;Overlay;Hard Light;Hard Light;Soft Light;Soft Light;Pin Light;Pin Light;Hard Mix;Hard Mix;Difference;Difference;Exclusion;Exclusion;Subtract;Subtract;Divide;Divide;Hue;Hue;Saturation;Saturation;Color;Color;Value;Value "


What you can do in Maya is add "annotation", in aeTemplate, that way you have a popup showing a list, but you have to enable:
"display ToolClips" in Maya Preference/Help/Popup Help
some things like this:
annotation="Normal, Average, Darken, ...")



Message 29 of 29
in reply to: Anonymous

Thanks a lot, guess that's currently a limitation of Arnold's osl implementation. 

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

Post to forums  

Technology Administrators

Autodesk Design & Make Report