Geometry Nodes: Float Curve input limits are not working unless "reset view" is used #106139

Closed
opened 2023-03-25 20:27:17 +01:00 by Serge Lyatin · 4 comments

System Information
Operating system: win10
Graphics card: 1050ti

Blender Version
Broken: 3.5.0

Short description of error
Max Y parameter is set to 2 and control point's actual Y value is also 2, view area is default. But output value is still 1.
This is broken only in GN, same node from shader editor is working fine.

Exact steps for others to reproduce the error
In attached file:

  • Activate Reset View in GN Float Curve's settings to see correct value in Viewer node (it is already pinned in spreadsheet)
  • If zoomed in on the GN Float Curve, the spreadsheet value will be clamped to the maximum value of the viewable range of the curve widget.
**System Information** Operating system: win10 Graphics card: 1050ti **Blender Version** Broken: 3.5.0 **Short description of error** Max Y parameter is set to 2 and control point's actual Y value is also 2, view area is default. But output value is still 1. This is broken only in GN, same node from shader editor is working fine. **Exact steps for others to reproduce the error** In attached file: * Activate **Reset View** in GN *Float Curve*'s settings to see correct value in Viewer node (it is already pinned in spreadsheet) * If zoomed in on the GN *Float Curve*, the spreadsheet value will be clamped to the maximum value of the viewable range of the curve widget.
Serge Lyatin added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-03-25 20:27:18 +01:00

The last time I looked at the limits, I found out that this node has no value limits. This is a parameter of curve editor, that is, by doing from 0 to 2x in Y, you simply change the scale of the curve display.
But now, playing with your example, I see the strangest thing that has ever happened: try clicking on different control points of the curve, it changes the result.

The last time I looked at the limits, I found out that this node has no value limits. This is a parameter of curve editor, that is, by doing from 0 to 2x in Y, you simply change the scale of the curve display. But now, playing with your example, I see the strangest thing that has ever happened: try clicking on different control points of the curve, it changes the result.
Iliya Katushenock added the
Interest
Geometry Nodes
Interest
Nodes & Physics
labels 2023-03-25 22:11:03 +01:00
No description provided.
Member

After fiddling around I found that the value will always be clamped to the viewing range maximum Y value, reproducible by zooming in/out and moving the curve viewing range.

This could be the cause:

source/blender/blenkernel/intern/colortools.c, line 973

float BKE_curvemapping_evaluateF(const CurveMapping *cumap, int cur, float value)
{
  const CurveMap *cuma = cumap->cm + cur;
  float val = BKE_curvemap_evaluateF(cumap, cuma, value);

  /* account for clipping */
  if (cumap->flag & CUMA_DO_CLIP) {
    if (val < cumap->curr.ymin) {       <------------ Should be `clipr.ymin`, similarly below.
      val = cumap->curr.ymin;
    }
    else if (val > cumap->curr.ymax) {
      val = cumap->curr.ymax;
    }
  }

  return val;
}

After commenting out those lines, the problem disappears. Further inspection seem to indicate that we need to use clipr instead of curr, since curr is basically representing the viewing range, it should not change evaluation result.

图片
图片

After fiddling around I found that the value will always be clamped to the viewing range maximum Y value, reproducible by zooming in/out and moving the curve viewing range. This could be the cause: source/blender/blenkernel/intern/colortools.c, line 973 ```Cpp float BKE_curvemapping_evaluateF(const CurveMapping *cumap, int cur, float value) { const CurveMap *cuma = cumap->cm + cur; float val = BKE_curvemap_evaluateF(cumap, cuma, value); /* account for clipping */ if (cumap->flag & CUMA_DO_CLIP) { if (val < cumap->curr.ymin) { <------------ Should be `clipr.ymin`, similarly below. val = cumap->curr.ymin; } else if (val > cumap->curr.ymax) { val = cumap->curr.ymax; } } return val; } ``` After commenting out those lines, the problem disappears. Further inspection seem to indicate that we need to use `clipr` instead of `curr`, since `curr` is basically representing the viewing range, it should not change evaluation result. ![图片](/attachments/a977dbba-3fef-464a-8f7f-77706674a192) ![图片](/attachments/5e7f0f67-9cd3-4f5b-834b-630effc9dba2)
Member

Can confirm.

Can confirm.
Iliya Katushenock added
Module
User Interface
and removed
Module
Nodes & Physics
labels 2023-05-02 15:48:49 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-07-21 03:26:37 +02: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#106139
No description provided.