Add sewing seams to cloth simulation #31269

Closed
opened 2012-05-03 13:44:50 +02:00 by Jez Kabanov · 34 comments

%%%Use loose edges marked as seams as sewing springs.
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: http://www.youtube.com/watch?v=-Y_bC0gjoM0%%%

%%%Use loose edges marked as seams as sewing springs. 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: http://www.youtube.com/watch?v=-Y_bC0gjoM0%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'

%%%Assigned to Daniel.

I don't think this feature can go in as is though. The seam flag on edges is for UV unwrapping, and we can't let that same flag influence cloth as well, it needs to be a separate thing. It would also break existing files with cloth simulation that have seams in them.%%%

%%%Assigned to Daniel. I don't think this feature can go in as is though. The seam flag on edges is for UV unwrapping, and we can't let that same flag influence cloth as well, it needs to be a separate thing. It would also break existing files with cloth simulation that have seams in them.%%%

%%%A simple solution might be an option that enables using all loose edges as sewing springs.%%%

%%%A simple solution might be an option that enables using all loose edges as sewing springs.%%%
Author

%%%Made some modifications, it is now toggleable with a "Use Sewing Springs" checkbox and force control.
I've also added a vertex group and settings for shrinking the fabric.%%%

%%%Made some modifications, it is now toggleable with a "Use Sewing Springs" checkbox and force control. I've also added a vertex group and settings for shrinking the fabric.%%%
Member

%%%I like how the patch progresses! Nice changes.

a) I could imagine a seperate tab where "preroll" and the sewing options can be put.
b) It would be nice if people wouldn't have to press alt-a to see the sewing effect. Maybe "preroll" and "sewing" can be somehow combined in a way that the sewing outcome is saved automatically as shapekeys. Do you know what i mean? :-) Using shapekey positions for the spring rest length was introduced during BBB production.

This work got quite the potential!
%%%

%%%I like how the patch progresses! Nice changes. a) I could imagine a seperate tab where "preroll" and the sewing options can be put. b) It would be nice if people wouldn't have to press alt-a to see the sewing effect. Maybe "preroll" and "sewing" can be somehow combined in a way that the sewing outcome is saved automatically as shapekeys. Do you know what i mean? :-) Using shapekey positions for the spring rest length was introduced during BBB production. This work got quite the potential! %%%

%%%Hi Jez Kabanov,

Your patch is great! I merged your patch to my patch (cloth air pressure, #30941), and changed your code to allow negative shrinking factor (i.e. expanding the cloth).%%%

%%%Hi Jez Kabanov, Your patch is great! I merged your patch to my patch (cloth air pressure, #30941), and changed your code to allow negative shrinking factor (i.e. expanding the cloth).%%%

%%%I would like to spend some words for this patch, that is very useful, easy to use, robust, unobtrusive, and above all, it offers a more powerful approach to the making of garments or composed/patched items, similar to the Marvelous Designer concept (just the starting point...).

It would be nice, and harmless I guess, if it could be included in trunk.

Thank you,
paolo%%%

%%%I would like to spend some words for this patch, that is very useful, easy to use, robust, unobtrusive, and above all, it offers a more powerful approach to the making of garments or composed/patched items, similar to the Marvelous Designer concept (just the starting point...). It would be nice, and harmless I guess, if it could be included in trunk. Thank you, paolo%%%
pyrochlore commented 2013-12-12 03:17:15 +01:00 (Migrated from localhost:3001)

Added subscriber: @pyrochlore

Added subscriber: @pyrochlore

Added subscriber: @kevindietrich

Added subscriber: @kevindietrich

Added subscriber: @SusanSpencer

Added subscriber: @SusanSpencer
Member

Added subscriber: @CodeManX

Added subscriber: @CodeManX
Member

Merged with recent trunk and attached git-diff of patch version 1.2

Seems to work, any reason why it wasn't applied so far?

Merged with recent trunk and attached git-diff of patch version 1.2 Seems to work, any reason why it wasn't applied so far?
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

Commited, thanks people! Please test and tell me if there are any problems (with a blend file please!)

Commited, thanks people! Please test and tell me if there are any problems (with a blend file please!)

It looks like shrinking vertex group doesn't work, but there is already related code in patch file. It works if I leave the vertex group empty and change the Min and Max value, but nothing happens if the vertex group is not empty. Is it unimplemented or am I doing something wrong? This is test blend file in archive: test123.zip

It looks like shrinking vertex group doesn't work, but there is already related code in patch file. It works if I leave the vertex group empty and change the Min and Max value, but nothing happens if the vertex group is not empty. Is it unimplemented or am I doing something wrong? This is test blend file in archive: [test123.zip](https://archive.blender.org/developer/F76334/test123.zip)
Member

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'
CodeManX reopened this issue 2014-02-09 23:29:36 +01:00
Member

Re-opening as there are a few issues:

  • Vertex Group shrinking not working?
  • shrink_max not initialized with 1.0f (line lost during auto-merge?)
  • Possibly crashing for certain complex setups
  (no testcase yet, please try Mirror modifier, single loose edges as well as loose edge **strings** and change Collision settings during simulation)
Re-opening as there are a few issues: - Vertex Group shrinking not working? - `shrink_max` not initialized with 1.0f (line lost during auto-merge?) - Possibly crashing for certain complex setups ``` (no testcase yet, please try Mirror modifier, single loose edges as well as loose edge **strings** and change Collision settings during simulation)
Author

thanks for the issue report codemanx, i'll see if i can fix those up.

thanks for the issue report codemanx, i'll see if i can fix those up.
Author

Okay, I've figured out why it wasn't working.

I've uploaded a patch which fixes shrinking with vertex groups and readded initialising shrink_max.

the cloth_uses_vgroup function is rather odd and unclear about what it's doing and why.
I think it needs a good looking over to ensure it's doing what it's supposed to do.

Okay, I've figured out why it wasn't working. I've uploaded a patch which fixes shrinking with vertex groups and readded initialising shrink_max. the `cloth_uses_vgroup` function is rather odd and unclear about what it's doing and why. I think it needs a good looking over to ensure it's doing what it's supposed to do.
Author

"Possibly crashing for certain complex setups (no testcase yet, please try Mirror
modifier, single loose edges as well as loose edge strings and change Collision settings during simulation)"

Tested all these situations and was unable to crash it.

"Possibly crashing for certain complex setups (no testcase yet, please try Mirror modifier, single loose edges as well as loose edge strings and change Collision settings during simulation)" Tested all these situations and was unable to crash it.

Added subscriber: @jesus650rwc

Added subscriber: @jesus650rwc

How do i install this addon to blender?

How do i install this addon to blender?
Member

Hey,

I did take another look at the bugfix patch and looks not bad.

But I htink we need to introduce some checks if we are actually using SEWING mode: "if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SEW)" before checking the vertex groups: "if(clmd->sim_parms->vgroup_shrink > 0)".

My patch is not perfect, it could be that i "fixed" something which results in a bug. And I also know that there are some "if"'s missing to check for FLAG_SEWING.

Maybe you can help me getting this stuff production ready - patch.diff

Hey, I did take another look at the bugfix patch and looks not bad. But I htink we need to introduce some checks if we are actually using SEWING mode: "if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SEW)" before checking the vertex groups: "if(clmd->sim_parms->vgroup_shrink > 0)". My patch is not perfect, it could be that i "fixed" something which results in a bug. And I also know that there are some "if"'s missing to check for FLAG_SEWING. Maybe you can help me getting this stuff production ready - [patch.diff](https://archive.blender.org/developer/F77840/patch.diff)
Member

Forgot the file...

Forgot the file...
Member

A note: "cloth_uses_vgroup"
"cloth_uses_vgroup" is used by the modifier stack to ensure that the necessary custom data layers are generated. In this case we need vertex group layers sometimes. It saves alot of time, if we don't request the custom data layers for vgroups if we don't use them. That's how every modifier does it :-)

A note: **"cloth_uses_vgroup"** "cloth_uses_vgroup" is used by the modifier stack to ensure that the necessary custom data layers are generated. In this case we need vertex group layers sometimes. It saves alot of time, if we don't request the custom data layers for vgroups if we don't use them. That's how every modifier does it :-)
Member

@jesus650rwc: It's not an addon. Get a recent build from buildbot or graphicall, it's integrated in those.

@jesus650rwc: It's not an addon. Get a recent build from buildbot or graphicall, it's integrated in those.
Author

Thanks genscher for the explanation.

I'll fix up the SEW flag stuff.

One thing to note is that the sewing and shrinking functionality are not really related, it just so happens they're handy together for clothing design.

I might seperate them in the UI as you may want to just build a larger cloth mesh and shrink it over a collision model.

Thanks genscher for the explanation. I'll fix up the SEW flag stuff. One thing to note is that the sewing and shrinking functionality are not really related, it just so happens they're handy together for clothing design. I might seperate them in the UI as you may want to just build a larger cloth mesh and shrink it over a collision model.

Hi genscher,

I added some missing if's for you, and fixing some bugs in your patch, and refined cloth_uses_vgroup() function.

As thesleepless said, maybe the sewing and shrinking functionality should be separated.

Hi genscher, I added some missing if's for you, and fixing some bugs in your patch, and refined cloth_uses_vgroup() function. As thesleepless said, maybe the sewing and shrinking functionality should be separated.

Is there a build for Mac OSX 64-bit with the sewing patch?

Is there a build for Mac OSX 64-bit with the sewing patch?

Added subscriber: @bgebhard

Added subscriber: @bgebhard
Member

Added subscribers: @LucaRood-3, @Blendify

Added subscribers: @LucaRood-3, @Blendify
Member

Can this be closed? @LucaRood-3

Can this be closed? @LucaRood-3
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

No idea why this stayed open so long...

No idea why this stayed open so long...
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
13 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#31269
No description provided.