2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-05-25 18:32:28 +00:00
|
|
|
import bpy
|
|
|
|
|
2009-11-19 12:58:19 +00:00
|
|
|
narrowui = 180
|
|
|
|
|
|
|
|
|
2009-10-31 19:57:59 +00:00
|
|
|
from properties_physics_common import point_cache_ui
|
|
|
|
from properties_physics_common import effector_weights_ui
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-29 15:20:36 +00:00
|
|
|
def cloth_panel_enabled(md):
|
2009-11-22 17:41:35 +00:00
|
|
|
return md.point_cache.baked is False
|
2009-11-28 23:37:56 +00:00
|
|
|
|
2009-11-22 10:32:37 +00:00
|
|
|
|
|
|
|
class CLOTH_MT_presets(bpy.types.Menu):
|
|
|
|
'''
|
|
|
|
Creates the menu items by scanning scripts/templates
|
|
|
|
'''
|
|
|
|
bl_label = "Cloth Presets"
|
2009-11-22 11:23:19 +00:00
|
|
|
preset_subdir = "cloth"
|
|
|
|
preset_operator = "script.python_file_run"
|
|
|
|
draw = bpy.types.Menu.draw_preset
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2009-05-25 18:32:28 +00:00
|
|
|
class PhysicButtonsPanel(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "physics"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
ob = context.object
|
2010-02-23 12:48:35 +00:00
|
|
|
rd = context.scene.render
|
2009-10-31 19:31:45 +00:00
|
|
|
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-02 19:41:31 +00:00
|
|
|
class PHYSICS_PT_cloth(PhysicButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Cloth"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
md = context.cloth
|
|
|
|
ob = context.object
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
split.operator_context = 'EXEC_DEFAULT'
|
|
|
|
|
|
|
|
if md:
|
|
|
|
# remove modifier + settings
|
|
|
|
split.set_context_pointer("modifier", md)
|
2009-11-23 00:27:30 +00:00
|
|
|
split.operator("object.modifier_remove", text="Remove")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = split.row(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(md, "render", text="")
|
|
|
|
row.prop(md, "realtime", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
|
|
|
# add modifier
|
2009-11-23 11:43:38 +00:00
|
|
|
split.operator("object.modifier_add", text="Add").type = 'CLOTH'
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-19 12:58:19 +00:00
|
|
|
split.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-22 13:15:21 +00:00
|
|
|
split.operator_context = 'INVOKE_DEFAULT'
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if md:
|
|
|
|
cloth = md.settings
|
|
|
|
|
|
|
|
split = layout.split()
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2009-12-04 04:28:50 +00:00
|
|
|
split.active = cloth_panel_enabled(md)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Presets:")
|
2009-11-22 10:32:37 +00:00
|
|
|
sub = col.row(align=True).split(percentage=0.75)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("CLOTH_MT_presets", text="Presets")
|
|
|
|
sub.operator("cloth.preset_add", text="Add")
|
2009-11-19 12:58:19 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Quality:")
|
|
|
|
col.prop(cloth, "quality", text="Steps", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Material:")
|
|
|
|
col.prop(cloth, "mass")
|
|
|
|
col.prop(cloth, "structural_stiffness", text="Structural")
|
|
|
|
col.prop(cloth, "bending_stiffness", text="Bending")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-19 12:58:19 +00:00
|
|
|
col = split.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Damping:")
|
|
|
|
col.prop(cloth, "spring_damping", text="Spring")
|
|
|
|
col.prop(cloth, "air_damping", text="Air")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(cloth, "pin_cloth", text="Pinning")
|
2009-11-19 12:58:19 +00:00
|
|
|
sub = col.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
sub.active = cloth.pin_cloth
|
2009-11-23 11:43:38 +00:00
|
|
|
sub.prop_object(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(cloth, "pin_stiffness", text="Stiffness")
|
2009-11-19 12:58:19 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Pre roll:")
|
|
|
|
col.prop(cloth, "pre_roll", text="Frame")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
# Disabled for now
|
|
|
|
"""
|
|
|
|
if cloth.mass_vertex_group:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.label(text="Goal:")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = layout.column_flow()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(cloth, "goal_default", text="Default")
|
|
|
|
col.prop(cloth, "goal_spring", text="Stiffness")
|
|
|
|
col.prop(cloth, "goal_friction", text="Friction")
|
2009-10-31 19:31:45 +00:00
|
|
|
"""
|
Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
- exact (not marked)
- outdated (simulation is not done completely with current settings)
- non-exact (frames were skipped during simulation)
* The parameter "cache step" effects the number of frames between saved cache frames.
- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
- Speeds up the "quick caching" very much.
- Frames between cached frames are interpolated from the cached frames.
- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.
* The caching can work in normal or "quick" mode:
[Normal cache]
- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
- Becomes non-exact: After larger than 1 frame steps.
- Becomes outdated: After any change effecting the simulation other than frame steps.
- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.
[Quick cache]
- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
- Becomes non-exact: Always from frame 1 (unless cache step = 1).
- Becomes outdated: Never.
- Pros/cons: Not very accurate, but super fast!
- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.
* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
- step forwards (to unknown) -> simulate from last exact frame, store result
- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame
* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
- Baking does the same, but runs the simulation all the way to the end of simulation.
- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".
* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
|
|
|
|
2010-03-30 11:49:07 +00:00
|
|
|
key = ob.data.shape_keys
|
|
|
|
|
|
|
|
if key:
|
|
|
|
col.label(text="Rest Shape Key:")
|
|
|
|
col.prop_object(cloth, "rest_shape_key", key, "keys", text="")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
- exact (not marked)
- outdated (simulation is not done completely with current settings)
- non-exact (frames were skipped during simulation)
* The parameter "cache step" effects the number of frames between saved cache frames.
- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
- Speeds up the "quick caching" very much.
- Frames between cached frames are interpolated from the cached frames.
- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.
* The caching can work in normal or "quick" mode:
[Normal cache]
- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
- Becomes non-exact: After larger than 1 frame steps.
- Becomes outdated: After any change effecting the simulation other than frame steps.
- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.
[Quick cache]
- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
- Becomes non-exact: Always from frame 1 (unless cache step = 1).
- Becomes outdated: Never.
- Pros/cons: Not very accurate, but super fast!
- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.
* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
- step forwards (to unknown) -> simulate from last exact frame, store result
- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame
* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
- Baking does the same, but runs the simulation all the way to the end of simulation.
- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".
* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
|
|
|
class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Cloth Cache"
|
|
|
|
bl_default_closed = True
|
Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
- exact (not marked)
- outdated (simulation is not done completely with current settings)
- non-exact (frames were skipped during simulation)
* The parameter "cache step" effects the number of frames between saved cache frames.
- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
- Speeds up the "quick caching" very much.
- Frames between cached frames are interpolated from the cached frames.
- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.
* The caching can work in normal or "quick" mode:
[Normal cache]
- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
- Becomes non-exact: After larger than 1 frame steps.
- Becomes outdated: After any change effecting the simulation other than frame steps.
- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.
[Quick cache]
- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
- Becomes non-exact: Always from frame 1 (unless cache step = 1).
- Becomes outdated: Never.
- Pros/cons: Not very accurate, but super fast!
- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.
* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
- step forwards (to unknown) -> simulate from last exact frame, store result
- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame
* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
- Baking does the same, but runs the simulation all the way to the end of simulation.
- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".
* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def poll(self, context):
|
|
|
|
return context.cloth
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
md = context.cloth
|
2009-11-18 21:57:13 +00:00
|
|
|
point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 0, 0)
|
2009-07-02 19:41:31 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-02 19:41:31 +00:00
|
|
|
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Cloth Collision"
|
|
|
|
bl_default_closed = True
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
return context.cloth
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
cloth = context.cloth.collision_settings
|
|
|
|
|
|
|
|
self.layout.active = cloth_panel_enabled(context.cloth)
|
2009-11-23 00:27:30 +00:00
|
|
|
self.layout.prop(cloth, "enable_collision", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
cloth = context.cloth.collision_settings
|
|
|
|
md = context.cloth
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
layout.active = cloth.enable_collision and cloth_panel_enabled(md)
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(cloth, "collision_quality", slider=True, text="Quality")
|
|
|
|
col.prop(cloth, "min_distance", slider=True, text="Distance")
|
|
|
|
col.prop(cloth, "friction")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-19 12:58:19 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(cloth, "enable_self_collision", text="Self Collision")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = cloth.enable_self_collision
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(cloth, "self_collision_quality", slider=True, text="Quality")
|
|
|
|
sub.prop(cloth, "self_min_distance", slider=True, text="Distance")
|
2009-05-25 18:32:28 +00:00
|
|
|
|
2010-03-26 10:52:55 +00:00
|
|
|
layout.prop(cloth, "group")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-02 19:41:31 +00:00
|
|
|
class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Cloth Stiffness Scaling"
|
|
|
|
bl_default_closed = True
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
return context.cloth
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
cloth = context.cloth.settings
|
|
|
|
|
|
|
|
self.layout.active = cloth_panel_enabled(context.cloth)
|
2009-11-23 00:27:30 +00:00
|
|
|
self.layout.prop(cloth, "stiffness_scaling", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
md = context.cloth
|
|
|
|
ob = context.object
|
|
|
|
cloth = context.cloth.settings
|
2009-11-19 13:26:51 +00:00
|
|
|
wide_ui = context.region.width > narrowui
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md)
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Structural Stiffness:")
|
2009-11-23 11:43:38 +00:00
|
|
|
col.prop_object(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(cloth, "structural_stiffness_max", text="Max")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 13:26:51 +00:00
|
|
|
if wide_ui:
|
2009-11-19 12:58:19 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="Bending Stiffness:")
|
2009-11-23 11:43:38 +00:00
|
|
|
col.prop_object(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(cloth, "bending_stiffness_max", text="Max")
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
|
|
|
class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Cloth Field Weights"
|
|
|
|
bl_default_closed = True
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
return (context.cloth)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
cloth = context.cloth.settings
|
2009-11-18 21:57:13 +00:00
|
|
|
effector_weights_ui(self, context, cloth.effector_weights)
|
2009-11-28 23:37:56 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
classes = [
|
|
|
|
CLOTH_MT_presets,
|
|
|
|
|
|
|
|
PHYSICS_PT_cloth,
|
|
|
|
PHYSICS_PT_cloth_cache,
|
|
|
|
PHYSICS_PT_cloth_collision,
|
|
|
|
PHYSICS_PT_cloth_stiffness,
|
|
|
|
PHYSICS_PT_cloth_field_weights]
|
|
|
|
|
|
|
|
|
|
|
|
def register():
|
|
|
|
register = bpy.types.register
|
|
|
|
for cls in classes:
|
|
|
|
register(cls)
|
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def unregister():
|
|
|
|
unregister = bpy.types.unregister
|
|
|
|
for cls in classes:
|
|
|
|
unregister(cls)
|
2010-02-16 09:55:07 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|