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>
|
2018-07-26 12:33:31 +02:00
|
|
|
|
|
|
|
from bpy.types import (
|
|
|
|
Panel,
|
|
|
|
)
|
2019-03-13 12:41:22 +11:00
|
|
|
from bl_ui.utils import PresetPanel
|
2009-11-19 12:58:19 +00:00
|
|
|
|
2019-06-11 16:08:32 +10:00
|
|
|
from bl_ui.properties_physics_common import (
|
2017-10-21 12:41:42 +11:00
|
|
|
point_cache_ui,
|
|
|
|
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):
|
2016-12-28 17:30:58 +01:00
|
|
|
return md.point_cache.is_baked is False
|
2009-11-28 23:37:56 +00:00
|
|
|
|
2009-11-22 10:32:37 +00:00
|
|
|
|
2019-03-13 12:41:22 +11:00
|
|
|
class CLOTH_PT_presets(PresetPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Cloth Presets"
|
2009-11-22 11:23:19 +00:00
|
|
|
preset_subdir = "cloth"
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27:50 +00:00
|
|
|
preset_operator = "script.execute_preset"
|
2018-04-27 13:50:26 +02:00
|
|
|
preset_add_operator = "cloth.preset_add"
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-29 15:20:36 +00:00
|
|
|
|
2015-01-29 15:35:06 +11:00
|
|
|
class PhysicButtonsPanel:
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "physics"
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
ob = context.object
|
2018-04-17 13:35:05 +02:00
|
|
|
return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.cloth)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Cloth"
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw_header_preset(self, _context):
|
2018-06-20 16:32:31 +02:00
|
|
|
CLOTH_PT_presets.draw_panel_header(self.layout)
|
2018-04-27 13:50:26 +02:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-07-26 12:33:31 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
md = context.cloth
|
2011-11-10 19:10:23 +00:00
|
|
|
cloth = md.settings
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2016-07-30 14:44:28 +10:00
|
|
|
layout.active = cloth_panel_enabled(md)
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
2016-07-30 14:46:19 +10:00
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "quality", text="Quality Steps")
|
2018-09-14 15:46:55 +02:00
|
|
|
col = flow.column()
|
2018-07-26 12:33:31 +02:00
|
|
|
col.prop(cloth, "time_scale", text="Speed Multiplier")
|
2016-07-30 14:46:19 +10:00
|
|
|
|
2016-07-30 14:44:28 +10:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
class PHYSICS_PT_cloth_physical_properties(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Physical Properties"
|
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth'
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-09-14 15:46:55 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
md = context.cloth
|
|
|
|
cloth = md.settings
|
|
|
|
|
|
|
|
layout.active = cloth_panel_enabled(md)
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
|
|
|
|
|
|
|
col = flow.column()
|
2019-11-21 12:28:39 +01:00
|
|
|
col.prop(cloth, "mass", text="Vertex Mass")
|
2018-07-26 12:33:31 +02:00
|
|
|
col = flow.column()
|
2018-09-14 15:46:55 +02:00
|
|
|
col.prop(cloth, "air_damping", text="Air Viscosity")
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "bending_model")
|
2018-08-29 00:29:37 +02:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
|
|
|
|
class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Stiffness"
|
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth_physical_properties'
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-09-14 15:46:55 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
md = context.cloth
|
|
|
|
cloth = md.settings
|
|
|
|
|
|
|
|
layout.active = cloth_panel_enabled(md)
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
2018-08-29 00:29:37 +02:00
|
|
|
|
|
|
|
col = flow.column()
|
2018-09-14 15:46:55 +02:00
|
|
|
|
2018-08-29 00:29:37 +02:00
|
|
|
if cloth.bending_model == 'ANGULAR':
|
2018-09-14 15:46:55 +02:00
|
|
|
col.prop(cloth, "tension_stiffness", text="Tension")
|
|
|
|
col = flow.column()
|
2018-08-29 00:29:37 +02:00
|
|
|
col.prop(cloth, "compression_stiffness", text="Compression")
|
|
|
|
else:
|
2018-09-14 15:46:55 +02:00
|
|
|
col.prop(cloth, "tension_stiffness", text="Structural")
|
2018-08-29 00:29:37 +02:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
col = flow.column()
|
2018-08-29 00:29:37 +02:00
|
|
|
col.prop(cloth, "shear_stiffness", text="Shear")
|
2018-09-14 15:46:55 +02:00
|
|
|
col = flow.column()
|
2011-11-10 19:10:23 +00:00
|
|
|
col.prop(cloth, "bending_stiffness", text="Bending")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
|
|
|
|
class PHYSICS_PT_cloth_damping(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Damping"
|
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth_physical_properties'
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-09-14 15:46:55 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
md = context.cloth
|
|
|
|
cloth = md.settings
|
|
|
|
|
|
|
|
layout.active = cloth_panel_enabled(md)
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
col = flow.column()
|
2018-09-14 15:46:55 +02:00
|
|
|
|
2018-08-29 00:29:37 +02:00
|
|
|
if cloth.bending_model == 'ANGULAR':
|
2018-09-14 15:46:55 +02:00
|
|
|
col.prop(cloth, "tension_damping", text="Tension")
|
|
|
|
col = flow.column()
|
2018-08-29 00:29:37 +02:00
|
|
|
col.prop(cloth, "compression_damping", text="Compression")
|
|
|
|
else:
|
2018-09-14 15:46:55 +02:00
|
|
|
col.prop(cloth, "tension_damping", text="Structural")
|
2018-08-29 00:29:37 +02:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
col = flow.column()
|
2018-08-29 00:29:37 +02:00
|
|
|
col.prop(cloth, "shear_damping", text="Shear")
|
2018-07-26 12:33:31 +02:00
|
|
|
col = flow.column()
|
2018-09-14 15:46:55 +02:00
|
|
|
col.prop(cloth, "bending_damping", text="Bending")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
2019-12-09 19:10:55 +01:00
|
|
|
class PHYSICS_PT_cloth_internal_springs(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Internal Springs"
|
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth_physical_properties'
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
cloth = context.cloth.settings
|
|
|
|
|
|
|
|
self.layout.active = cloth_panel_enabled(context.cloth)
|
|
|
|
self.layout.prop(cloth, "use_internal_springs", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
cloth = context.cloth.settings
|
|
|
|
md = context.cloth
|
|
|
|
ob = context.object
|
|
|
|
|
|
|
|
layout.active = cloth.use_internal_springs and cloth_panel_enabled(md)
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "internal_spring_max_length", text="Max Spring Creation Length")
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "internal_spring_max_diversion", text="Max Creation Diversion")
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "internal_spring_normal_check", text="Check Surface Normals")
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "internal_tension_stiffness", text="Tension")
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "internal_compression_stiffness", text="Compression")
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop_search(cloth, "vertex_group_intern", ob, "vertex_groups", text="Vertex Group")
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "internal_tension_stiffness_max", text="Max Tension")
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "internal_compression_stiffness_max", text="Max Compression")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
2019-11-27 14:56:16 +01:00
|
|
|
class PHYSICS_PT_cloth_pressure(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Pressure"
|
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth_physical_properties'
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
cloth = context.cloth.settings
|
|
|
|
|
|
|
|
self.layout.active = cloth_panel_enabled(context.cloth)
|
|
|
|
self.layout.prop(cloth, "use_pressure", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
cloth = context.cloth.settings
|
|
|
|
md = context.cloth
|
2019-12-04 11:24:46 +01:00
|
|
|
ob = context.object
|
2019-11-27 14:56:16 +01:00
|
|
|
|
|
|
|
layout.active = cloth.use_pressure and cloth_panel_enabled(md)
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "uniform_pressure_force")
|
|
|
|
|
|
|
|
col = flow.column()
|
2020-02-03 22:35:39 -05:00
|
|
|
col.prop(cloth, "use_pressure_volume", text="Custom Volume")
|
2019-11-27 14:56:16 +01:00
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.active = cloth.use_pressure_volume
|
|
|
|
col.prop(cloth, "target_volume")
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "pressure_factor", text="Factor")
|
|
|
|
|
2019-12-04 11:24:46 +01:00
|
|
|
col = flow.column()
|
|
|
|
col.prop_search(cloth, "vertex_group_pressure", ob, "vertex_groups", text="Vertex Group")
|
|
|
|
|
2019-11-27 14:56:16 +01:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Cache"
|
2018-07-26 12:33:31 +02:00
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth'
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
def draw(self, context):
|
2018-07-26 12:33:31 +02:00
|
|
|
md = context.cloth
|
2019-04-19 07:32:24 +02:00
|
|
|
point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
|
2018-09-14 15:46:55 +02:00
|
|
|
|
2016-07-30 14:44:28 +10:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
class PHYSICS_PT_cloth_shape(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Shape"
|
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth'
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2016-07-30 14:47:31 +10:00
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = 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
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
md = context.cloth
|
|
|
|
ob = context.object
|
|
|
|
cloth = md.settings
|
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
layout.active = cloth_panel_enabled(md)
|
2018-07-26 12:33:31 +02:00
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop_search(cloth, "vertex_group_mass", ob, "vertex_groups", text="Pin Group")
|
2018-07-26 12:33:31 +02:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.active = cloth.vertex_group_mass != ""
|
|
|
|
sub.prop(cloth, "pin_stiffness", text="Stiffness")
|
2018-07-26 12:33:31 +02:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
col.separator()
|
2018-07-26 12:33:31 +02:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop(cloth, "use_sewing_springs", text="Sewing")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.active = cloth.use_sewing_springs
|
|
|
|
sub.prop(cloth, "sewing_force_max", text="Max Sewing Force")
|
2010-04-04 14:52:15 +00:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
col.separator()
|
2016-12-28 17:30:58 +01:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "shrink_min", text="Shrinking Factor")
|
2016-12-28 17:30:58 +01:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "use_dynamic_mesh", text="Dynamic Mesh")
|
|
|
|
|
|
|
|
key = ob.data.shape_keys
|
2016-12-28 17:30:58 +01:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
if key:
|
|
|
|
col = flow.column()
|
|
|
|
col.active = not cloth.use_dynamic_mesh
|
|
|
|
col.prop_search(cloth, "rest_shape_key", key, "key_blocks", text="Rest Shape Key")
|
|
|
|
|
|
|
|
|
2018-09-26 17:18:16 +02:00
|
|
|
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
|
2019-06-30 12:49:49 -04:00
|
|
|
bl_label = "Collisions"
|
2018-06-19 15:33:32 +02:00
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth'
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-09-26 17:18:16 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
cloth = context.cloth.collision_settings
|
|
|
|
md = context.cloth
|
|
|
|
|
|
|
|
layout.active = (cloth.use_collision or cloth.use_self_collision) and cloth_panel_enabled(md)
|
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "collision_quality", text="Quality")
|
|
|
|
|
|
|
|
|
|
|
|
class PHYSICS_PT_cloth_object_collision(PhysicButtonsPanel, Panel):
|
2019-06-30 12:49:49 -04:00
|
|
|
bl_label = "Object Collisions"
|
2018-09-26 17:18:16 +02:00
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth_collision'
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-09-26 17:18:16 +02:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw_header(self, context):
|
|
|
|
cloth = context.cloth.collision_settings
|
|
|
|
|
|
|
|
self.layout.active = cloth_panel_enabled(context.cloth)
|
2010-08-20 06:09:58 +00:00
|
|
|
self.layout.prop(cloth, "use_collision", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-07-26 12:33:31 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
cloth = context.cloth.collision_settings
|
|
|
|
md = context.cloth
|
|
|
|
|
2010-08-20 06:09:58 +00:00
|
|
|
layout.active = cloth.use_collision and cloth_panel_enabled(md)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
col = flow.column()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(cloth, "distance_min", slider=True, text="Distance")
|
2018-07-26 12:33:31 +02:00
|
|
|
|
|
|
|
col = flow.column()
|
2018-09-26 17:18:16 +02:00
|
|
|
col.prop(cloth, "impulse_clamp")
|
|
|
|
|
|
|
|
col = flow.column()
|
2018-11-28 17:49:52 +01:00
|
|
|
col.prop(cloth, "collection")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-05-25 18:32:28 +00:00
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
class PHYSICS_PT_cloth_self_collision(PhysicButtonsPanel, Panel):
|
2019-06-30 12:49:49 -04:00
|
|
|
bl_label = "Self Collisions"
|
2018-09-26 17:18:16 +02:00
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth_collision'
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2018-07-26 12:33:31 +02:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
cloth = context.cloth.collision_settings
|
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
self.layout.active = cloth_panel_enabled(context.cloth)
|
2018-07-26 12:33:31 +02:00
|
|
|
self.layout.prop(cloth, "use_self_collision", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
cloth = context.cloth.collision_settings
|
|
|
|
md = context.cloth
|
|
|
|
ob = context.object
|
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
layout.active = cloth.use_self_collision and cloth_panel_enabled(md)
|
2018-07-26 12:33:31 +02:00
|
|
|
|
|
|
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
|
|
|
|
|
|
|
col = flow.column()
|
2018-09-26 17:18:16 +02:00
|
|
|
col.prop(cloth, "self_friction", text="Friction")
|
|
|
|
|
|
|
|
col = flow.column()
|
2018-07-26 12:33:31 +02:00
|
|
|
col.prop(cloth, "self_distance_min", slider=True, text="Distance")
|
|
|
|
|
2018-09-26 17:18:16 +02:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(cloth, "self_impulse_clamp")
|
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
col = flow.column()
|
2018-08-24 10:51:53 +10:00
|
|
|
col.prop_search(cloth, "vertex_group_self_collisions", ob, "vertex_groups", text="Vertex Group")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-04-04 14:52:15 +00:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
class PHYSICS_PT_cloth_property_weights(PhysicButtonsPanel, Panel):
|
|
|
|
bl_label = "Property Weights"
|
2018-06-19 15:33:32 +02:00
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth'
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-07-26 12:33:31 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
md = context.cloth
|
|
|
|
ob = context.object
|
|
|
|
cloth = context.cloth.settings
|
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
layout.active = cloth_panel_enabled(md)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
col = flow.column()
|
2018-08-24 10:51:53 +10:00
|
|
|
col.prop_search(
|
2018-07-26 12:33:31 +02:00
|
|
|
cloth, "vertex_group_structural_stiffness", ob, "vertex_groups",
|
2019-04-13 12:44:34 +02:00
|
|
|
text="Structural Group",
|
2018-07-26 12:33:31 +02:00
|
|
|
)
|
2018-08-29 00:29:37 +02:00
|
|
|
col.prop(cloth, "tension_stiffness_max", text="Max Tension")
|
2018-09-14 15:46:55 +02:00
|
|
|
col.prop(cloth, "compression_stiffness_max", text="Max Compression")
|
2018-08-29 00:29:37 +02:00
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.prop_search(
|
|
|
|
cloth, "vertex_group_shear_stiffness", ob, "vertex_groups",
|
2019-04-13 12:44:34 +02:00
|
|
|
text="Shear Group",
|
2018-08-29 00:29:37 +02:00
|
|
|
)
|
2018-09-14 15:46:55 +02:00
|
|
|
col.prop(cloth, "shear_stiffness_max", text="Max Shearing")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col = flow.column()
|
2018-08-24 10:51:53 +10:00
|
|
|
col.prop_search(
|
2018-07-26 12:33:31 +02:00
|
|
|
cloth, "vertex_group_bending", ob, "vertex_groups",
|
|
|
|
text="Bending Group"
|
|
|
|
)
|
2018-09-14 15:46:55 +02:00
|
|
|
col.prop(cloth, "bending_stiffness_max", text="Max Bending")
|
2014-02-06 21:45:43 +01:00
|
|
|
|
2018-07-26 12:33:31 +02:00
|
|
|
col.separator()
|
2014-02-06 21:45:43 +01:00
|
|
|
|
2018-09-14 15:46:55 +02:00
|
|
|
col = flow.column()
|
|
|
|
col.prop_search(
|
|
|
|
cloth, "vertex_group_shrink", ob, "vertex_groups",
|
|
|
|
text="Shrinking Group"
|
|
|
|
)
|
|
|
|
col.prop(cloth, "shrink_max", text="Max Shrinking")
|
2014-02-06 21:45:43 +01:00
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel):
|
2018-06-19 15:33:32 +02:00
|
|
|
bl_label = "Field Weights"
|
|
|
|
bl_parent_id = 'PHYSICS_PT_cloth'
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
cloth = context.cloth.settings
|
2019-04-19 07:32:24 +02:00
|
|
|
effector_weights_ui(self, cloth.effector_weights, 'CLOTH')
|
2011-04-04 10:13:04 +00:00
|
|
|
|
2018-06-05 16:32:11 +02:00
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
classes = (
|
2018-06-20 16:32:31 +02:00
|
|
|
CLOTH_PT_presets,
|
2017-03-18 20:03:24 +11:00
|
|
|
PHYSICS_PT_cloth,
|
2018-09-14 15:46:55 +02:00
|
|
|
PHYSICS_PT_cloth_physical_properties,
|
|
|
|
PHYSICS_PT_cloth_stiffness,
|
|
|
|
PHYSICS_PT_cloth_damping,
|
2019-12-09 19:10:55 +01:00
|
|
|
PHYSICS_PT_cloth_internal_springs,
|
2019-11-27 14:56:16 +01:00
|
|
|
PHYSICS_PT_cloth_pressure,
|
2017-03-18 20:03:24 +11:00
|
|
|
PHYSICS_PT_cloth_cache,
|
2018-09-14 15:46:55 +02:00
|
|
|
PHYSICS_PT_cloth_shape,
|
2018-09-26 17:18:16 +02:00
|
|
|
PHYSICS_PT_cloth_collision,
|
2018-09-14 15:46:55 +02:00
|
|
|
PHYSICS_PT_cloth_object_collision,
|
2018-07-26 12:33:31 +02:00
|
|
|
PHYSICS_PT_cloth_self_collision,
|
2018-09-14 15:46:55 +02:00
|
|
|
PHYSICS_PT_cloth_property_weights,
|
2017-03-18 20:03:24 +11:00
|
|
|
PHYSICS_PT_cloth_field_weights,
|
|
|
|
)
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 20:03:24 +11:00
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|