Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve auto UI generation #9

Open
JenusL opened this issue Apr 19, 2018 · 13 comments
Open

Improve auto UI generation #9

JenusL opened this issue Apr 19, 2018 · 13 comments

Comments

@JenusL
Copy link
Contributor

JenusL commented Apr 19, 2018

Auto UI generation is made for all native Arnold shaders by the help of a metadata file called arnold_shaders.mtd. Some features would be good do add to that auto generation:

Tabs
Auto UI generation currently lacks the function to create Tabs.
This would come in handy if we want to implement ID AOVs #10

Disabling
The arnold_shaders.mtd has a lot of disable expressions like
soft.disable_when STRING "{ material != custom }"
but there's currently no support for it in the auto generation code.
This should also be implemented.

@caron
Copy link
Contributor

caron commented Jul 27, 2018

I started to work on this and I am wondering if we agree this is the right place to put it...

soft.order STRING "AddTab My_Tab BeginGroup My_Group param1 param2 EndGroup"

Should look like this...

_________
| My Tab |
__________________________
|   ---My Group---------
|  | param1             |
|  | param2             |
|   --------------------
__________________________

Thoughts?

@JenusL
Copy link
Contributor Author

JenusL commented Jul 30, 2018

I think it looks nice and clean.
Just one question… Is the AddTab required for the default first tab or only for extra tabs?
I would prefer if it was only for extra tabs.

@caron
Copy link
Contributor

caron commented Jul 31, 2018

So if you do this...

[node mynode]
soft.order STRING "param1 param2 AddTab My_Tab param3 param4"

You will get a first tab named 'mynode' with param1 and param2 on it. Then a second tab named 'My Tab' with param3 and param4 on it. This is just Softimage PPG's default behavior I believe. Nothing in the SItoA code is deciding this.

@caron
Copy link
Contributor

caron commented Jul 31, 2018

So I wanted to brainstorm about implementing this parameter disabling PPGLogic in mtd files. So I think we have to use the PutLogic method of the PPGLayout class...

PPGLayout::PutLogic

@sjannuz you defined some logic in the metadata file already for this. It exists on the parameter/attr... what was your initial design? Using PutLogic with a scripting language? Or some other dynamic way in C++? Right now since the PPGLogic exists on the entire PPGLayout and not on individual parameters I would need to collect all the soft.disable_when metadatas when params are defined and then build the script logic somewhere before or during the Layout function where it gets "put".

@sjannuz
Copy link
Contributor

sjannuz commented Aug 20, 2018

Hi Steven. The metadata file contains more than what SItoA handles, simply because it was common to the other plugins (HtoA was the first fetching the logic from the mtd). Then I did not have the time to include it in SItoA, nor any exact plan about how to handle it in the code.

@JenusL
Copy link
Contributor Author

JenusL commented Aug 21, 2018

@caron Could you create a PR with the just the tab-stuff and we save the disabling for later?

@caron
Copy link
Contributor

caron commented Aug 21, 2018

I can once I return from vacationing next week.

@caron
Copy link
Contributor

caron commented Aug 27, 2018

@sjannuz Thanks for the feedback. I want to be sure .mtd file made for SItoA works with other plugins and vice-versa. Is there any .mtd files from other plugins I can use to test?

@JenusL
Copy link
Contributor Author

JenusL commented Aug 27, 2018

I think the .mtd files are pretty different across the different plugins but I guess you could try.
The maya one can be found here: https://trac.solidangle.com/mtoa/browser/mtoa/plugins/mtoa/mtoa.mtd
That's the one I take min/max softmin/softmax from when I've added new shaders to SItoA.

@caron
Copy link
Contributor

caron commented Aug 28, 2018

Thanks, @JenusL but I don't see any disable_when examples. But looking closer now the soft. prefix will make it specific to SItoA and I won't need to worry about supporting another one.

@JenusL
Copy link
Contributor Author

JenusL commented Aug 28, 2018

Yeah the soft. prefix will make it safe so use that.

@JenusL
Copy link
Contributor Author

JenusL commented Sep 4, 2018

I just want to say, for traceability sake, that I extended the auto UI generation by adding support for soft.node_type in #26

@caron
Copy link
Contributor

caron commented Sep 4, 2018

I will make sure to work on top of #26 when supporting 'disabling metadata'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants