Snarlygribbly opened this issue on Aug 05, 2014 ยท 13 posts
Snarlygribbly posted Tue, 05 August 2014 at 10:30 AM
Ignoring that little bug for the moment, let's turn our attention to the plugin's user interface (UI).
At line 50 of ez_Porcelain_05.py you can see the variable 'data' assigned with a bunch of nested tuples that define all the controls to be presented to the user.
Those are the default controls though, only there to provide examples of the various controls available. If you check out the equivalent assignemnt in ez_Porcelain_06.py you will see the four controls that I have chosen to implement for this plugin.
Let's look at one of them in more detail.
The first control is defined like this:
('ior',('IOR', 'float', (1.00, 2.00), 1.50, 'Index of Refraction'))
And this is what each bit of the definition means:
'ior' is the name we will use in our code to refer to this control later
'IOR' is the label that the user will see
'float' is the type of value returned by the control, in this case a floating point numerical value
'(1.00, 2.00)' is the minimum and maximum values allowed
'1.50' is the default value
'Index of Refraction' is the tooltip that appears when the mouse is over the control
These controls are managed entirely by EZMat, including the saving of presets etc.
In our code, i.e. using the conventions we have adopted for variable names, we can obtain the value of a control (e.g. the IOR control) thus:
self.pm.GetParameter('ior')
Easy :-)
Free stuff @ https://poser.cobrablade.net/