[Bf-blender-cvs] [5268cbdb844] soc-2019-adaptive-cloth: Cloth: add support for turning adaptive remeshing on or off
ishbosamiya
noreply at git.blender.org
Fri Aug 9 12:42:34 CEST 2019
Commit: 5268cbdb844e9520233a1e8ff753228319d36ef6
Author: ishbosamiya
Date: Fri Aug 9 13:02:29 2019 +0530
Branches: soc-2019-adaptive-cloth
https://developer.blender.org/rB5268cbdb844e9520233a1e8ff753228319d36ef6
Cloth: add support for turning adaptive remeshing on or off
===================================================================
M release/scripts/startup/bl_ui/properties_physics_cloth.py
M source/blender/blenkernel/BKE_cloth.h
M source/blender/blenkernel/intern/cloth.c
M source/blender/modifiers/intern/MOD_cloth.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py
index 14a8e1d7e5f..a9a14b608ad 100644
--- a/release/scripts/startup/bl_ui/properties_physics_cloth.py
+++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py
@@ -315,6 +315,13 @@ class PHYSICS_PT_cloth_remeshing(PhysicButtonsPanel, Panel):
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
+ def draw_header(self, context):
+ md = context.cloth
+ cloth = md.settings
+
+#self.layout.active = cloth_panel_enabled(context.cloth)
+ self.layout.prop(cloth, "use_adaptive_remeshing", text="")
+
def draw(self, context):
layout = self.layout
layout.use_property_split = True
@@ -322,7 +329,7 @@ class PHYSICS_PT_cloth_remeshing(PhysicButtonsPanel, Panel):
md = context.cloth
cloth = md.settings
-#layout.active = cloth_panel_enabled(md)
+ layout.active = cloth.use_adaptive_remeshing# and cloth_panel_enabled(md)
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h
index d5dff1d119b..d8a636832d4 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -46,7 +46,7 @@ struct ClothSizing;
#define ALMOST_ZERO FLT_EPSILON
/* Toggle Cloth Cache */
-#define USE_CLOTH_CACHE 1
+#define USE_CLOTH_CACHE 0
/* Bits to or into the ClothVertex.flags. */
typedef enum eClothVertexFlag {
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index a69b8d49dc4..2672e675988 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -383,7 +383,10 @@ static Mesh *do_step_cloth(
// printf ( "%f\n", ( float ) tval() );
- Mesh *mesh_result = cloth_remeshing_step(depsgraph, ob, clmd, result);
+ Mesh *mesh_result = NULL;
+ if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_ADAPTIVE_REMESHING) {
+ mesh_result = cloth_remeshing_step(depsgraph, ob, clmd, result);
+ }
if (!ret) {
return NULL;
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c
index d0a32f58d08..d15c8058276 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -31,7 +31,7 @@
#include "DNA_key_types.h"
#include "DNA_mesh_types.h"
#include "DNA_scene_types.h"
-#define USE_CLOTH_CACHE 1
+#define USE_CLOTH_CACHE 0
#if USE_CLOTH_CACHE
#else
# include "DNA_object_force_types.h"
More information about the Bf-blender-cvs
mailing list