[tuhopuu-devel] Re: [tuhopuu-cvs] CVS commit: tuhopuu3/source/blender/src buttons_object.c buttons_scene.c buttons_shading.c interface.c space.c

Matt Ebb matt at mke3.net
Tue Apr 5 04:45:31 CEST 2005


On 5 Apr 2005, at 11:52 AM, Matt Ebb wrote:

>  * Allow ROW buts to toggle bits as well as TOGs. Syntax is pretty
>   similar, use ROW|BIT|# where # is the bit position, 1.0 for the
>   'min' and 0.0 and 1.0 for the 'max' values. More explanation to
>   come on tuhopuu-dev

When I first asked Ton about this, he didn't really understand why it 
was necessary, and I can imagine some of you more programming minded 
folks may be wondering the same. i.e. "a bit is a bit, and switching it 
on and off with a TOG button is all you need, right?" Well, no. What's 
important to the user is not that it's a bit, but what that bit 
represents. And it so happens that bits are a convenient and memory 
saving way to store not only a choice between on and off, but also a 
choice between two discrete options.

Conceptually, this is the difference between "something and nothing" 
and "something and something else". Toggle buttons work great when you 
want to represent something vs nothing, but not for the latter case. An 
example of this is the [OB] and [ME] buttons in material buttons, to 
choose whether a material is linked to the Object block or the Mesh 
block. This is a choice between two separate states, but internally, 
this is just toggling a bit: MAT_ON_OB. Representing it like with a 
toggle button in the interface would be very ambiguous. What would it 
mean to turn off the 'Material on Object' button? Would it not link the 
material at all? Would it link it to the Scene or the World? So 
instead, there are the two [OB] and [ME] buttons to represent the two 
different states that you can choose between.

Historically, this has been done with a bit of a hack, putting a TOG 
and a TOGN button next to each other, and hoping that nobody would 
realise that they're not actually row buttons since although they 
looked like rows, they still functioned as toggles (i.e. click a button 
twice and the counterpart is selected). With the new button design in 
t3, ROWs look different to TOGs, and made those TOG/TOGN pairs look 
very weird and ugly. So this last commit is just giving a proper 
solution to that past hack.

Anyway, a bit of a digression, I just thought this info might be 
interesting or useful to someone.

Cheers,

Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2355 bytes
Desc: not available
Url : http://projects.blender.org/pipermail/tuhopuu-devel/attachments/20050405/590f721c/smime.bin


More information about the tuhopuu-devel mailing list