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:
authorMatt Ebb <matt@mke3.net>2010-03-25 09:27:25 +0300
committerMatt Ebb <matt@mke3.net>2010-03-25 09:27:25 +0300
commit33f880e8666e9bb0ed954fccb82bc23255a97868 (patch)
treec7b5e5283efd2540982d99917551e3a585b59720 /release
parent5bcca8206e3397b6d1a31e278a4e4bad9051e68f (diff)
Restored Fluid Sim baking
This commit restores fluid sim baking functionality in 2.5, it's been on the todo for a while, and was previously almost completely non-functional. The old code was quite complicated and specific to the 2.4 animation system, so I've pretty much rewritten most of it. This includes: * Animated variables work again - just key them in the UI. Non-animateable values should be already set non-animateable in RNA, hopefully I got them all. Available are: Domain Gravity / Domain Viscosity / Object loc/rot/scale / Object initial velocity / Deforming meshes / Fluid control Attract strength / Fluid control Attract radius / Fluid control Velocity strength / Fluid control Velocity radius / Object Active status (checkbox next to fluid type) The Domain time scale is still not yet implemented. * Fluid sim now use global scene units data by default - when enabled, the scene's global gravity value is used and when units are set (metric/imperial) the simulation real world size is taken from the object's actual measurements. * The baking process is now done in the background, using the nifty threaded Jobs system. It's non-blocking and your domain object will show the simulated fluid as it becomes available for that frame. A nice extra thing for the future would be to improve the visualisation of the object's state while baking, and also the jobs system/ui could do with some touchups - currently it has to share a bit from the 'render' job, and appears as 'Render' in the header. Progress bars for jobs in the header would be great too.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/ui/properties_physics_fluid.py39
1 files changed, 31 insertions, 8 deletions
diff --git a/release/scripts/ui/properties_physics_fluid.py b/release/scripts/ui/properties_physics_fluid.py
index 9b36b98bc24..c6fd7e930d9 100644
--- a/release/scripts/ui/properties_physics_fluid.py
+++ b/release/scripts/ui/properties_physics_fluid.py
@@ -42,7 +42,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
md = context.fluid
wide_ui = context.region.width > narrowui
- split = layout.split()
+ split = layout.split(percentage=0.5)
split.operator_context = 'EXEC_DEFAULT'
if md:
@@ -53,7 +53,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
row = split.row(align=True)
row.prop(md, "render", text="")
row.prop(md, "realtime", text="")
-
+
fluid = md.settings
else:
@@ -67,10 +67,19 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
if fluid:
if wide_ui:
- layout.prop(fluid, "type")
+ row = layout.row()
+ row.prop(fluid, "type")
+ if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'):
+ row.prop(fluid, "active", text="")
else:
layout.prop(fluid, "type", text="")
-
+ if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'):
+ layout.prop(fluid, "active", text="")
+
+ layout = layout.column()
+ if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'):
+ layout.active = fluid.active
+
if fluid.type == 'DOMAIN':
layout.operator("fluid.bake", text="Bake Fluid Simulation", icon='MOD_FLUIDSIM')
split = layout.split()
@@ -220,15 +229,29 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
layout = self.layout
fluid = context.fluid.settings
+ scene = context.scene
wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.label(text="Gravity:")
- col.prop(fluid, "gravity", text="")
- col.label(text="Real World Size:")
- col.prop(fluid, "real_world_size", text="Metres")
+ if scene.use_gravity:
+ col.label(text="Using Scene Gravity", icon="SCENE_DATA")
+ sub = col.column()
+ sub.enabled = False
+ sub.prop(fluid, "gravity", text="")
+ else:
+ col.label(text="Gravity:")
+ col.prop(fluid, "gravity", text="")
+
+ if scene.unit_settings.system != 'NONE':
+ col.label(text="Using Scene Size Units", icon="SCENE_DATA")
+ sub = col.column()
+ sub.enabled = False
+ sub.prop(fluid, "real_world_size", text="Metres")
+ else:
+ col.label(text="Real World Size:")
+ col.prop(fluid, "real_world_size", text="Metres")
if wide_ui:
col = split.column()