blender/release/ui/buttons_data_lattice.py
Brecht Van Lommel eecf7722b6 UI Buttons:
* Context now allows pinning a datablock, independent of
  selection.
* Initial ID browse buttons for most buttons tabs.
* Browsing from world to texture now displays world textures
  again, but is a bit of a hack, not sure there is a right
  way to do this.
* There's a button to switch between active materials and
  textures now, only temporary though.
* There's some code to put context part in own region,
  disabled still because it doesn't work that well yet.
2009-06-07 13:36:12 +00:00

51 lines
1.1 KiB
Python

import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__region_type__ = "WINDOW"
__context__ = "data"
def poll(self, context):
return (context.lattice != None)
class DATA_PT_lattice(DataButtonsPanel):
__idname__ = "DATA_PT_lattice"
__label__ = "Lattice"
def draw(self, context):
ob = context.object
lat = context.lattice
space = context.space_data
layout = self.layout
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")
bpy.types.register(DATA_PT_lattice)