[Bf-committers] Interface Change for "new feature"

Douglas Bischoff bf-committers@blender.org
Wed, 28 May 2003 10:12:24 -0400


On Saturday, May 24, 2003, at 07:57 AM, Ton Roosendaal wrote:

> Back in '95 I already thought that using 'byte' values for color was 
> getting outdated... so Maya, Max and Photoshop still use that 
> convention? How oldfashioned!

Heh. Of course, this does beg a question: using 3 decimal places for 
color gives you quite a lot more dynamic range than 0-255 byte values. 
Is Blender using this extra range for anything? Is everything inside 
the program maintaining the dynamic range and only at the last minute 
(writing the final display file) converting to RGB byte values for 
display? If not, what is the point of having a decimal system?

> But I think the suggestion you do below is too hackish... it delivers 
> unexpected and inconsistant behaviour.

That's what you get from an amateur. :-) Thanks for replying!

> Quite more friendly would be make it a user-preset, and write a new 
> uiButton() type that displays and handles floats (range 0.0-1.0) as 
> ints (range 0-255).

I can try this if someone other than me thinks it'd be useful. Having a 
GUI button for float color vs. byte color would be okay. The only issue 
I can see would be that cycling back and forth between the two would 
require the interface to calculate & display the new value. I can't see 
from the code how to change a UI button type on the fly after it's been 
initialized in interface.c. It appears that the max & min values are 
set when the button is first created, so perhaps the button needs to be 
"destroyed" then re-created any time the UI preset is changed?

If folks think this is a worthwhile project I'll keep at it. It's a 
heck of a learning process!!

-Bischofftep