Cloth simulation randomly breaks down when scrubbing timeline #99913

Open
opened 2022-07-22 14:54:41 +02:00 by Alexander · 9 comments

System Information
Operating system: Ubuntu 20.04
Graphics card: Geforce MX230

Blender Version
Broken: 3.2.1
Worked: (newest version of Blender that worked as expected)

Short description of error
When scrubbing the timeline , the cloth simulation may cause the mesh to become distorted even with the existence of cache. The video below will show a quick way to break the simulation, however, I first stumbled upon the problem when I set the keys for the bones.

2022-07-22 15-48-43.mp4

Exact steps for others to reproduce the error

  1. Create cloth simulation.
  2. Scrub the timeline. After some time, a situation will arise where the mesh will be distorted.
**System Information** Operating system: Ubuntu 20.04 Graphics card: Geforce MX230 **Blender Version** Broken: 3.2.1 Worked: (newest version of Blender that worked as expected) **Short description of error** When scrubbing the timeline , the cloth simulation may cause the mesh to become distorted even with the existence of cache. The video below will show a quick way to break the simulation, however, I first stumbled upon the problem when I set the keys for the bones. [2022-07-22 15-48-43.mp4](https://archive.blender.org/developer/F13308149/2022-07-22_15-48-43.mp4) **Exact steps for others to reproduce the error** 1. Create cloth simulation. 2. Scrub the timeline. After some time, a situation will arise where the mesh will be distorted.
Author

Added subscriber: @sanek2005

Added subscriber: @sanek2005
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

I can't replicate the issue on a simple cloth simulation I created. Can you attach this particular file?

I can't replicate the issue on a simple cloth simulation I created. Can you attach this particular file?
Author

flag_canat.blend
I noticed that this bug is faster and more noticeable on my file. again, I repeat, the error happens absolutely by accident, it may take some time to reproduce it

[flag_canat.blend](https://archive.blender.org/developer/F13308284/flag_canat.blend) I noticed that this bug is faster and more noticeable on my file. again, I repeat, the error happens absolutely by accident, it may take some time to reproduce it
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'
Member

I can reproduce, though it very unreliably and requires multiple tries to reproduce.

I can reproduce, though it very unreliably and requires multiple tries to reproduce.
Omar Emara changed title from cloth simulation randomly breaks down when manipulating timeline to Cloth simulation randomly breaks down when scrubbing timeline 2022-07-22 16:08:51 +02:00
Member

Added subscriber: @LukasTonne

Added subscriber: @LukasTonne
Member

This seems to be a problem with the point cache mixing up the two cloth sim objects in the scene. One of them has a cache length of 100 frames, the other has 250. On loading the file the 250 frame cache is fully populated, but during scrubbing at some point it gets chopped off to the 100 frames of the other cache. After that the cloth sim sees skipped frames and tries to simulate with large time steps or backward time steps, which (unsurprisingly) causes the exploding behavior.

CORRRECTION
The 250 frame cache (Plane.001) is already limited to 100 cached frames initially, which is correct because of the scene frame range being set to 0..100. So the cache is not actually modified incorrectly by the point cache itself.

What is happening is that the cloth sim will request will try to find a valid cache frame before simulating. Usually if a frame outside the cached range is requested this will just return the last valid cache frame, but in this case the cloth sim sets the no_extrapolate_old flag to true. https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/cloth.c$368-371

This causes the point cache to return 0 ("no frame found") and this triggers an invalidation of the entire cache.

~~This seems to be a problem with the point cache mixing up the two cloth sim objects in the scene. One of them has a cache length of 100 frames, the other has 250. On loading the file the 250 frame cache is fully populated, but during scrubbing at some point it gets chopped off to the 100 frames of the other cache. After that the cloth sim sees skipped frames and tries to simulate with large time steps or backward time steps, which (unsurprisingly) causes the exploding behavior.~~ **CORRRECTION** The 250 frame cache (`Plane.001`) is already limited to 100 cached frames initially, which is correct because of the scene frame range being set to 0..100. So the cache is not actually modified incorrectly by the point cache itself. What is happening is that the cloth sim will request will try to find a valid cache frame before simulating. Usually if a frame outside the cached range is requested this will just return the last valid cache frame, but in this case the cloth sim sets the `no_extrapolate_old` flag to true. https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/cloth.c$368-371 This causes the point cache to return 0 ("no frame found") and this triggers an invalidation of the entire cache.
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:43:50 +01:00
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
3 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#99913
No description provided.