diff options
author | Jiri Hnidek <jiri.hnidek@tul.cz> | 2009-07-29 16:35:09 +0400 |
---|---|---|
committer | Jiri Hnidek <jiri.hnidek@tul.cz> | 2009-07-29 16:35:09 +0400 |
commit | f75005c2a89f6cc5f1bdac33e26341a14ed92888 (patch) | |
tree | f83839e709b1167ce9eac42dc8acacd2ec2943cb /release | |
parent | b3d07534679e243759892f2a1206dc8756a1c004 (diff) |
2.5 MetaBalls
- It is possible to work with MetaBalls in edit mode now
- Added basic UI to the button window (feel free to change it :-))
- Header menus should work
- Undo & redo should work
- Removed global variable editelems and lastelem (moved it to the MetaBall struct)
- All tools from old editmball.c was converted to the operators
- Added lastelem to the RNA
- Experimental: mb->editelems is only pointer at mb->elems or NULL (depends on Mode). ListBase of MetaElems is not duplicated in edit mode.
Tested with scons at Linux and mac OS X
TODO:
- Recalc data after Undo or Redo
- Solve issue with basic MetaBall and Python UI script (only base MetaBall object influence Wiresize and Threshold)
- Fix orientation of manipulator in "Normal mode"
Diffstat (limited to 'release')
-rw-r--r-- | release/ui/buttons_data_metaball.py | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/release/ui/buttons_data_metaball.py b/release/ui/buttons_data_metaball.py new file mode 100644 index 00000000000..12d44ff7a42 --- /dev/null +++ b/release/ui/buttons_data_metaball.py @@ -0,0 +1,71 @@ +import bpy + +class DataButtonsPanel(bpy.types.Panel): + __space_type__ = "BUTTONS_WINDOW" + __region_type__ = "WINDOW" + __context__ = "data" + + def poll(self, context): + return (context.meta_ball != None) + +class DATA_PT_context_metaball(DataButtonsPanel): + __show_header__ = False + + def draw(self, context): + layout = self.layout + + ob = context.object + mball = context.meta_ball + space = context.space_data + + split = layout.split(percentage=0.65) + + if ob: + split.template_ID(ob, "data") + split.itemS() + elif mball: + split.template_ID(space, "pin_id") + split.itemS() + +class DATA_PT_metaball(DataButtonsPanel): + __label__ = "Metaball" + + def draw(self, context): + layout = self.layout + + mball = context.meta_ball + + split = layout.split() + sub = split.column() + + sub.itemL(text="Settings:") + sub.itemR(mball, "threshold", text="Threshold") + sub.itemR(mball, "wire_size", text="View Resolution") + sub.itemR(mball, "render_size", text="Render Resolution") + + sub.itemL(text="Update:") + sub.itemR(mball, "flag", expand=True) + +class DATA_PT_metaball_metaelem(DataButtonsPanel): + __label__ = "MetaElem" + + def draw(self, context): + layout = self.layout + + metaelem = context.meta_ball.last_selected_element + + if(metaelem != None): + split = layout.split() + sub = split.column() + + sub.itemL(text="Settings:") + sub.itemR(metaelem, "stiffness", text="Stiffness") + sub.itemR(metaelem, "size", text="Size") + sub.itemL(text="Type:") + sub.itemR(metaelem, "type", expand=True) + sub.itemR(metaelem, "negative", text="Negative") + + +bpy.types.register(DATA_PT_context_metaball) +bpy.types.register(DATA_PT_metaball) +bpy.types.register(DATA_PT_metaball_metaelem)
\ No newline at end of file |