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/"
32 "Scripts/Paint/Palettes",
37 This addon brings palettes to the paint modes.
39 * Color Palette for Image Painting, Texture Paint and Vertex Paint modes.
40 * Weight Palette for the Weight Paint mode.
42 Set a number of colors (or weights according to the mode) and then associate it
43 with the brush by using the button under the color.
47 from bpy
.props
import *
51 pp
= bpy
.context
.scene
.palette_props
52 current_color
= pp
.colors
[pp
.current_color_index
].color
53 pp
.color_name
= pp
.colors
[pp
.current_color_index
].name
54 brush
= current_brush()
55 brush
.color
= current_color
56 pp
.index
= pp
.current_color_index
59 pp
= bpy
.context
.scene
.palette_props
60 current_color
= pp
.colors
[pp
.current_color_index
]
61 brush
= current_brush()
62 current_color
.color
= brush
.color
67 if context
.area
.type == 'VIEW_3D' and context
.vertex_paint_object
:
68 brush
= context
.tool_settings
.vertex_paint
.brush
69 elif context
.area
.type == 'VIEW_3D' and context
.image_paint_object
:
70 brush
= context
.tool_settings
.image_paint
.brush
71 elif context
.area
.type == 'IMAGE_EDITOR' and context
.space_data
.mode
== 'PAINT':
72 brush
= context
.tool_settings
.image_paint
.brush
78 def update_weight_value():
79 pp
= bpy
.context
.scene
.palette_props
80 tt
= bpy
.context
.tool_settings
81 tt
.unified_paint_settings
.weight
= pp
.weight_value
85 class PALETTE_MT_menu(bpy
.types
.Menu
):
88 preset_operator
= "palette.load_gimp_palette"
90 def path_menu(self
, searchpaths
, operator
, props_default
={}):
92 # hard coded to set the operators 'filepath' to the filename.
97 if not searchpaths
[0]:
98 layout
.label("* Missing Paths *")
103 for directory
in searchpaths
:
104 files
.extend([(f
, os
.path
.join(directory
, f
)) for f
in os
.listdir(directory
)])
108 for f
, filepath
in files
:
110 if f
.startswith("."):
113 preset_name
= bpy
.path
.display_name(f
)
114 props
= layout
.operator(operator
, text
=preset_name
)
116 for attr
, value
in props_default
.items():
117 setattr(props
, attr
, value
)
119 props
.filepath
= filepath
120 if operator
== "palette.load_gimp_palette":
121 props
.menu_idname
= self
.bl_idname
123 def draw_preset(self
, context
):
124 """Define these on the subclass
129 self
.path_menu([bpy
.context
.scene
.palette_props
.presets_folder
], self
.preset_operator
)
134 class LoadGimpPalette(bpy
.types
.Operator
):
135 """Execute a preset"""
136 bl_idname
= "palette.load_gimp_palette"
137 bl_label
= "Load a Gimp palette"
139 filepath
= bpy
.props
.StringProperty(name
="Path",
140 description
="Path of the Python file to execute",
141 maxlen
=512, default
="")
142 menu_idname
= bpy
.props
.StringProperty(name
="Menu ID Name",
143 description
="ID name of the menu this was called from", default
="")
145 def execute(self
, context
):
146 from os
.path
import basename
147 filepath
= self
.filepath
149 palette_props
= bpy
.context
.scene
.palette_props
150 palette_props
.current_color_index
= 0
152 # change the menu title to the most recently chosen option
153 preset_class
= getattr(bpy
.types
, self
.menu_idname
)
154 preset_class
.bl_label
= bpy
.path
.display_name(basename(filepath
))
157 ts
= bpy
.context
.tool_settings
158 palette_props
.columns
= 0
159 if filepath
[-4:] == ".gpl":
160 gpl
= open(filepath
, "r")
161 lines
= gpl
.readlines()
162 palette_props
.notes
= ''
164 for index_0
, line
in enumerate(lines
):
165 if not line
or (line
[:12] == "GIMP Palette"):
167 elif line
[:5] == "Name:":
168 palette_props
.palette_name
= line
[5:]
169 elif line
[:8] == "Columns:":
170 palette_props
.columns
= int(line
[8:])
172 palette_props
.notes
+= line
179 for i
, ln
in enumerate(lines
[index_0
:]):
181 palette_props
.colors
[i
]
183 palette_props
.colors
.add()
184 color
= [float(rgb
)/255 for rgb
in [ln
[0:3], ln
[4:7], ln
[8:11]]]
186 palette_props
.colors
[i
].color
= color
188 palette_props
.colors
[i
].name
= ln
[12:-1]
191 while palette_props
.colors
.__len
__() > exceeding
:
192 palette_props
.colors
.remove(exceeding
)
199 self
.report({'INFO'}, "Not a supported palette format")
204 class WriteGimpPalette():
205 """Base preset class, only for subclassing
206 subclasses must define
209 bl_options
= {'REGISTER'} # only because invoke_props_popup requires.
213 name
= bpy
.props
.StringProperty(name
="Name",
214 description
="Name of the preset, used to make the path name",
215 maxlen
=64, default
="")
216 remove_active
= bpy
.props
.BoolProperty(default
=False, options
={'HIDDEN'})
219 def as_filename(name
): # could reuse for other presets
220 for char
in " !@#$%^&*(){}:\";'[]<>,.\\/?":
221 name
= name
.replace(char
, '_')
222 return name
.lower().strip()
224 def execute(self
, context
):
226 pp
= bpy
.context
.scene
.palette_props
228 if hasattr(self
, "pre_cb"):
231 preset_menu_class
= getattr(bpy
.types
, self
.preset_menu
)
233 if not self
.remove_active
:
238 filename
= self
.as_filename(self
.name
)
239 target_path
= pp
.presets_folder
242 self
.report({'WARNING'}, "Failed to create presets path")
245 filepath
= os
.path
.join(target_path
, filename
) + ".gpl"
246 file_preset
= open(filepath
, 'wb')
247 gpl
= "GIMP Palette\n"
248 gpl
+= "Name: %s\n" % filename
249 gpl
+= "Columns: %d\n" % pp
.columns
251 if pp
.colors
.items():
252 for i
, color
in enumerate(pp
.colors
):
253 gpl
+= "%3d%4d%4d %s" % (color
.color
.r
* 255, color
.color
.g
* 255, color
.color
.b
* 255, color
.name
+ '\n')
254 file_preset
.write(bytes(gpl
, 'UTF-8'))
258 pp
.palette_name
= filename
261 preset_active
= preset_menu_class
.bl_label
263 # fairly sloppy but convenient.
264 filepath
= bpy
.utils
.preset_find(preset_active
, self
.preset_subdir
)
267 filepath
= bpy
.utils
.preset_find(preset_active
,
268 self
.preset_subdir
, display_name
=True)
273 if hasattr(self
, "remove"):
274 self
.remove(context
, filepath
)
280 traceback
.print_exc()
283 preset_menu_class
.bl_label
= "Presets"
285 if hasattr(self
, "post_cb"):
286 self
.post_cb(context
)
290 def check(self
, context
):
291 self
.name
= self
.as_filename(self
.name
)
293 def invoke(self
, context
, event
):
294 if not self
.remove_active
:
295 wm
= context
.window_manager
296 return wm
.invoke_props_dialog(self
)
298 return self
.execute(context
)
301 class AddPresetPalette(WriteGimpPalette
, bpy
.types
.Operator
):
302 """Add a Palette Preset"""
303 bl_idname
= "palette.preset_add"
304 bl_label
= "Add Palette Preset"
305 preset_menu
= "PALETTE_MT_menu"
309 preset_subdir
= "palette"
312 class PALETTE_OT_add_color(bpy
.types
.Operator
):
314 bl_description
= "Add a Color to the Palette"
315 bl_idname
= "palette_props.add_color"
318 def execute(self
, context
):
319 pp
= bpy
.context
.scene
.palette_props
321 if pp
.colors
.items():
322 new_index
= pp
.current_color_index
+ 1
325 last
= pp
.colors
.__len
__() - 1
328 pp
.colors
.move(last
, new_index
)
329 pp
.current_color_index
= new_index
335 class PALETTE_OT_remove_color(bpy
.types
.Operator
):
337 bl_description
= "Remove Selected Color"
338 bl_idname
= "palette_props.remove_color"
341 def poll(cls
, context
):
342 pp
= bpy
.context
.scene
.palette_props
343 return bool(pp
.colors
.items())
346 def execute(self
, context
):
347 pp
= bpy
.context
.scene
.palette_props
348 i
= pp
.current_color_index
351 if pp
.current_color_index
>= pp
.colors
.__len
__():
352 pp
.index
= pp
.current_color_index
= pp
.colors
.__len
__() - 1
356 class PALETTE_OT_sample_tool_color(bpy
.types
.Operator
):
358 bl_description
= "Sample Tool Color"
359 bl_idname
= "palette_props.sample_tool_color"
361 def execute(self
, context
):
362 pp
= bpy
.context
.scene
.palette_props
363 brush
= current_brush()
364 pp
.colors
[pp
.current_color_index
].color
= brush
.color
368 class IMAGE_OT_select_color(bpy
.types
.Operator
):
370 bl_description
= "Select this color"
371 bl_idname
= "paint.select_color"
374 color_index
= IntProperty()
376 def invoke(self
, context
, event
):
377 palette_props
= bpy
.context
.scene
.palette_props
378 palette_props
.current_color_index
= self
.color_index
384 def color_palette_draw(self
, context
):
385 palette_props
= bpy
.context
.scene
.palette_props
391 bpy
.types
.PALETTE_MT_menu
.preset_subdir
= palette_props
.presets_folder
392 row
= layout
.row(align
=True)
393 row
.menu("PALETTE_MT_menu", text
=palette_props
.palette_name
.rstrip())
394 row
.operator("palette.preset_add", text
="", icon
="ZOOMIN")
395 row
.operator("palette.preset_add", text
="", icon
="ZOOMOUT").remove_active
= True
396 col
= layout
.column(align
=True)
397 row
= col
.row(align
=True)
398 row
.operator("palette_props.add_color", icon
="ZOOMIN")
399 row
.prop(palette_props
, "index")
400 row
.operator("palette_props.remove_color", icon
="PANEL_CLOSE")
401 row
= col
.row(align
=True)
402 row
.prop(palette_props
, "columns")
403 if palette_props
.colors
.items():
405 row
= layout
.row(align
=True)
406 row
.prop(palette_props
, "color_name")
407 row
.operator("palette_props.sample_tool_color", icon
="COLOR")
409 laycol
= layout
.column(align
=False)
411 if palette_props
.columns
:
412 columns
= palette_props
.columns
415 for i
, color
in enumerate(palette_props
.colors
):
417 row1
= laycol
.row(align
=True)
419 row2
= laycol
.row(align
=True)
422 if i
== palette_props
.current_color_index
:
424 row1
.prop(palette_props
.colors
[i
], "color", event
=True, toggle
=True)
425 row2
.operator("paint.select_color", emboss
=False).color_index
= i
427 row1
.prop(palette_props
.colors
[i
], "color", event
=True, toggle
=True)
428 row2
.operator("paint.select_color").color_index
= i
432 row
.prop(palette_props
, "presets_folder", text
="")
437 class BrushButtonsPanel():
438 bl_space_type
= 'IMAGE_EDITOR'
439 bl_region_type
= 'UI'
442 def poll(cls
, context
):
443 sima
= context
.space_data
444 toolsettings
= context
.tool_settings
.image_paint
445 return sima
.show_paint
and toolsettings
.brush
449 bl_space_type
= 'VIEW_3D'
450 bl_region_type
= 'TOOLS'
451 bl_category
= 'Tools'
454 def paint_settings(context
):
455 ts
= context
.tool_settings
457 if context
.vertex_paint_object
:
458 return ts
.vertex_paint
459 elif context
.weight_paint_object
:
460 return ts
.weight_paint
461 elif context
.texture_paint_object
:
462 return ts
.image_paint
466 class IMAGE_PT_color_palette(BrushButtonsPanel
, bpy
.types
.Panel
):
467 bl_label
= "Color Palette"
468 bl_options
= {'DEFAULT_CLOSED'}
470 def draw(self
, context
):
471 color_palette_draw(self
, context
)
474 class VIEW3D_PT_color_palette(PaintPanel
, bpy
.types
.Panel
):
475 bl_label
= "Color Palette"
476 bl_options
= {'DEFAULT_CLOSED'}
479 def poll(cls
, context
):
480 return (context
.image_paint_object
or context
.vertex_paint_object
)
482 def draw(self
, context
):
483 color_palette_draw(self
, context
)
486 class VIEW3D_OT_select_weight(bpy
.types
.Operator
):
488 bl_description
= "Select this weight"
489 bl_idname
= "paint.select_weight"
491 weight_index
= IntProperty()
493 def current_weight(self
):
494 pp
= bpy
.context
.scene
.palette_props
495 if self
.weight_index
== 0:
497 elif self
.weight_index
== 1:
499 elif self
.weight_index
== 2:
501 elif self
.weight_index
== 3:
503 elif self
.weight_index
== 4:
505 elif self
.weight_index
== 5:
507 elif self
.weight_index
== 6:
509 elif self
.weight_index
== 7:
511 elif self
.weight_index
== 8:
513 elif self
.weight_index
== 9:
515 elif self
.weight_index
== 10:
516 weight
= pp
.weight_10
519 def invoke(self
, context
, event
):
520 palette_props
= bpy
.context
.scene
.palette_props
522 palette_props
.current_weight_index
= self
.weight_index
524 if self
.weight_index
== 0:
525 weight
= palette_props
.weight_0
526 elif self
.weight_index
== 1:
527 weight
= palette_props
.weight_1
528 elif self
.weight_index
== 2:
529 weight
= palette_props
.weight_2
530 elif self
.weight_index
== 3:
531 weight
= palette_props
.weight_3
532 elif self
.weight_index
== 4:
533 weight
= palette_props
.weight_4
534 elif self
.weight_index
== 5:
535 weight
= palette_props
.weight_5
536 elif self
.weight_index
== 6:
537 weight
= palette_props
.weight_6
538 elif self
.weight_index
== 7:
539 weight
= palette_props
.weight_7
540 elif self
.weight_index
== 8:
541 weight
= palette_props
.weight_8
542 elif self
.weight_index
== 9:
543 weight
= palette_props
.weight_9
544 elif self
.weight_index
== 10:
545 weight
= palette_props
.weight_10
546 palette_props
.weight
= weight
547 #bpy.context.tool_settings.vertex_group_weight = weight
551 class VIEW3D_OT_reset_weight_palette(bpy
.types
.Operator
):
553 bl_idname
= "paint.reset_weight_palette"
556 def execute(self
, context
):
557 palette_props
= context
.scene
.palette_props
559 if palette_props
.current_weight_index
== 0:
560 palette_props
.weight
= 0.0
561 palette_props
.weight_0
= 0.0
563 palette_props
.weight_1
= 0.1
564 if palette_props
.current_weight_index
== 1:
565 palette_props
.weight
= 0.1
567 if palette_props
.current_weight_index
== 2:
568 palette_props
.weight
= 0.25
569 palette_props
.weight_2
= 0.25
571 if palette_props
.current_weight_index
== 3:
572 palette_props
.weight
= 0.3333
573 palette_props
.weight_3
= 0.3333
575 if palette_props
.current_weight_index
== 4:
576 palette_props
.weight
= 0.4
577 palette_props
.weight_4
= 0.4
579 if palette_props
.current_weight_index
== 5:
580 palette_props
.weight
= 0.5
581 palette_props
.weight_5
= 0.5
583 if palette_props
.current_weight_index
== 6:
584 palette_props
.weight
= 0.6
585 palette_props
.weight_6
= 0.6
587 if palette_props
.current_weight_index
== 7:
588 palette_props
.weight
= 0.6666
589 palette_props
.weight_7
= 0.6666
591 if palette_props
.current_weight_index
== 8:
592 palette_props
.weight
= 0.75
593 palette_props
.weight_8
= 0.75
595 if palette_props
.current_weight_index
== 9:
596 palette_props
.weight
= 0.9
597 palette_props
.weight_9
= 0.9
599 if palette_props
.current_weight_index
== 10:
600 palette_props
.weight
= 1.0
601 palette_props
.weight_10
= 1.0
604 class VIEW3D_PT_weight_palette(PaintPanel
, bpy
.types
.Panel
):
605 bl_label
= "Weight Palette"
606 bl_options
= {'DEFAULT_CLOSED'}
609 def poll(cls
, context
):
610 return context
.weight_paint_object
612 def draw(self
, context
):
613 palette_props
= bpy
.context
.scene
.palette_props
614 #vertex_group_weight = bpy.context.tool_settings.unified_paint_settings.weight
618 row
.prop(palette_props
, "weight", slider
=True)
622 if palette_props
.current_weight_index
== 0:
623 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_0
,
624 emboss
=False).weight_index
= 0
626 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_0
,
627 emboss
=True).weight_index
= 0
629 row
= box
.row(align
=True)
630 if palette_props
.current_weight_index
== 1:
631 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_1
,
632 emboss
=False).weight_index
= 1
634 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_1
,
635 emboss
=True).weight_index
= 1
637 if palette_props
.current_weight_index
== 2:
638 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_2
,
639 emboss
=False).weight_index
= 2
641 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_2
,
642 emboss
=True).weight_index
= 2
644 if palette_props
.current_weight_index
== 3:
645 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_3
,
646 emboss
=False).weight_index
= 3
648 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_3
,
649 emboss
=True).weight_index
= 3
651 row
= box
.row(align
=True)
652 if palette_props
.current_weight_index
== 4:
653 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_4
,
654 emboss
=False).weight_index
= 4
656 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_4
,
657 emboss
=True).weight_index
= 4
659 if palette_props
.current_weight_index
== 5:
660 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_5
,
661 emboss
=False).weight_index
= 5
663 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_5
,
664 emboss
=True).weight_index
= 5
666 if palette_props
.current_weight_index
== 6:
667 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_6
,
668 emboss
=False).weight_index
= 6
670 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_6
,
671 emboss
=True).weight_index
= 6
673 row
= box
.row(align
=True)
674 if palette_props
.current_weight_index
== 7:
675 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_7
,
676 emboss
=False).weight_index
= 7
678 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_7
,
679 emboss
=True).weight_index
= 7
681 if palette_props
.current_weight_index
== 8:
682 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_8
,
683 emboss
=False).weight_index
= 8
685 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_8
,
686 emboss
=True).weight_index
= 8
688 if palette_props
.current_weight_index
== 9:
689 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_9
,
690 emboss
=False).weight_index
= 9
692 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_9
,
693 emboss
=True).weight_index
= 9
695 row
= box
.row(align
=True)
696 if palette_props
.current_weight_index
== 10:
697 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_10
,
698 emboss
=False).weight_index
= 10
700 row
.operator("paint.select_weight", text
="%.2f" % palette_props
.weight_10
,
701 emboss
=True).weight_index
= 10
704 row
.operator("paint.reset_weight_palette", text
="Reset")
707 class Colors(bpy
.types
.PropertyGroup
):
708 """Class for colors CollectionProperty"""
709 color
= bpy
.props
.FloatVectorProperty(
710 name
="", description
="", default
=(0.8, 0.8, 0.8), min=0, max=1,
711 step
=1, precision
=3, subtype
='COLOR_GAMMA', size
=3)
714 class Weights(bpy
.types
.PropertyGroup
):
715 """Class for Weights Collection Property"""
717 weight
= bpy
.props
.FloatProperty(
718 default
=0.0, min=0.0, max=1.0, precision
=3)
721 class PaletteProps(bpy
.types
.PropertyGroup
):
723 def update_color_name(self
, context
):
724 pp
= bpy
.context
.scene
.palette_props
725 pp
.colors
[pp
.current_color_index
].name
= pp
.color_name
728 def move_color(self
, context
):
729 pp
= bpy
.context
.scene
.palette_props
730 if pp
.colors
.items() and pp
.current_color_index
!= pp
.index
:
731 if pp
.index
>= pp
.colors
.__len
__():
732 pp
.index
= pp
.colors
.__len
__() - 1
733 pp
.colors
.move(pp
.current_color_index
, pp
.index
)
734 pp
.current_color_index
= pp
.index
737 def update_weight(self
, context
):
738 pp
= context
.scene
.palette_props
740 if pp
.current_weight_index
== 0:
742 elif pp
.current_weight_index
== 1:
744 elif pp
.current_weight_index
== 2:
746 elif pp
.current_weight_index
== 3:
748 elif pp
.current_weight_index
== 4:
750 elif pp
.current_weight_index
== 5:
752 elif pp
.current_weight_index
== 6:
754 elif pp
.current_weight_index
== 7:
756 elif pp
.current_weight_index
== 8:
758 elif pp
.current_weight_index
== 9:
760 elif pp
.current_weight_index
== 10:
761 pp
.weight_10
= weight
762 bpy
.context
.tool_settings
.unified_paint_settings
.weight
= weight
763 #bpy.context.tool_settings.vertex_group_weight = weight
766 palette_name
= StringProperty(
767 name
="Palette Name", default
="Preset", subtype
='FILE_NAME')
769 color_name
= StringProperty(
770 name
="", description
="Color Name", default
="Untitled", update
=update_color_name
)
772 columns
= IntProperty(
774 description
="Number of Columns",
775 min=0, max=16, default
=0)
779 description
="Move Selected Color",
783 notes
= StringProperty(
784 name
="Palette Notes", default
="#\n")
786 current_color_index
= IntProperty(
787 name
="Current Color Index", description
="", default
=0, min=0)
789 current_weight_index
= IntProperty(
790 name
="Current Color Index", description
="", default
=10, min=-1)
792 presets_folder
= StringProperty(name
="",
793 description
="Palettes Folder",
796 colors
= bpy
.props
.CollectionProperty(type=Colors
)
798 weight
= bpy
.props
.FloatProperty(name
="Weight",
799 default
=0.0, min=0.0, max=1.0, precision
=3, update
=update_weight
)
801 weight_0
= bpy
.props
.FloatProperty(
802 default
=0.0, min=0.0, max=1.0, precision
=3)
803 weight_1
= bpy
.props
.FloatProperty(
804 default
=0.1, min=0.0, max=1.0, precision
=3)
805 weight_2
= bpy
.props
.FloatProperty(
806 default
=0.25, min=0.0, max=1.0, precision
=3)
807 weight_3
= bpy
.props
.FloatProperty(
808 default
=0.333, min=0.0, max=1.0, precision
=3)
809 weight_4
= bpy
.props
.FloatProperty(
810 default
=0.4, min=0.0, max=1.0, precision
=3)
811 weight_5
= bpy
.props
.FloatProperty(
812 default
=0.5, min=0.0, max=1.0, precision
=3)
813 weight_6
= bpy
.props
.FloatProperty(
814 default
=0.6, min=0.0, max=1.0, precision
=3)
815 weight_7
= bpy
.props
.FloatProperty(
816 default
=0.6666, min=0.0, max=1.0, precision
=3)
817 weight_8
= bpy
.props
.FloatProperty(
818 default
=0.75, min=0.0, max=1.0, precision
=3)
819 weight_9
= bpy
.props
.FloatProperty(
820 default
=0.9, min=0.0, max=1.0, precision
=3)
821 weight_10
= bpy
.props
.FloatProperty(
822 default
=1.0, min=0.0, max=1.0, precision
=3)
826 bpy
.utils
.register_module(__name__
)
828 bpy
.types
.Scene
.palette_props
= PointerProperty(
829 type=PaletteProps
, name
="Palette Props", description
="")
834 bpy
.utils
.unregister_module(__name__
)
836 del bpy
.types
.Scene
.palette_props
840 if __name__
== "__main__":
845 # ToDo1 Overiting the current file
846 # ToDo3 Foreground Background