From 28936a415076dbded4ec55cf94c49e8d0abe4035 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 6 Feb 2014 18:44:05 +0100 Subject: Patch T31269: Add sewing seams to cloth simulation Description: -------------------------- Use loose edges marked as seams as sewing springs. Usage: ------------------------- All this patch does is set the rest length to 0 and the stiffness to 1 for springs for loose edges marked as seams so that during the cloth simulation they will be brought together. Example Video: ------------------------- http://www.youtube.com/watch?v=-Y_bC0gjoM0 Original Patch by thesleepless (+ git patch by codemanx) Thank you! --- source/blender/blenkernel/BKE_cloth.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/BKE_cloth.h') diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h index 1b61d0a5443..1e7ac2815b0 100644 --- a/source/blender/blenkernel/BKE_cloth.h +++ b/source/blender/blenkernel/BKE_cloth.h @@ -106,6 +106,7 @@ typedef struct ClothVertex { float bend_stiff; float shear_stiff; int spring_count; /* how many springs attached? */ + float shrink_factor; /* how much to shrink this cloth */ } ClothVertex; @@ -149,7 +150,8 @@ typedef enum { CLOTH_SIMSETTINGS_FLAG_TEARING = ( 1 << 4 ),// true if tearing is enabled CLOTH_SIMSETTINGS_FLAG_SCALING = ( 1 << 8 ), /* is advanced scaling active? */ CLOTH_SIMSETTINGS_FLAG_CCACHE_EDIT = (1 << 12), /* edit cache in editmode */ - CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS = (1 << 13) /* don't allow spring compression */ + CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS = (1 << 13), /* don't allow spring compression */ + CLOTH_SIMSETTINGS_FLAG_SEW = (1 << 14), /* pull ends of loose edges together */ } CLOTH_SIMSETTINGS_FLAGS; /* COLLISION FLAGS */ @@ -163,7 +165,8 @@ typedef enum { CLOTH_SPRING_TYPE_STRUCTURAL = (1 << 1), CLOTH_SPRING_TYPE_SHEAR = (1 << 2), CLOTH_SPRING_TYPE_BENDING = (1 << 3), - CLOTH_SPRING_TYPE_GOAL = (1 << 4) + CLOTH_SPRING_TYPE_GOAL = (1 << 4), + CLOTH_SPRING_TYPE_SEWING = (1 << 5) } CLOTH_SPRING_TYPES; /* SPRING FLAGS */ -- cgit v1.2.3