2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-05-21 21:23:36 +00:00
|
|
|
import bpy
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
from bpy.types import Menu, Panel, UIList
|
2010-01-08 08:54:41 +00:00
|
|
|
from rna_prop_ui import PropertyPanel
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2011-09-20 18:29:19 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class MESH_MT_vertex_group_specials(Menu):
|
2011-09-21 15:18:38 +00:00
|
|
|
bl_label = "Vertex Group Specials"
|
2010-04-18 23:52:37 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2010-02-05 14:29:05 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2014-11-17 13:57:26 +00:00
|
|
|
layout.operator("object.vertex_group_sort", icon='SORTALPHA', text="Sort by Name").sort_type = "NAME"
|
2014-07-16 11:50:47 +00:00
|
|
|
layout.operator("object.vertex_group_sort", icon='ARMATURE_DATA', text="Sort by Bone Hierarchy").sort_type = "BONE_HIERARCHY"
|
2010-02-05 14:29:05 +00:00
|
|
|
layout.operator("object.vertex_group_copy", icon='COPY_ID')
|
|
|
|
layout.operator("object.vertex_group_copy_to_linked", icon='LINK_AREA')
|
2010-02-09 22:00:19 +00:00
|
|
|
layout.operator("object.vertex_group_copy_to_selected", icon='LINK_AREA')
|
2013-07-04 11:37:32 +00:00
|
|
|
layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT').use_topology = False
|
2013-06-28 17:13:09 +00:00
|
|
|
layout.operator("object.vertex_group_mirror", text="Mirror Vertex Group (Topology)", icon='ARROW_LEFTRIGHT').use_topology = True
|
2013-06-04 22:30:41 +00:00
|
|
|
layout.operator("object.vertex_group_remove_from", icon='X', text="Remove from All Groups").use_all_groups = True
|
|
|
|
layout.operator("object.vertex_group_remove_from", icon='X', text="Clear Active Group").use_all_verts = True
|
|
|
|
layout.operator("object.vertex_group_remove", icon='X', text="Delete All Groups").all = True
|
2011-09-14 08:21:21 +00:00
|
|
|
layout.separator()
|
2012-12-12 10:21:24 +00:00
|
|
|
layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All").action = 'LOCK'
|
|
|
|
layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="UnLock All").action = 'UNLOCK'
|
2011-11-26 14:04:33 +00:00
|
|
|
layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock Invert All").action = 'INVERT'
|
2010-02-05 14:29:05 +00:00
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class MESH_MT_shape_key_specials(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Shape Key Specials"
|
2010-04-18 23:52:37 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2010-02-05 14:29:05 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2010-09-07 15:17:42 +00:00
|
|
|
layout.operator("object.shape_key_transfer", icon='COPY_ID') # icon is not ideal
|
|
|
|
layout.operator("object.join_shapes", icon='COPY_ID') # icon is not ideal
|
2013-07-04 11:37:32 +00:00
|
|
|
layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT').use_topology = False
|
2013-06-28 17:13:09 +00:00
|
|
|
layout.operator("object.shape_key_mirror", text="Mirror Shape Key (Topology)", icon='ARROW_LEFTRIGHT').use_topology = True
|
2011-10-23 00:53:50 +00:00
|
|
|
layout.operator("object.shape_key_add", icon='ZOOMIN', text="New Shape From Mix").from_mix = True
|
2013-06-05 06:34:18 +00:00
|
|
|
layout.operator("object.shape_key_remove", icon='X', text="Delete All Shapes").all = True
|
2014-10-21 09:59:14 +00:00
|
|
|
layout.operator("object.shape_key_move", icon='TRIA_UP_BAR', text="Move To Top").type = 'TOP'
|
|
|
|
layout.operator("object.shape_key_move", icon='TRIA_DOWN_BAR', text="Move To Bottom").type = 'BOTTOM'
|
2010-02-05 14:29:05 +00:00
|
|
|
|
|
|
|
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
class MESH_UL_vgroups(UIList):
|
|
|
|
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
Fix T39897: shape keys created while the Relative checkbox is unchecked start out with frame=0
So! First, frame for absolute shape keys: never allow a new key to have the same pos as an
existing one (this does not make sense). This way, the two workflows are possible (create
all keys and then animate ctime, or animate ctime and then create keys where you need them).
Also, fixed UIList for shapekeys, the "absolute" test was wrong, and better to show frame
value, even though not editable, than nothing in case of absolute keys.
And finally, add getter to RNA 'frame' readonly value, so that we output real frame values,
and not dummy internal ones (which are /100) in our API.
2014-05-18 20:05:21 +00:00
|
|
|
# assert(isinstance(item, bpy.types.VertexGroup))
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
vgroup = item
|
|
|
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
2013-11-23 17:43:23 +00:00
|
|
|
layout.prop(vgroup, "name", text="", emboss=False, icon_value=icon)
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
icon = 'LOCKED' if vgroup.lock_weight else 'UNLOCKED'
|
|
|
|
layout.prop(vgroup, "lock_weight", text="", icon=icon, emboss=False)
|
|
|
|
elif self.layout_type in {'GRID'}:
|
|
|
|
layout.alignment = 'CENTER'
|
2013-02-08 16:01:21 +00:00
|
|
|
layout.label(text="", icon_value=icon)
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
class MESH_UL_shape_keys(UIList):
|
|
|
|
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
Fix T39897: shape keys created while the Relative checkbox is unchecked start out with frame=0
So! First, frame for absolute shape keys: never allow a new key to have the same pos as an
existing one (this does not make sense). This way, the two workflows are possible (create
all keys and then animate ctime, or animate ctime and then create keys where you need them).
Also, fixed UIList for shapekeys, the "absolute" test was wrong, and better to show frame
value, even though not editable, than nothing in case of absolute keys.
And finally, add getter to RNA 'frame' readonly value, so that we output real frame values,
and not dummy internal ones (which are /100) in our API.
2014-05-18 20:05:21 +00:00
|
|
|
# assert(isinstance(item, bpy.types.ShapeKey))
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
obj = active_data
|
2014-04-24 19:31:20 +00:00
|
|
|
# key = data
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
key_block = item
|
|
|
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
|
|
|
split = layout.split(0.66, False)
|
2013-11-23 19:37:23 +00:00
|
|
|
split.prop(key_block, "name", text="", emboss=False, icon_value=icon)
|
2013-08-23 20:41:21 +00:00
|
|
|
row = split.row(align=True)
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
if key_block.mute or (obj.mode == 'EDIT' and not (obj.use_shape_key_edit_mode and obj.type == 'MESH')):
|
|
|
|
row.active = False
|
Fix T39897: shape keys created while the Relative checkbox is unchecked start out with frame=0
So! First, frame for absolute shape keys: never allow a new key to have the same pos as an
existing one (this does not make sense). This way, the two workflows are possible (create
all keys and then animate ctime, or animate ctime and then create keys where you need them).
Also, fixed UIList for shapekeys, the "absolute" test was wrong, and better to show frame
value, even though not editable, than nothing in case of absolute keys.
And finally, add getter to RNA 'frame' readonly value, so that we output real frame values,
and not dummy internal ones (which are /100) in our API.
2014-05-18 20:05:21 +00:00
|
|
|
if not item.id_data.use_relative:
|
|
|
|
row.prop(key_block, "frame", text="", emboss=False)
|
|
|
|
elif index > 0:
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
row.prop(key_block, "value", text="", emboss=False)
|
|
|
|
else:
|
2013-02-08 16:01:21 +00:00
|
|
|
row.label(text="")
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
row.prop(key_block, "mute", text="", emboss=False)
|
|
|
|
elif self.layout_type in {'GRID'}:
|
|
|
|
layout.alignment = 'CENTER'
|
2013-02-08 16:01:21 +00:00
|
|
|
layout.label(text="", icon_value=icon)
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
class MESH_UL_uvmaps_vcols(UIList):
|
|
|
|
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
Fix T39897: shape keys created while the Relative checkbox is unchecked start out with frame=0
So! First, frame for absolute shape keys: never allow a new key to have the same pos as an
existing one (this does not make sense). This way, the two workflows are possible (create
all keys and then animate ctime, or animate ctime and then create keys where you need them).
Also, fixed UIList for shapekeys, the "absolute" test was wrong, and better to show frame
value, even though not editable, than nothing in case of absolute keys.
And finally, add getter to RNA 'frame' readonly value, so that we output real frame values,
and not dummy internal ones (which are /100) in our API.
2014-05-18 20:05:21 +00:00
|
|
|
# assert(isinstance(item, (bpy.types.MeshTexturePolyLayer, bpy.types.MeshLoopColorLayer)))
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
2013-11-23 19:37:23 +00:00
|
|
|
layout.prop(item, "name", text="", emboss=False, icon_value=icon)
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
icon = 'RESTRICT_RENDER_OFF' if item.active_render else 'RESTRICT_RENDER_ON'
|
|
|
|
layout.prop(item, "active_render", text="", icon=icon, emboss=False)
|
|
|
|
elif self.layout_type in {'GRID'}:
|
|
|
|
layout.alignment = 'CENTER'
|
2013-02-08 16:01:21 +00:00
|
|
|
layout.label(text="", icon_value=icon)
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
class MeshButtonsPanel():
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "data"
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
engine = context.scene.render.engine
|
|
|
|
return context.mesh and (engine in cls.COMPAT_ENGINES)
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_context_mesh(MeshButtonsPanel, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = ""
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2010-04-18 23:52:37 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
mesh = context.mesh
|
|
|
|
space = context.space_data
|
2010-08-06 15:17:44 +00:00
|
|
|
|
|
|
|
if ob:
|
2010-12-30 12:22:28 +00:00
|
|
|
layout.template_ID(ob, "data")
|
2010-08-06 15:17:44 +00:00
|
|
|
elif mesh:
|
2010-12-30 12:22:28 +00:00
|
|
|
layout.template_ID(space, "pin_id")
|
2009-06-07 13:36:12 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_normals(MeshButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Normals"
|
2010-04-18 23:52:37 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
mesh = context.mesh
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2010-08-20 06:09:58 +00:00
|
|
|
col.prop(mesh, "use_auto_smooth")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
2010-08-20 06:09:58 +00:00
|
|
|
sub.active = mesh.use_auto_smooth
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(mesh, "auto_smooth_angle", text="Angle")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-02-26 16:04:14 +00:00
|
|
|
split.prop(mesh, "show_double_sided")
|
2009-08-06 23:34:14 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_texture_space(MeshButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Texture Space"
|
2011-06-06 19:44:28 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2010-04-18 23:52:37 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
mesh = context.mesh
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(mesh, "texture_mesh")
|
2011-06-06 19:44:28 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2011-01-06 09:55:20 +00:00
|
|
|
layout.prop(mesh, "use_auto_texspace")
|
2011-06-04 08:09:34 +00:00
|
|
|
row = layout.row()
|
2011-09-21 15:18:38 +00:00
|
|
|
row.column().prop(mesh, "texspace_location", text="Location")
|
|
|
|
row.column().prop(mesh, "texspace_size", text="Size")
|
2009-10-07 09:23:29 +00:00
|
|
|
|
2011-06-21 17:17:51 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Vertex Groups"
|
2010-04-18 23:52:37 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-04-18 23:52:37 +00:00
|
|
|
engine = context.scene.render.engine
|
2010-08-05 16:05:30 +00:00
|
|
|
obj = context.object
|
2011-03-07 13:23:45 +00:00
|
|
|
return (obj and obj.type in {'MESH', 'LATTICE'} and (engine in cls.COMPAT_ENGINES))
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
2010-08-24 04:02:50 +00:00
|
|
|
group = ob.vertex_groups.active
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2013-11-24 13:25:38 +00:00
|
|
|
rows = 2
|
2009-10-31 19:31:45 +00:00
|
|
|
if group:
|
2013-10-13 23:24:37 +00:00
|
|
|
rows = 4
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
row.template_list("MESH_UL_vgroups", "", ob, "vertex_groups", ob.vertex_groups, "active_index", rows=rows)
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
col = row.column(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
col.operator("object.vertex_group_add", icon='ZOOMIN', text="")
|
2012-07-23 12:27:26 +00:00
|
|
|
col.operator("object.vertex_group_remove", icon='ZOOMOUT', text="").all = False
|
2012-05-23 14:24:40 +00:00
|
|
|
col.menu("MESH_MT_vertex_group_specials", icon='DOWNARROW_HLT', text="")
|
2010-05-04 12:31:24 +00:00
|
|
|
if group:
|
2012-07-11 10:41:26 +00:00
|
|
|
col.separator()
|
2010-05-04 12:31:24 +00:00
|
|
|
col.operator("object.vertex_group_move", icon='TRIA_UP', text="").direction = 'UP'
|
|
|
|
col.operator("object.vertex_group_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-01-02 16:59:46 +00:00
|
|
|
if ob.vertex_groups and (ob.mode == 'EDIT' or (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex)):
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
sub = row.row(align=True)
|
2013-07-01 13:02:53 +00:00
|
|
|
sub.operator("object.vertex_group_assign", text="Assign")
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.operator("object.vertex_group_remove_from", text="Remove")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sub = row.row(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.operator("object.vertex_group_select", text="Select")
|
|
|
|
sub.operator("object.vertex_group_deselect", text="Deselect")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.prop(context.tool_settings, "vertex_group_weight", text="Weight")
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Shape Keys"
|
2010-04-18 23:52:37 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-04-18 23:52:37 +00:00
|
|
|
engine = context.scene.render.engine
|
2010-08-05 16:05:30 +00:00
|
|
|
obj = context.object
|
2011-03-07 13:23:45 +00:00
|
|
|
return (obj and obj.type in {'MESH', 'LATTICE', 'CURVE', 'SURFACE'} and (engine in cls.COMPAT_ENGINES))
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
key = ob.data.shape_keys
|
2010-02-01 14:25:38 +00:00
|
|
|
kb = ob.active_shape_key
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
enable_edit = ob.mode != 'EDIT'
|
|
|
|
enable_edit_value = False
|
|
|
|
|
2010-10-12 22:20:10 +00:00
|
|
|
if ob.show_only_shape_key is False:
|
2010-08-20 06:09:58 +00:00
|
|
|
if enable_edit or (ob.type == 'MESH' and ob.use_shape_key_edit_mode):
|
2009-10-31 19:31:45 +00:00
|
|
|
enable_edit_value = True
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
2013-11-24 13:25:38 +00:00
|
|
|
rows = 2
|
2009-10-31 19:31:45 +00:00
|
|
|
if kb:
|
2013-10-13 23:24:37 +00:00
|
|
|
rows = 4
|
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
|
|
|
row.template_list("MESH_UL_shape_keys", "", key, "key_blocks", ob, "active_shape_key_index", rows=rows)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = row.column()
|
|
|
|
|
2009-11-08 11:07:00 +00:00
|
|
|
sub = col.column(align=True)
|
2011-10-23 00:53:50 +00:00
|
|
|
sub.operator("object.shape_key_add", icon='ZOOMIN', text="").from_mix = False
|
2013-06-05 06:34:18 +00:00
|
|
|
sub.operator("object.shape_key_remove", icon='ZOOMOUT', text="").all = False
|
2012-05-23 14:24:40 +00:00
|
|
|
sub.menu("MESH_MT_shape_key_specials", icon='DOWNARROW_HLT', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if kb:
|
2009-11-23 00:27:30 +00:00
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-08 11:07:00 +00:00
|
|
|
sub = col.column(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
sub.operator("object.shape_key_move", icon='TRIA_UP', text="").type = 'UP'
|
|
|
|
sub.operator("object.shape_key_move", icon='TRIA_DOWN', text="").type = 'DOWN'
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split(percentage=0.4)
|
2009-11-08 11:07:00 +00:00
|
|
|
row = split.row()
|
|
|
|
row.enabled = enable_edit
|
2010-08-18 07:14:10 +00:00
|
|
|
row.prop(key, "use_relative")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-08 11:07:00 +00:00
|
|
|
row = split.row()
|
|
|
|
row.alignment = 'RIGHT'
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-08 11:07:00 +00:00
|
|
|
sub = row.row(align=True)
|
2012-01-30 09:49:30 +00:00
|
|
|
sub.label() # XXX, for alignment only
|
2009-11-08 11:07:00 +00:00
|
|
|
subsub = sub.row(align=True)
|
|
|
|
subsub.active = enable_edit_value
|
2010-10-12 22:20:10 +00:00
|
|
|
subsub.prop(ob, "show_only_shape_key", text="")
|
2010-08-20 06:09:58 +00:00
|
|
|
sub.prop(ob, "use_shape_key_edit_mode", text="")
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-05 14:29:05 +00:00
|
|
|
sub = row.row()
|
2012-04-05 06:10:15 +00:00
|
|
|
if key.use_relative:
|
|
|
|
sub.operator("object.shape_key_clear", icon='X', text="")
|
|
|
|
else:
|
|
|
|
sub.operator("object.shape_key_retime", icon='RECOVER_LAST', text="")
|
2009-11-07 22:07:46 +00:00
|
|
|
|
2010-08-20 22:00:23 +00:00
|
|
|
if key.use_relative:
|
2009-10-31 19:31:45 +00:00
|
|
|
if ob.active_shape_key_index != 0:
|
|
|
|
row = layout.row()
|
|
|
|
row.active = enable_edit_value
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(kb, "value")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
2009-11-08 11:07:00 +00:00
|
|
|
|
|
|
|
col = split.column(align=True)
|
|
|
|
col.active = enable_edit_value
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Range:")
|
|
|
|
col.prop(kb, "slider_min", text="Min")
|
|
|
|
col.prop(kb, "slider_max", text="Max")
|
2009-11-08 11:07:00 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column(align=True)
|
2009-11-08 11:07:00 +00:00
|
|
|
col.active = enable_edit_value
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Blend:")
|
2010-08-23 05:47:45 +00:00
|
|
|
col.prop_search(kb, "vertex_group", ob, "vertex_groups", text="")
|
2011-03-25 02:12:44 +00:00
|
|
|
col.prop_search(kb, "relative_key", key, "key_blocks", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
else:
|
2012-05-22 13:43:36 +00:00
|
|
|
layout.prop(kb, "interpolation")
|
2012-04-05 05:05:18 +00:00
|
|
|
row = layout.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
row.active = enable_edit_value
|
2012-04-05 05:05:18 +00:00
|
|
|
row.prop(key, "eval_time")
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(key, "slurph")
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_uv_texture(MeshButtonsPanel, Panel):
|
2011-11-23 17:25:25 +00:00
|
|
|
bl_label = "UV Maps"
|
2010-04-18 23:52:37 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
me = context.mesh
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
col = row.column()
|
|
|
|
|
2013-10-13 22:26:53 +00:00
|
|
|
col.template_list("MESH_UL_uvmaps_vcols", "uvmaps", me, "uv_textures", me.uv_textures, "active_index", rows=1)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = row.column(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
col.operator("mesh.uv_texture_add", icon='ZOOMIN', text="")
|
|
|
|
col.operator("mesh.uv_texture_remove", icon='ZOOMOUT', text="")
|
2013-11-19 16:38:18 +00:00
|
|
|
|
2010-04-17 19:05:53 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_vertex_colors(MeshButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Vertex Colors"
|
2010-04-18 23:52:37 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
me = context.mesh
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row()
|
|
|
|
col = row.column()
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2013-10-13 22:26:53 +00:00
|
|
|
col.template_list("MESH_UL_uvmaps_vcols", "vcols", me, "vertex_colors", me.vertex_colors, "active_index", rows=1)
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
col = row.column(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
col.operator("mesh.vertex_color_add", icon='ZOOMIN', text="")
|
|
|
|
col.operator("mesh.vertex_color_remove", icon='ZOOMOUT', text="")
|
2013-11-19 16:38:18 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
|
2012-09-21 03:41:59 +00:00
|
|
|
class DATA_PT_customdata(MeshButtonsPanel, Panel):
|
|
|
|
bl_label = "Geometry Data"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2013-01-10 04:43:31 +00:00
|
|
|
obj = context.object
|
|
|
|
me = context.mesh
|
2012-09-21 22:33:43 +00:00
|
|
|
col = layout.column()
|
2013-01-10 04:43:31 +00:00
|
|
|
|
2012-09-21 03:41:59 +00:00
|
|
|
col.operator("mesh.customdata_clear_mask", icon='X')
|
2012-09-21 22:33:43 +00:00
|
|
|
col.operator("mesh.customdata_clear_skin", icon='X')
|
2012-09-21 03:41:59 +00:00
|
|
|
|
2013-01-10 04:43:31 +00:00
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col.enabled = (obj.mode != 'EDIT')
|
|
|
|
col.prop(me, "use_customdata_vertex_bevel")
|
|
|
|
col.prop(me, "use_customdata_edge_bevel")
|
|
|
|
col.prop(me, "use_customdata_edge_crease")
|
|
|
|
|
2012-09-21 03:41:59 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, Panel):
|
2010-08-12 19:36:10 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
|
|
|
_context_path = "object.data"
|
2010-12-17 10:33:28 +00:00
|
|
|
_property_type = bpy.types.Mesh
|
2011-04-04 10:13:04 +00:00
|
|
|
|
2012-09-21 03:41:59 +00:00
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
bpy.utils.register_module(__name__)
|