(08-01-2016, 08:49 PM)david.bluecame Wrote: I'm slowly progressing in setting hooks and keys to disable/hide unused fields depending on the values of other fields.The hook (callback) is fired everytime the field it was assigned is changed.
To enable/disable or show/hide a control we are going to use its ID (key property). To apply that to a group of controls we must to have them into a vframe/hframe with an ID. These controls don't need to have a ID except for this application.
The show/hide action requires the parent group control to be updated, so you will need to define an ID for it too.
For situations where the number of control in a dialog is high (if compared to the visible ones depending on a selection) we must ensure only the group of controls for the "worst" situation (more control visible at once) will be visible at the dialog startup.
We do that by defining the the show property of the group as false. You will find that in the Texture tab for the material. (shaders frame).
You will find an Enable_Hook and a Show_Hook in the Yafaray source code, but they would be only one hook function. It was used that way to make easy to understand the code.
Just by checking the material dialogs and comparing them with the old ones I noticed they have changed a lot. Is that correct or was it a side effect of removing the SSS material?
See the Shiny Diffuse for example:
All the old dialogs can be found in this link. Look for files named 04-Yafaray-2a.jpg ... 04-Yafaray-2h.jpg