Objects with clampto constraint change their position after the target object from copy rotation constraint is rotated and then pressed ctrl+z #91102

Open
opened 2021-09-01 04:57:42 +02:00 by Artem · 5 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1660 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71

Blender Version
Broken: version: 2.93.3, branch: master, commit date: 2021-08-17 18:30, hash: 8b80d19f36
Worked: 2.82a

Short description of error

On the video clampto constrain is used on the ammo. When I rotate it and press ctrl+z ammo change their position and move chaotically

20210901_054810.mp4

Exact steps for others to reproduce the error
#91102.blend

Rotate the empty and press ctrl+z, object array in "ammo" collection will change shape.

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1660 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71 **Blender Version** Broken: version: 2.93.3, branch: master, commit date: 2021-08-17 18:30, hash: `8b80d19f36` Worked: 2.82a **Short description of error** On the video clampto constrain is used on the ammo. When I rotate it and press ctrl+z ammo change their position and move chaotically [20210901_054810.mp4](https://archive.blender.org/developer/F10359394/20210901_054810.mp4) **Exact steps for others to reproduce the error** [#91102.blend](https://archive.blender.org/developer/F10359407/T91102.blend) Rotate the empty and press ctrl+z, object array in "ammo" collection will change shape.
Author

Added subscriber: @artemsh

Added subscriber: @artemsh
Artem changed title from Objects with clampto constraint change their position after shade smooth is applied on another object to Objects with clampto constraint change their position after the target object from copy rotation constraint is rotated and then pressed ctrl+z 2021-09-01 05:04:54 +02:00

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

This seems to have more to do with the curve that's being clamped to, than the actual constraint. After undo, the situation can be fixed (temporarily, until the next undo) by selecting the curve and going into edit mode.

minimal.blend

Here is a minimal example.

  • Open the file. Suzanne is in the right-hand Empty
  • Rotate the curve, undo with {key Ctrl Z}
  • Suzanne now is in the left-hand Empty
  • Trigger re-evaluation of the curve (go to edit mode, or change any of the curve properties) and Suzanne snaps back to her original position.
This seems to have more to do with the curve that's being clamped to, than the actual constraint. After undo, the situation can be fixed (temporarily, until the next undo) by selecting the curve and going into edit mode. [minimal.blend](https://archive.blender.org/developer/F10394409/minimal.blend) Here is a minimal example. - Open the file. Suzanne is in the right-hand Empty - Rotate the curve, undo with {key Ctrl Z} - Suzanne now is in the left-hand Empty - Trigger re-evaluation of the curve (go to edit mode, or change any of the curve properties) and Suzanne snaps back to her original position.

This is a quick fix, put here for future reference, but it still has problems with memory leaks. A proper solution involves getting the bounding box properly evaluated in the depsgraph, which can also speed up other situations.

Author: Sybren A. Stüvel <sybren@blender.org>
Date:   Thu Sep 16 16:00:48 2021 +0200

    Fix T91102: Bounding Box computations can differ
    
    Unify the bounding box implementation of `BKE_curve_boundbox_get()` by
    copying the approach of `boundbox_displist_object()`.
    
    Both functions are writing to `ob->runtime.bb`, but used different
    ways to compute the bounding box. This meant that when a curve would
    come from edit mode, it would have a different bounding box than when
    undoing a previous action (which triggers a different evaluation path
    to avoid values being overwritten by the evaluation of animation data).

diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index f22c3b13efc..c2e4ea3d0f3 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -495,11 +495,10 @@ BoundBox *BKE_curve_boundbox_get(Object *ob)
   /* This is Object-level data access,
    * DO NOT touch to Mesh's bb, would be totally thread-unsafe. */
   if (ob->runtime.bb == NULL || ob->runtime.bb->flag & BOUNDBOX_DIRTY) {
-    Curve *cu = ob->data;
     float min[3], max[3];
 
     INIT_MINMAX(min, max);
-    BKE_curve_minmax(cu, true, min, max);
+    BKE_displist_minmax(&ob->runtime.curve_cache->disp, min, max);
 
     if (ob->runtime.bb == NULL) {
       ob->runtime.bb = MEM_mallocN(sizeof(*ob->runtime.bb), __func__);
This is a quick fix, put here for future reference, but it still has problems with memory leaks. A proper solution involves getting the bounding box properly evaluated in the depsgraph, which can also speed up other situations. ``` Author: Sybren A. Stüvel <sybren@blender.org> Date: Thu Sep 16 16:00:48 2021 +0200 Fix T91102: Bounding Box computations can differ Unify the bounding box implementation of `BKE_curve_boundbox_get()` by copying the approach of `boundbox_displist_object()`. Both functions are writing to `ob->runtime.bb`, but used different ways to compute the bounding box. This meant that when a curve would come from edit mode, it would have a different bounding box than when undoing a previous action (which triggers a different evaluation path to avoid values being overwritten by the evaluation of animation data). diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index f22c3b13efc..c2e4ea3d0f3 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -495,11 +495,10 @@ BoundBox *BKE_curve_boundbox_get(Object *ob) /* This is Object-level data access, * DO NOT touch to Mesh's bb, would be totally thread-unsafe. */ if (ob->runtime.bb == NULL || ob->runtime.bb->flag & BOUNDBOX_DIRTY) { - Curve *cu = ob->data; float min[3], max[3]; INIT_MINMAX(min, max); - BKE_curve_minmax(cu, true, min, max); + BKE_displist_minmax(&ob->runtime.curve_cache->disp, min, max); if (ob->runtime.bb == NULL) { ob->runtime.bb = MEM_mallocN(sizeof(*ob->runtime.bb), __func__); ```
Philipp Oeser removed the
Interest
Animation & Rigging
label 2023-02-09 14:35:32 +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#91102
No description provided.