Alembic override frame causes fluid sim mesh to have artifacts #71981

Closed
opened 2019-11-27 19:55:33 +01:00 by AR · 6 comments

System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.20

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: 26bd5ebd42
Worked: (optional)

Short description of error
when exporting a fluid sim mesh using alembic then importing it back in and clicking override frame so you can animate it the mesh starts having artifacts. video of the bug here https://streamable.com/4hh28

Exact steps for others to reproduce the error
export a short baked fluid sim as alembic, import it back in as alembic, click override frame on the alembic modifier and scrub through the frames

Issue .blend blend file
i don't really know1.abc the alembic file

**System Information** Operating system: Windows-10-10.0.17763 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.20 **Blender Version** Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: `26bd5ebd42` Worked: (optional) **Short description of error** when exporting a fluid sim mesh using alembic then importing it back in and clicking override frame so you can animate it the mesh starts having artifacts. video of the bug here https://streamable.com/4hh28 **Exact steps for others to reproduce the error** export a short baked fluid sim as alembic, import it back in as alembic, click override frame on the alembic modifier and scrub through the frames [ Issue .blend](https://archive.blender.org/developer/F8172830/__Issue_.blend) blend file [i don't really know1.abc](https://archive.blender.org/developer/F8172831/i_don_t_really_know1.abc) the alembic file
Author

Added subscriber: @arc4g-1

Added subscriber: @arc4g-1

Added subscriber: @rlguy

Added subscriber: @rlguy

I am also able to reproduce this issue importing the Alembic cache into a scene. It seems that the odd behaviour only occurs between frame 8.0 and 9.0 in the Override Frame settings.

Here is frame 8.0: frame0.jpg

Here is frame 8.5 which shows the issue: frame1.jpg

Here is frame 9.0: frame2.jpg

Note: this fluid simulation was created in the FLIP Fluids addon where the object mesh data is updated procedurally within the frame_change_post_handler. Adding this information in case it is relevant.

I am also able to reproduce this issue importing the Alembic cache into a scene. It seems that the odd behaviour only occurs between frame 8.0 and 9.0 in the Override Frame settings. Here is frame 8.0: ![frame0.jpg](https://archive.blender.org/developer/F8173914/frame0.jpg) Here is frame 8.5 which shows the issue: ![frame1.jpg](https://archive.blender.org/developer/F8173925/frame1.jpg) Here is frame 9.0: ![frame2.jpg](https://archive.blender.org/developer/F8173919/frame2.jpg) Note: this fluid simulation was created in the FLIP Fluids addon where the object mesh data is updated procedurally within the frame_change_post_handler. Adding this information in case it is relevant.
Sybren A. Stüvel self-assigned this 2019-11-30 01:45:09 +01:00

This is caused by the interpolation of vertex positions between frames. This interpolation causes smooth transitions from one shape to another, and is important when slowing down things like animated characters. When vertices are added or removed, this interpolation is no longer possible. After all, you can't have half a vertex in between the two frames. The Alembic importer tries to detect such situations, but as you see, this can fail. What's happening is that between frames 8 and 9 some vertices change wildly in their position, swapping places between the front and the rear of the sphere. However, the number of vertices, edges, and faces stays the same, so the reader thinks it can interpolate, causing the observed behaviour. Detecting such changes is hard to do, because even a large change from one frame to another could still be valid, and it would also have a performance cost.

As a workaround, you can force the overridden frame to be an integer. That way there won't be any interpolation done, hence this issue won't present itself. The easiest way to do this is to add a driver that enforces this. This is the setup I made for you:

  • Add a custom property to the object you want to use for overriding the frame. Name it frame_override, set the value and default value to 1 so that it becomes an integer. Set the min and max to resp. 1 and 20.
  • Add a driver to the Frame field of the Alembic file that has scripted expression var.
  • Add a variable var to the driver that points to the object and set its data path to ["frame_override"].
  • You can now use the custom property to override the frame number and it'll always be an integer.

Here is your blend file with this workaround applied:

#71981-issue.blend

I'm marking this task as 'To Do' (instead of 'Bug'), as it has a workaround and is not that common to see in the first place. A possible longer-term solution could be a way to disable interpolation for a specific mesh, so that transformations can still be interpolated while still avoiding the observed issues. This isn't as simple as integer frame numbers, though, as Alembic has a different way to encode time and also potentially more or less samples per frame. I see that as a new feature, though, and not so much a bugfix. Another solution would be to have some property in Alembic that can be used to detect such meshes (when reading), or to mark meshes as topology-changing (when writing), but that would also require a proper design.

This is caused by the interpolation of vertex positions between frames. This interpolation causes smooth transitions from one shape to another, and is important when slowing down things like animated characters. When vertices are added or removed, this interpolation is no longer possible. After all, you can't have half a vertex in between the two frames. The Alembic importer tries to detect such situations, but as you see, this can fail. What's happening is that between frames 8 and 9 some vertices change wildly in their position, swapping places between the front and the rear of the sphere. However, the number of vertices, edges, and faces stays the same, so the reader thinks it can interpolate, causing the observed behaviour. Detecting such changes is hard to do, because even a large change from one frame to another could still be valid, and it would also have a performance cost. As a workaround, you can force the overridden frame to be an integer. That way there won't be any interpolation done, hence this issue won't present itself. The easiest way to do this is to add a driver that enforces this. This is the setup I made for you: - Add a custom property to the object you want to use for overriding the frame. Name it `frame_override`, set the value and default value to `1` so that it becomes an integer. Set the min and max to resp. 1 and 20. - Add a driver to the Frame field of the Alembic file that has scripted expression `var`. - Add a variable `var` to the driver that points to the object and set its data path to `["frame_override"]`. - You can now use the custom property to override the frame number and it'll always be an integer. Here is your blend file with this workaround applied: [#71981-issue.blend](https://archive.blender.org/developer/F8191431/T71981-issue.blend) I'm marking this task as 'To Do' (instead of 'Bug'), as it has a workaround and is not that common to see in the first place. A possible longer-term solution could be a way to disable interpolation for a specific mesh, so that transformations can still be interpolated while still avoiding the observed issues. This isn't as simple as integer frame numbers, though, as Alembic has a different way to encode time and also potentially more or less samples per frame. I see that as a new feature, though, and not so much a bugfix. Another solution would be to have some property in Alembic that can be used to detect such meshes (when reading), or to mark meshes as topology-changing (when writing), but that would also require a proper design.

This issue was referenced by bab2260b59

This issue was referenced by bab2260b59c7bffe1e16b5e860ac36b5fdc31bf0

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Thomas Dinges added this to the 2.91 milestone 2023-02-08 16:21: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
4 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#71981
No description provided.