Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-02 23:41:31 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-02 23:41:31 +0400
commit093ff8202ced6391a2ef657abe42615672146954 (patch)
tree8b65da58becc4ac56bf81ae7d3adab7c86730d15 /release/ui/buttons_physics_field.py
parent5a0896e1a3c7f17abd37e3d818585fde8e80ff6d (diff)
2.5: Physics Buttons
All kinds of changes to get it ready for UI layouts. This means RNA and operators should be working correct, but most buttons are still not actually there yet. * Added near empty soft body, fluid, field and collision panels, tweaks to cloth panels. * Fluid bake works, but without escape or showing any progress. * Fluid/Softbody/Cloth/Collision can now be both added as modifiers or in the physics panels. * Missing: fields & soft body for particles. * Missing: proper updating softbodies, guess this code still needs updates after pointcache refactor?
Diffstat (limited to 'release/ui/buttons_physics_field.py')
-rw-r--r--release/ui/buttons_physics_field.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/release/ui/buttons_physics_field.py b/release/ui/buttons_physics_field.py
new file mode 100644
index 00000000000..3204ab4709d
--- /dev/null
+++ b/release/ui/buttons_physics_field.py
@@ -0,0 +1,48 @@
+
+import bpy
+
+class PhysicButtonsPanel(bpy.types.Panel):
+ __space_type__ = "BUTTONS_WINDOW"
+ __region_type__ = "WINDOW"
+ __context__ = "physics"
+
+ def poll(self, context):
+ return (context.object != None)
+
+class PHYSICS_PT_field(PhysicButtonsPanel):
+ __idname__ = "PHYSICS_PT_field"
+ __label__ = "Field"
+
+ def draw(self, context):
+ layout = self.layout
+ ob = context.object
+ field = ob.field
+
+ layout.itemR(field, "type")
+
+ if field.type != "NONE":
+ layout.itemR(field, "strength")
+
+ if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "LENNARDj"):
+ if ob.type in ("MESH", "SURFACE", "FONT", "CURVE"):
+ layout.itemR(field, "surface")
+
+class PHYSICS_PT_collision(PhysicButtonsPanel):
+ __idname__ = "PHYSICS_PT_collision"
+ __label__ = "Collision"
+
+ def draw_header(self, context):
+ settings = context.object.collision
+ self.layout.itemR(settings, "enabled", text="")
+
+ def draw(self, context):
+ layout = self.layout
+ md = context.collision
+ settings = context.object.collision
+
+ if settings.enabled:
+ pass
+
+bpy.types.register(PHYSICS_PT_field)
+bpy.types.register(PHYSICS_PT_collision)
+