From cf9b728c6a1cb600c721bea1823206047ab1c5c7 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 7 Jan 2010 09:55:11 +0000 Subject: Color Picker work: Restored the old Eyedropper tool from the 2.4 colour picker. Now it's an operator, working nicely using rna properties (fixes #19475 and some todo items) This ended up being a bit more work than expected, it involved converting the colour picker to use RNA properties directly, rather than temporary values. This has several advantages, including being able to type in RGB values greater than 1, however there are still some redraw issues with sliders. Also removed the alternate color pickers after this time spent testing, the current one should be sufficient, or alternatives to the wheel can possibly become preferences in the current design. Converting the picker to RNA also made it very trivial to make a cool new ColorWheel template, which can be embedded in UI layouts. I've enabled it already in texture/vertex paint brush properties and the sequence editor color correction: http://mke3.net/blender/devel/2.5/colorwheels.jpg --- source/blender/makesrna/intern/rna_ui_api.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/makesrna/intern/rna_ui_api.c') diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index de20da0c0ca..011235c862f 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -335,6 +335,10 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); + func= RNA_def_function(srna, "template_color_wheel", "uiTemplateColorWheel"); + api_ui_item_rna_common(func); + RNA_def_boolean(func, "value_slider", 0, "", "Display the value slider to the right of the color wheel"); + func= RNA_def_function(srna, "template_triColorSet", "uiTemplateTriColorSet"); api_ui_item_rna_common(func); -- cgit v1.2.3