1 # paint_palette.py (c) 2011 Dany Lebel (Axon_D)
3 # ***** BEGIN GPL LICENSE BLOCK *****
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 # ***** END GPL LICENCE BLOCK *****
24 "name": "Paint Palettes",
25 "author": "Dany Lebel (Axon D)",
27 "blender": (2, 63, 0),
28 "location": "Image Editor and 3D View > Any Paint mode > Color Palette or Weight Palette panel",
29 "description": "Palettes for color and weight paint modes",
31 "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Paint/Palettes",
32 "tracker_url": "https://developer.blender.org/T25908",
36 This addon brings palettes to the paint modes.
38 * Color Palette for Image Painting, Texture Paint and Vertex Paint modes.
39 * Weight Palette for the Weight Paint mode.
41 Set a number of colors (or weights according to the mode) and then associate it
42 with the brush by using the button under the color.
46 from bpy
.props
import *
50 pp
= bpy
.context
.scene
.palette_props
51 current_color
= pp
.colors
[pp
.current_color_index
].color
52 pp
.color_name
= pp
.colors
[pp
.current_color_index
].name
53 brush
= current_brush()
54 brush
.color
= current_color
55 pp
.index
= pp
.current_color_index
58 pp
= bpy
.context
.scene
.palette_props
59 current_color
= pp
.colors
[pp
.current_color_index
]
60 brush
= current_brush()
61 current_color
.color
= brush
.color
66 if context
.area
.type == 'VIEW_3D' and context
.vertex_paint_object
:
67 brush
= context
.tool_settings
.vertex_paint
.brush
68 elif context
.area
.type == 'VIEW_3D' and context
.image_paint_object
:
69 brush
= context
.tool_settings
.image_paint
.brush
70 elif context
.area
.type == 'IMAGE_EDITOR' and context
.space_data
.mode
== 'PAINT':
71 brush
= context
.tool_settings
.image_paint
.brush
77 def update_weight_value():
78 pp
= bpy
.context
.scene
.palette_props
79 tt
= bpy
.context
.tool_settings
80 tt
.unified_paint_settings
.weight
= pp
.weight_value
84 class PALETTE_MT_menu(bpy
.types
.Menu
):
87 preset_operator
= "palette.load_gimp_palette"
89 def path_menu(self
, searchpaths
, operator
, props_default
={}):
91 # hard coded to set the operators 'filepath' to the filename.
96 if not searchpaths
[0]:
97 layout
.label("* Missing Paths *")
102 for directory
in searchpaths
:
103 files
.extend([(f
, os
.path
.join(directory
, f
)) for f
in os
.listdir(directory
)])
107 for f
, filepath
in files
:
109 if f
.startswith("."):
112 preset_name
= bpy
.path
.display_name(f
)
113 props
= layout
.operator(operator
, text
=preset_name
)
115 for attr
, value
in props_default
.items():
116 setattr(props
, attr
, value
)
118 props
.filepath
= filepath
119 if operator
== "palette.load_gimp_palette":
120 props
.menu_idname
= self
.bl_idname
122 def draw_preset(self
, context
):
123 """Define these on the subclass
128 self
.path_menu([bpy
.context
.scene
.palette_props
.presets_folder
], self
.preset_operator
)
133 class LoadGimpPalette(bpy
.types
.Operator
):
134 """Execute a preset"""
135 bl_idname
= "palette.load_gimp_palette"
136 bl_label
= "Load a Gimp palette"
138 filepath
= bpy
.props
.StringProperty(name
="Path",
139 description
="Path of the Python file to execute",
140 maxlen
=512, default
="")
141 menu_idname
= bpy
.props
.StringProperty(name
="Menu ID Name",
142 description
="ID name of the menu this was called from", default
="")
144 def execute(self
, context
):
145 from os
.path
import basename
146 filepath
= self
.filepath
148 palette_props
= bpy
.context
.scene
.palette_props
149 palette_props
.current_color_index
= 0
151 # change the menu title to the most recently chosen option
152 preset_class
= getattr(bpy
.types
, self
.menu_idname
)
153 preset_class
.bl_label
= bpy
.path
.display_name(basename(filepath
))
156 ts
= bpy
.context
.tool_settings
157 palette_props
.columns
= 0
158 if filepath
[-4:] == ".gpl":
159 gpl
= open(filepath
, "r")
160 lines
= gpl
.readlines()
161 palette_props
.notes
= ''
163 for index_0
, line
in enumerate(lines
):
164 if not line
or (line
[:12] == "GIMP Palette"):
166 elif line
[:5] == "Name:":
167 palette_props
.palette_name
= line
[5:]
168 elif line
[:8] == "Columns:":
169 palette_props
.columns
= int(line
[8:])
171 palette_props
.notes
+= line
178 for i
, ln
in enumerate(lines
[index_0
:]):
180 palette_props
.colors
[i
]
182 palette_props
.colors
.add()
183 color
= [float(rgb
)/255 for rgb
in [ln
[0:3], ln
[4:7], ln
[8:11]]]
185 palette_props
.colors
[i
].color
= color
187 palette_props
.colors
[i
].name
= ln
[12:-1]
190 while palette_props
.colors
.__len
__() > exceeding
:
191 palette_props
.colors
.remove(exceeding
)
198 self
.report({'INFO'}, "Not a supported palette format")
203 class WriteGimpPalette():
204 """Base preset class, only for subclassing
205 subclasses must define
208 bl_options
= {'REGISTER'} # only because invoke_props_popup requires.
212 name
= bpy
.props
.StringProperty(name
="Name",
213 description
="Name of the preset, used to make the path name",
214 maxlen
=64, default
="")
215 remove_active
= bpy
.props
.BoolProperty(default
=False, options
={'HIDDEN'})
218 def as_filename(name
): # could reuse for other presets
219 for char
in " !@#$%^&*(){}:\";'[]<>,.\\/?":
220 name
= name
.replace(char
, '_')
221 return name
.lower().strip()
223 def execute(self
, context
):
225 pp
= bpy
.context
.scene
.palette_props
227 if hasattr(self
, "pre_cb"):
230 preset_menu_class
= getattr(bpy
.types
, self
.preset_menu
)
232 if not self
.remove_active
:
237 filename
= self
.as_filename(self
.name
)
238 target_path
= pp
.presets_folder
241 self
.report({'WARNING'}, "Failed to create presets path")
244 filepath
= os
.path
.join(target_path
, filename
) + ".gpl"
245 file_preset
= open(filepath
, 'wb')
246 gpl
= "GIMP Palette\n"
247 gpl
+= "Name: %s\n" % filename
248 gpl
+= "Columns: %d\n" % pp
.columns
250 if pp
.colors
.items():
251 for i
, color
in enumerate(pp
.colors
):
252 gpl
+= "%3d%4d%4d %s" % (color
.color
.r
* 255, color
.color
.g
* 255, color
.color
.b
* 255, color
.name
+ '\n')
253 file_preset
.write(bytes(gpl
, 'UTF-8'))
257 pp
.palette_name
= filename
260 preset_active
= preset_menu_class
.bl_label
262 # fairly sloppy but convenient.
263 filepath
= bpy
.utils
.preset_find(preset_active
, self
.preset_subdir
)
266 filepath
= bpy
.utils
.preset_find(preset_active
,
267 self
.preset_subdir
, display_name
=True)
272 if hasattr(self
, "remove"):
273 self
.remove(context
, filepath
)
279 traceback
.print_exc()
282 preset_menu_class
.bl_label
= "Presets"
284 if hasattr(self
, "post_cb"):
285 self
.post_cb(context
)
289 def check(self
, context
):
290 self
.name
= self
.as_filename(self
.name
)
292 def invoke(self
, context
, event
):
293 if not self
.remove_active
:
294 wm
= context
.window_manager
295 return wm
.invoke_props_dialog(self
)
297 return self
.execute(context
)
300 class AddPresetPalette(WriteGimpPalette
, bpy
.types
.Operator
):
301 """Add a Palette Preset"""
302 bl_idname
= "palette.preset_add"
303 bl_label
= "Add Palette Preset"
304 preset_menu
= "PALETTE_MT_menu"
308 preset_subdir
= "palette"
311 class PALETTE_OT_add_color(bpy
.types
.Operator
):
313 bl_description
= "Add a Color to the Palette"
314 bl_idname
= "palette_props.add_color"
317 def execute(self
, context
):
318 pp
= bpy
.context
.scene
.palette_props
320 if pp
.colors
.items():
321 new_index
= pp
.current_color_index
+ 1
324 last
= pp
.colors
.__len
__() - 1
327 pp
.colors
.move(last
, new_index
)
328 pp
.current_color_index
= new_index
334 class PALETTE_OT_remove_color(bpy
.types
.Operator
):
336 bl_description
= "Remove Selected Color"
337 bl_idname
= "palette_props.remove_color"
340 def poll(cls
, context
):
341 pp
= bpy
.context
.scene
.palette_props
342 return bool(pp
.colors
.items())
345 def execute(self
, context
):
346 pp
= bpy
.context
.scene
.palette_props
347 i
= pp
.current_color_index
350 if pp
.current_color_index
>= pp
.colors
.__len
__():
351 pp
.index
= pp
.current_color_index
= pp
.colors
.__len
__() - 1
355 class PALETTE_OT_sample_tool_color(bpy
.types
.Operator
):
357 bl_description
= "Sample Tool Color"
358 bl_idname
= "palette_props.sample_tool_color"
360 def execute(self
, context
):
361 pp
= bpy
.context
.scene
.palette_props
362 brush
= current_brush()
363 pp
.colors
[pp
.current_color_index
].color
= brush
.color
367 class IMAGE_OT_select_color(bpy
.types
.Operator
):
369 bl_description
= "Select this color"
370 bl_idname
= "paint.select_color"
373 color_index
= IntProperty()
375 def invoke(self
, context
, event
):
376 palette_props
= bpy
.context
.scene
.palette_props
377 palette_props
.current_color_index
= self
.color_index
383 def color_palette_draw(self
, context
):
384 palette_props
= bpy
.context
.scene
.palette_props
390 bpy
.types
.PALETTE_MT_menu
.preset_subdir
= palette_props
.presets_folder
391 row
= layout
.row(align
=True)
392 row
.menu("PALETTE_MT_menu", text
=palette_props
.palette_name
.rstrip())
393 row
.operator("palette.preset_add", text
="", icon
="ZOOMIN")
394 row
.operator("palette.preset_add", text
="", icon
="ZOOMOUT").remove_active
= True
395 col
= layout
.column(align
=True)
396 row
= col
.row(align
=True)
397 row
.operator("palette_props.add_color", icon
="ZOOMIN")
398 row
.prop(palette_props
, "index")
399 row
.operator("palette_props.remove_color", icon
="PANEL_CLOSE")
400 row
= col
.row(align
=True)
401 row
.prop(palette_props
, "columns")
402 if palette_props
.colors
.items():
404 row
= layout
.row(align
=True)
405 row
.prop(palette_props
, "color_name")
406 row
.operator("palette_props.sample_tool_color", icon
="COLOR")
408 laycol
= layout
.column(align
=False)
410 if palette_props
.columns
:
411 columns
= palette_props
.columns
414 for i
, color
in enumerate(palette_props
.colors
):
416 row1
= laycol
.row(align
=True)
418 row2
= laycol
.row(align
=True)
421 if i
== palette_props
.current_color_index
:
423 row1
.prop(palette_props
.colors
[i
], "color", event
=True, toggle
=True)
424 row2
.operator("paint.select_color", emboss
=False).color_index
= i
426 row1
.prop(palette_props
.colors
[i
], "color", event
=True, toggle
=True)
427 row2
.operator("paint.select_color").color_index
= i
431 row
.prop(palette_props
, "presets_folder", text
="")
436 class BrushButtonsPanel():
437 bl_space_type
= 'IMAGE_EDITOR'
438 bl_region_type
= 'UI'
441 def poll(cls
, context
):
442 sima
= context
.space_data
443 toolsettings
= context
.tool_settings
.image_paint
444 return sima
.show_paint
and toolsettings
.brush
448 bl_space_type
= 'VIEW_3D'
449 bl_region_type
= 'TOOLS'
452 def paint_settings(context
):
453 ts
= context
.tool_settings
455 if context
.vertex_paint_object
:
456 return ts
.vertex_paint
457 elif context
.weight_paint_object
:
458 return ts
.weight_paint
459 elif context
.texture_paint_object
:
460 return ts
.image_paint
464 class IMAGE_PT_color_palette(BrushButtonsPanel
, bpy
.types
.Panel
):
465 bl_label
= "Color Palette"
466 bl_options
= {'DEFAULT_CLOSED'}
468 def draw(self
, context
):
469 color_palette_draw(self
, context
)
472 class VIEW3D_PT_color_palette(PaintPanel
, bpy
.types
.Panel
):
473 bl_label
= "Color Palette"
474 bl_options
= {'DEFAULT_CLOSED'}
477 def poll(cls
, context
):
478 return (context
.image_paint_object
or context
.vertex_paint_object
)
480 def draw(self
, context
):
481 color_palette_draw(self
, context
)
484 class VIEW3D_OT_select_weight(bpy
.types
.Operator
):
486 bl_description
= "Select this weight"
487 bl_idname
= "paint.select_weight"
489 weight_index
= IntProperty()
491 def current_weight(self
):
492 pp
= bpy
.context
.scene
.palette_props
493 if self
.weight_index
== 0:
495 elif self
.weight_index
== 1:
497 elif self
.weight_index
== 2:
499 elif self
.weight_index
== 3:
501 elif self
.weight_index
== 4:
503 elif self
.weight_index
== 5:
505 elif self
.weight_index
== 6:
507 elif self
.weight_index
== 7:
509 elif self
.weight_index
== 8:
511 elif self
.weight_index
== 9:
513 elif self
.weight_index
== 10:
514 weight
= pp
.weight_10
517 def invoke(self
, context
, event
):
518 palette_props
= bpy
.context
.scene
.palette_props
520 palette_props
.current_weight_index
= self
.weight_index
522 if self
.weight_index
== 0:
523 weight
= palette_props
.weight_0
524 elif self
.weight_index
== 1:
525 weight
= palette_props
.weight_1
526 elif self
.weight_index
== 2:
527 weight
= palette_props
.weight_2
528 elif self
.weight_index
== 3:
529 weight
= palette_props
.weight_3
530 elif self
.weight_index
== 4:
531 weight
= palette_props
.weight_4
532 elif self
.weight_index
== 5:
533 weight
= palette_props
.weight_5
534 elif self
.weight_index
== 6:
535 weight
= palette_props
.weight_6
536 elif self
.weight_index
== 7:
537 weight
= palette_props
.weight_7
538 elif self
.weight_index
== 8:
539 weight
= palette_props
.weight_8
540 elif self
.weight_index
== 9:
541 weight
= palette_props
.weight_9
542 elif self
.weight_index
== 10:
543 weight
= palette_props
.weight_10
544 palette_props
.weight
= weight
545 #bpy.context.tool_settings.vertex_group_weight = weight
549 class VIEW3D_OT_reset_weight_palette(bpy
.types
.Operator
):
551 bl_idname
= "paint.reset_weight_palette"
554 def execute(self
, context
):
555 palette_props
= context
.scene
.palette_props
557 if palette_props
.current_weight_index
== 0:
558 palette_props
.weight
= 0.0
559 palette_props
.weight_0
= 0.0
561 palette_props
.weight_1
= 0.1
562 if palette_props
.current_weight_index
== 1:
563 palette_props
.weight
= 0.1
565 if palette_props
.current_weight_index
== 2:
566 palette_props
.weight
= 0.25
567 palette_props
.weight_2
= 0.25
569 if palette_props
.current_weight_index
== 3:
570 palette_props
.weight
= 0.3333
571 palette_props
.weight_3
= 0.3333
573 if palette_props
.current_weight_index
== 4:
574 palette_props
.weight
= 0.4
575 palette_props
.weight_4
= 0.4
577 if palette_props
.current_weight_index
== 5:
578 palette_props
.weight
= 0.5
579 palette_props
.weight_5
= 0.5
581 if palette_props
.current_weight_index
== 6:
582 palette_props
.weight
= 0.6
583 palette_props
.weight_6
= 0.6
585 if palette_props
.current_weight_index
== 7:
586 palette_props
.weight
= 0.6666
587 palette_props
.weight_7
= 0.6666
589 if palette_props
.current_weight_index
== 8:
590 palette_props
.weight
= 0.75
591 palette_props
.weight_8
= 0.75
593 if palette_props
.current_weight_index
== 9:
594 palette_props
.weight
= 0.9
595 palette_props
.weight_9
= 0.9
597 if palette_props
.current_weight_index
== 10:
598 palette_props
.weight
= 1.0
599 palette_props
.weight_10
= 1.0
602 class VIEW3D_PT_weight_palette(PaintPanel
, bpy
.types
.Panel
):
603 bl_label
= "Weight Palette"
604 bl_options
= {'DEFAULT_CLOSED'}
607 def poll(cls
, context
):
608 return context
.weight_paint_object
610 def draw(self
, context
):
611 palette_props
= bpy
.context
.scene
.palette_props
612 #vertex_group_weight = bpy.context.tool_settings.unified_paint_settings.weight
616 row
.prop(palette_props
, "weight", slider
=True)
620 if palette_props
.current_weight_index
== 0:
621 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_0
,
622 emboss
=False).weight_index
= 0
624 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_0
,
625 emboss
=True).weight_index
= 0
627 row
= box
.row(align
=True)
628 if palette_props
.current_weight_index
== 1:
629 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_1
,
630 emboss
=False).weight_index
= 1
632 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_1
,
633 emboss
=True).weight_index
= 1
635 if palette_props
.current_weight_index
== 2:
636 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_2
,
637 emboss
=False).weight_index
= 2
639 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_2
,
640 emboss
=True).weight_index
= 2
642 if palette_props
.current_weight_index
== 3:
643 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_3
,
644 emboss
=False).weight_index
= 3
646 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_3
,
647 emboss
=True).weight_index
= 3
649 row
= box
.row(align
=True)
650 if palette_props
.current_weight_index
== 4:
651 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_4
,
652 emboss
=False).weight_index
= 4
654 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_4
,
655 emboss
=True).weight_index
= 4
657 if palette_props
.current_weight_index
== 5:
658 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_5
,
659 emboss
=False).weight_index
= 5
661 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_5
,
662 emboss
=True).weight_index
= 5
664 if palette_props
.current_weight_index
== 6:
665 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_6
,
666 emboss
=False).weight_index
= 6
668 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_6
,
669 emboss
=True).weight_index
= 6
671 row
= box
.row(align
=True)
672 if palette_props
.current_weight_index
== 7:
673 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_7
,
674 emboss
=False).weight_index
= 7
676 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_7
,
677 emboss
=True).weight_index
= 7
679 if palette_props
.current_weight_index
== 8:
680 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_8
,
681 emboss
=False).weight_index
= 8
683 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_8
,
684 emboss
=True).weight_index
= 8
686 if palette_props
.current_weight_index
== 9:
687 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_9
,
688 emboss
=False).weight_index
= 9
690 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_9
,
691 emboss
=True).weight_index
= 9
693 row
= box
.row(align
=True)
694 if palette_props
.current_weight_index
== 10:
695 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_10
,
696 emboss
=False).weight_index
= 10
698 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_10
,
699 emboss
=True).weight_index
= 10
702 row
.operator("paint.reset_weight_palette", text
="Reset")
705 class Colors(bpy
.types
.PropertyGroup
):
706 """Class for colors CollectionProperty"""
707 color
= bpy
.props
.FloatVectorProperty(
708 name
="", description
="", default
=(0.8, 0.8, 0.8), min=0, max=1,
709 step
=1, precision
=3, subtype
='COLOR_GAMMA', size
=3)
712 class Weights(bpy
.types
.PropertyGroup
):
713 """Class for Weights Collection Property"""
715 weight
= bpy
.props
.FloatProperty(
716 default
=0.0, min=0.0, max=1.0, precision
=3)
719 class PaletteProps(bpy
.types
.PropertyGroup
):
721 def update_color_name(self
, context
):
722 pp
= bpy
.context
.scene
.palette_props
723 pp
.colors
[pp
.current_color_index
].name
= pp
.color_name
726 def move_color(self
, context
):
727 pp
= bpy
.context
.scene
.palette_props
728 if pp
.colors
.items() and pp
.current_color_index
!= pp
.index
:
729 if pp
.index
>= pp
.colors
.__len
__():
730 pp
.index
= pp
.colors
.__len
__() - 1
731 pp
.colors
.move(pp
.current_color_index
, pp
.index
)
732 pp
.current_color_index
= pp
.index
735 def update_weight(self
, context
):
736 pp
= context
.scene
.palette_props
738 if pp
.current_weight_index
== 0:
740 elif pp
.current_weight_index
== 1:
742 elif pp
.current_weight_index
== 2:
744 elif pp
.current_weight_index
== 3:
746 elif pp
.current_weight_index
== 4:
748 elif pp
.current_weight_index
== 5:
750 elif pp
.current_weight_index
== 6:
752 elif pp
.current_weight_index
== 7:
754 elif pp
.current_weight_index
== 8:
756 elif pp
.current_weight_index
== 9:
758 elif pp
.current_weight_index
== 10:
759 pp
.weight_10
= weight
760 bpy
.context
.tool_settings
.unified_paint_settings
.weight
= weight
761 #bpy.context.tool_settings.vertex_group_weight = weight
764 palette_name
= StringProperty(
765 name
="Palette Name", default
="Preset", subtype
='FILE_NAME')
767 color_name
= StringProperty(
768 name
="", description
="Color Name", default
="Untitled", update
=update_color_name
)
770 columns
= IntProperty(
772 description
="Number of Columns",
773 min=0, max=16, default
=0)
777 description
="Move Selected Color",
781 notes
= StringProperty(
782 name
="Palette Notes", default
="#\n")
784 current_color_index
= IntProperty(
785 name
="Current Color Index", description
="", default
=0, min=0)
787 current_weight_index
= IntProperty(
788 name
="Current Color Index", description
="", default
=10, min=-1)
790 presets_folder
= StringProperty(name
="",
791 description
="Palettes Folder",
794 colors
= bpy
.props
.CollectionProperty(type=Colors
)
796 weight
= bpy
.props
.FloatProperty(name
="Weight",
797 default
=0.0, min=0.0, max=1.0, precision
=3, update
=update_weight
)
799 weight_0
= bpy
.props
.FloatProperty(
800 default
=0.0, min=0.0, max=1.0, precision
=3)
801 weight_1
= bpy
.props
.FloatProperty(
802 default
=0.1, min=0.0, max=1.0, precision
=3)
803 weight_2
= bpy
.props
.FloatProperty(
804 default
=0.25, min=0.0, max=1.0, precision
=3)
805 weight_3
= bpy
.props
.FloatProperty(
806 default
=0.333, min=0.0, max=1.0, precision
=3)
807 weight_4
= bpy
.props
.FloatProperty(
808 default
=0.4, min=0.0, max=1.0, precision
=3)
809 weight_5
= bpy
.props
.FloatProperty(
810 default
=0.5, min=0.0, max=1.0, precision
=3)
811 weight_6
= bpy
.props
.FloatProperty(
812 default
=0.6, min=0.0, max=1.0, precision
=3)
813 weight_7
= bpy
.props
.FloatProperty(
814 default
=0.6666, min=0.0, max=1.0, precision
=3)
815 weight_8
= bpy
.props
.FloatProperty(
816 default
=0.75, min=0.0, max=1.0, precision
=3)
817 weight_9
= bpy
.props
.FloatProperty(
818 default
=0.9, min=0.0, max=1.0, precision
=3)
819 weight_10
= bpy
.props
.FloatProperty(
820 default
=1.0, min=0.0, max=1.0, precision
=3)
824 bpy
.utils
.register_module(__name__
)
826 bpy
.types
.Scene
.palette_props
= PointerProperty(
827 type=PaletteProps
, name
="Palette Props", description
="")
832 bpy
.utils
.unregister_module(__name__
)
834 del bpy
.types
.Scene
.palette_props
838 if __name__
== "__main__":
843 # ToDo1 Overiting the current file
844 # ToDo3 Foreground Background