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
|
|
|
|
2009-07-09 09:42:34 +00:00
|
|
|
class DATA_PT_context_lattice(DataButtonsPanel):
|
|
|
|
__idname__ = "DATA_PT_context_lattice"
|
2009-07-09 19:45:27 +00:00
|
|
|
__no_header__ = True
|
2009-06-13 21:22:21 +00:00
|
|
|
|
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:
|
2009-06-23 00:19:10 +00:00
|
|
|
split.template_ID(ob, "data")
|
2009-06-07 13:36:12 +00:00
|
|
|
split.itemS()
|
|
|
|
elif lat:
|
2009-06-23 00:19:10 +00:00
|
|
|
split.template_ID(space, "pin_id")
|
2009-06-07 13:36:12 +00:00
|
|
|
split.itemS()
|
|
|
|
|
|
|
|
|
2009-07-09 09:07:25 +00:00
|
|
|
class DATA_PT_lattice(DataButtonsPanel):
|
|
|
|
__idname__ = "DATA_PT_lattice"
|
|
|
|
__label__ = "Lattice"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
lat = context.lattice
|
|
|
|
|
2009-07-09 16:09:44 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemR(lat, "points_u")
|
|
|
|
row.itemR(lat, "interpolation_type_u", expand=True)
|
2009-06-07 13:36:12 +00:00
|
|
|
|
2009-07-09 16:09:44 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemR(lat, "points_v")
|
|
|
|
row.itemR(lat, "interpolation_type_v", expand=True)
|
2009-06-07 13:36:12 +00:00
|
|
|
|
2009-07-09 16:09:44 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemR(lat, "points_w")
|
|
|
|
row.itemR(lat, "interpolation_type_w", expand=True)
|
2009-06-07 13:36:12 +00:00
|
|
|
|
2009-07-09 16:09:44 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemO("LATTICE_OT_make_regular")
|
|
|
|
row.itemR(lat, "outside")
|
2009-05-08 21:52:57 +00:00
|
|
|
|
2009-07-09 09:42:34 +00:00
|
|
|
bpy.types.register(DATA_PT_context_lattice)
|
2009-06-18 14:20:25 +00:00
|
|
|
bpy.types.register(DATA_PT_lattice)
|
2009-07-09 19:45:27 +00:00
|
|
|
|