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-08 21:52:57 +00:00
|
|
|
import bpy
|
2010-01-08 08:54:41 +00:00
|
|
|
from rna_prop_ui import PropertyPanel
|
2009-05-08 21:52:57 +00:00
|
|
|
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2010-08-02 02:55:12 +00:00
|
|
|
class DataButtonsPanel():
|
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):
|
2009-10-31 19:31:45 +00:00
|
|
|
return context.lattice
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-08-02 02:55:12 +00:00
|
|
|
class DATA_PT_context_lattice(DataButtonsPanel, bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = ""
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
lat = context.lattice
|
|
|
|
space = context.space_data
|
2010-08-06 15:17:44 +00:00
|
|
|
|
|
|
|
split = layout.split(percentage=0.65)
|
|
|
|
if ob:
|
|
|
|
split.template_ID(ob, "data")
|
|
|
|
split.separator()
|
|
|
|
elif lat:
|
|
|
|
split.template_ID(space, "pin_id")
|
|
|
|
split.separator()
|
2009-06-07 13:36:12 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-08-02 02:55:12 +00:00
|
|
|
class DATA_PT_lattice(DataButtonsPanel, bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Lattice"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
lat = context.lattice
|
2009-11-14 23:24:15 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(lat, "points_u")
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(lat, "interpolation_type_u", text="")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
split = layout.split()
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(lat, "points_v")
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(lat, "interpolation_type_v", text="")
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2009-11-14 23:24:15 +00:00
|
|
|
split = layout.split()
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(lat, "points_w")
|
2010-08-06 15:17:44 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(lat, "interpolation_type_w", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-04-20 21:38:55 +00:00
|
|
|
row = layout.row()
|
2010-08-18 07:14:10 +00:00
|
|
|
row.prop(lat, "use_outside")
|
2010-08-23 05:47:45 +00:00
|
|
|
row.prop_search(lat, "vertex_group", context.object, "vertex_groups", text="")
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2010-08-12 19:36:10 +00:00
|
|
|
|
|
|
|
class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
|
|
|
_context_path = "object.data"
|
2009-05-08 21:52:57 +00:00
|
|
|
|
2010-01-08 08:54:41 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def register():
|
2010-08-02 02:55:12 +00:00
|
|
|
pass
|
2010-02-14 11:21:21 +00:00
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def unregister():
|
2010-08-02 02:55:12 +00:00
|
|
|
pass
|
2010-02-16 09:55:07 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|