2009-05-08 21:52:57 +00:00
|
|
|
|
|
|
|
import bpy
|
|
|
|
|
|
|
|
class DataButtonsPanel(bpy.types.Panel):
|
|
|
|
__space_type__ = "BUTTONS_WINDOW"
|
|
|
|
__region_type__ = "WINDOW"
|
|
|
|
__context__ = "data"
|
|
|
|
|
|
|
|
def poll(self, context):
|
2009-06-03 00:17:35 +00:00
|
|
|
return (context.lattice != None)
|
2009-05-08 21:52:57 +00:00
|
|
|
|
|
|
|
class DATA_PT_lattice(DataButtonsPanel):
|
|
|
|
__idname__ = "DATA_PT_lattice"
|
|
|
|
__label__ = "Lattice"
|
2009-06-13 21:22:21 +00:00
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
return (context.object.type == 'LATTICE')
|
2009-05-08 21:52:57 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
2009-06-13 21:22:21 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
2009-06-07 13:36:12 +00:00
|
|
|
ob = context.object
|
2009-06-03 00:17:35 +00:00
|
|
|
lat = context.lattice
|
2009-06-07 13:36:12 +00:00
|
|
|
space = context.space_data
|
2009-05-08 21:52:57 +00:00
|
|
|
|
2009-06-07 13:36:12 +00:00
|
|
|
split = layout.split(percentage=0.65)
|
|
|
|
|
|
|
|
if ob:
|
|
|
|
split.template_ID(context, ob, "data")
|
|
|
|
split.itemS()
|
|
|
|
elif lat:
|
|
|
|
split.template_ID(context, space, "pin_id")
|
|
|
|
split.itemS()
|
|
|
|
|
|
|
|
if lat:
|
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(lat, "points_u")
|
|
|
|
row.itemR(lat, "interpolation_type_u", expand=True)
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(lat, "points_v")
|
|
|
|
row.itemR(lat, "interpolation_type_v", expand=True)
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(lat, "points_w")
|
|
|
|
row.itemR(lat, "interpolation_type_w", expand=True)
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(lat, "outside")
|
|
|
|
row.itemR(lat, "shape_keys")
|
2009-05-08 21:52:57 +00:00
|
|
|
|
2009-06-13 21:22:21 +00:00
|
|
|
bpy.types.register(DATA_PT_lattice)
|