How to use "selector" xml fragment in Viewport 2.0

How to use "selector" xml fragment in Viewport 2.0

ianhuang2333
Explorer Explorer
254 Views
1 Reply
Message 1 of 2

How to use "selector" xml fragment in Viewport 2.0

ianhuang2333
Explorer
Explorer

I'm trying to use some locators to control the surface shading in Viewport 2.0. It could work like multiple lightings and generate various shading effect. I found onbShader examples in devkit and guessed I could use "accum" and "selector" xml fragments. 

 

My assumption is to build custom "selector" and corresponding "struct", but I don't know how to pass the data from DAG attribute to this "struct" parameter.

I can't find any more details about other types of xml fragment in relative documentations. The only "selector" fragment shown is mayaLightSelector16 but it's default built lighting and can use semantics to pass data.

 

What if I try to build the fragment graph like phong

https://help.autodesk.com/view/MAYAUL/2020/ENU/?guid=__developer_Maya_SDK_MERGED_Viewport_2_0_API_Ma... 

how to pass attribute data to those parameters of struct type (like light0 in phong etc.)?

 

0 Likes
255 Views
1 Reply
Reply (1)
Message 2 of 2

ianhuang2333
Explorer
Explorer

Simplify my questions

1. Could I build my own selector fragment? Or is it exclusive for mayaLightSelector16 ?

2. If I could, how to map the attributes with the parameters in selector fragment?

For example, I have a fragment graph like phong above. I replace the mayaLightSelector16 and mayaIrradiance

with my own selector and struct. Now what type of DAG node attributes can I use and how to map them with the parameters of struct type like light0, light1 etc. in the fragment graph?

0 Likes