Maniphest T72904

When changing the width of frame, it also changes frame location.
Confirmed, NormalTO DO

Assigned To
None
Authored By
Kalle-Samuli Riihikoski (haikalle)
Jan 4 2020, 10:24 PM
Tags
  • BF Blender
  • Nodes & Physics
Subscribers
Brecht Van Lommel (brecht)
Campbell Barton (campbellbarton)
Jacques Lucke (JacquesLucke)
Kalle-Samuli Riihikoski (haikalle)
Philipp Oeser (lichtwerk)
Ray Mairlot (madog)

Description

If you create frame and set it into (0,0) location. Then grab right side of the frame node and make frames width bigger. Now using python read the frame
location again and it is not (0,0) anymore.

Related Objects

Mentioned In
D6540: Remove node->offsetx/offsety [WIP]
Mentioned Here
T66307: Nodes & Physics Module
rB53b01d90023a: A number of new features for the node editor in general and the Frame node in…

Event Timeline

Kalle-Samuli Riihikoski (haikalle) created this task.Jan 4 2020, 10:24 PM
Kalle-Samuli Riihikoski (haikalle) renamed this task from Frame location with python has issues. to When changing the width of frame, it also changes frame location..Jan 5 2020, 1:19 PM
Kalle-Samuli Riihikoski (haikalle) updated the task description.
Kalle-Samuli Riihikoski (haikalle) added a comment.EditedJan 6 2020, 2:04 AM

I found out that if I delete this part from node_edit.c line 983

if (node->type == NODE_FRAME) {
        /* keep the offset symmetric around center point */
        if (nsw->directions & NODE_RESIZE_LEFT) {
          node->locx = nsw->oldlocx + 0.5f * dx;
          node->offsetx = nsw->oldoffsetx + 0.5f * dx;
        }
        if (nsw->directions & NODE_RESIZE_RIGHT) {
          node->locx = nsw->oldlocx + 0.5f * dx;
          node->offsetx = nsw->oldoffsetx - 0.5f * dx;
        }
        if (nsw->directions & NODE_RESIZE_TOP) {
          node->locy = nsw->oldlocy + 0.5f * dy;
          node->offsety = nsw->oldoffsety + 0.5f * dy;
        }
        if (nsw->directions & NODE_RESIZE_BOTTOM) {
          node->locy = nsw->oldlocy + 0.5f * dy;
          node->offsety = nsw->oldoffsety - 0.5f * dy;
        }
      }

deleting this part of code gives better result when you read frame location . It still dosen't give correct values thou. It would be nice know why this code part is there because in my tests frame node works without this code part just okey.

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Needs Information from Developers.Jan 6 2020, 12:17 PM
Philipp Oeser (lichtwerk) added projects: Nodes, Add-ons (BF-Blender).
Philipp Oeser (lichtwerk) added subscribers: Jacques Lucke (JacquesLucke), Brecht Van Lommel (brecht), Philipp Oeser (lichtwerk).

Yeah, this is a bit strange (since - from the python visible side - you can run into 2 frames having the exact same width, height & location, nevertheless they dont appear at the same spot).

This is caused by the node also having an offset [used in C, transform/drawing code etc], but this is not exposed to python, so no access there...

The offset was implemented in rB53b01d90023a.
In theory, I think frame nodes could even live without this (and only rely on location, width & height), but this would require a bit of refactor.

So maybe a solution is to just expose this offset to python?

However, this doesnt really look like a bug, it is more of an improvement to a [incomplete/annoying] implementation.
For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests
For more information on why this might not be considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug

Hesitating to close though, this might be added as TODO to T66307: Nodes & Physics Module, will let @Jacques Lucke (JacquesLucke) or @Brecht Van Lommel (brecht) decide...

Kalle-Samuli Riihikoski (haikalle) added a comment.EditedJan 6 2020, 12:33 PM

This would be import for me because I coding NodeCustomBuilder addon where nodetree is transferred into json file. I have had some difficult times to save frames exact location (including nodes that are inside of the frame) locations. I would be willing to work with issues if get some guidance what would be the best fix for this annoying issue.

In theory, I think frame nodes could even live without this (and only rely on location, width & height), but this would require a bit of refactor.

This for me sounds the most logical way but I really don't everything what going on under the hood.

Jacques Lucke (JacquesLucke) mentioned this in D6540: Remove node->offsetx/offsety [WIP].Jan 7 2020, 2:03 PM
Campbell Barton (campbellbarton) changed the subtype of this task from "Report" to "To Do".Jan 14 2020, 10:26 AM
Campbell Barton (campbellbarton) added a subscriber: Campbell Barton (campbellbarton).

Setting as TODO since this works as intended.

Campbell Barton (campbellbarton) changed the task status from Needs Information from Developers to Confirmed.Jan 14 2020, 10:26 AM
Campbell Barton (campbellbarton) edited projects, added Python API; removed Add-ons (BF-Blender).Jun 19 2020, 9:34 AM
Campbell Barton (campbellbarton) removed a project: Python API.Jun 19 2020, 9:56 AM
Campbell Barton (campbellbarton) moved this task from Backlog to Bugs (API) on the Python API board.Jun 19 2020, 10:02 AM
Campbell Barton (campbellbarton) added a project: Python API.
Campbell Barton (campbellbarton) moved this task from Bugs (API) to Long-Term on the Python API board.Jun 19 2020, 11:03 AM
Campbell Barton (campbellbarton) removed a project: Python API.
Hans Goudey (HooglyBoogly) edited projects, added Nodes & Physics; removed Nodes.May 16 2022, 11:13 AM
Ray Mairlot (madog) added a subscriber: Ray Mairlot (madog).Aug 26 2022, 7:41 PM