2.5 MetaBall Buttons:

* Code and layout cleanup.
This commit is contained in:
Thomas Dinges 2009-07-29 17:15:17 +00:00
parent 198d996934
commit fa7a2091f1

@ -6,7 +6,7 @@ class DataButtonsPanel(bpy.types.Panel):
__context__ = "data" __context__ = "data"
def poll(self, context): def poll(self, context):
return (context.meta_ball != None) return (context.meta_ball)
class DATA_PT_context_metaball(DataButtonsPanel): class DATA_PT_context_metaball(DataButtonsPanel):
__show_header__ = False __show_header__ = False
@ -35,37 +35,37 @@ class DATA_PT_metaball(DataButtonsPanel):
mball = context.meta_ball mball = context.meta_ball
split = layout.split() col = layout.column()
sub = split.column()
sub.itemL(text="Settings:") col.itemL(text="Settings:")
sub.itemR(mball, "threshold", text="Threshold") col.itemR(mball, "threshold", text="Threshold")
sub.itemR(mball, "wire_size", text="View Resolution") col.itemL(text="Resolution:")
sub.itemR(mball, "render_size", text="Render Resolution") col = layout.column(align=True)
col.itemR(mball, "wire_size", text="View")
sub.itemL(text="Update:") col.itemR(mball, "render_size", text="Render")
sub.itemR(mball, "flag", expand=True)
layout.itemR(mball, "flag")
class DATA_PT_metaball_metaelem(DataButtonsPanel): class DATA_PT_metaball_element(DataButtonsPanel):
__label__ = "MetaElem" __label__ = "Meta Element"
def poll(self, context):
return (context.meta_ball and context.meta_ball.last_selected_element)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
metaelem = context.meta_ball.last_selected_element metaelem = context.meta_ball.last_selected_element
if(metaelem != None): col = layout.column()
split = layout.split()
sub = split.column()
sub.itemL(text="Settings:") col.itemL(text="Settings:")
sub.itemR(metaelem, "stiffness", text="Stiffness") col.itemR(metaelem, "stiffness", text="Stiffness")
sub.itemR(metaelem, "size", text="Size") col.itemR(metaelem, "size", text="Size")
sub.itemL(text="Type:") col.itemL(text="Type:")
sub.itemR(metaelem, "type", expand=True) col.row().itemR(metaelem, "type", expand=True)
sub.itemR(metaelem, "negative", text="Negative") col.itemR(metaelem, "negative", text="Negative")
bpy.types.register(DATA_PT_context_metaball) bpy.types.register(DATA_PT_context_metaball)
bpy.types.register(DATA_PT_metaball) bpy.types.register(DATA_PT_metaball)
bpy.types.register(DATA_PT_metaball_metaelem) bpy.types.register(DATA_PT_metaball_element)