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

template file not working for osl shader UI

28 REPLIES 28
Reply
Message 1 of 29
Anonymous
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.: https://docs.arnoldrenderer.com/display/A5AFMUG/Creating+a+Shader

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)
28 REPLIES 28
Message 21 of 29
Anonymous
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
Anonymous
in reply to: Anonymous

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

Message 23 of 29
Anonymous
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
Anonymous
in reply to: Anonymous

ahhhh! got it....thanks for that

Message 25 of 29
Johanalv
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
rachid_1
in reply to: Johanalv

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

Message 27 of 29
Johanalv
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:
drop_down.jpg
Currently I have:
string widget = "popup" and just shows a text input where I have to manually input the text.

Message 28 of 29
rachid_1
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"
houdini.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 "

houdini.jpg


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, ...")

maya.jpg

 

Message 29 of 29
Johanalv
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