Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Backdrop Node for Meshroom graph #2574

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Draft

Conversation

waaake
Copy link
Contributor

@waaake waaake commented Oct 21, 2024

TCSR-1194

Feature Request

  • Added Backdrop Node
  • Notion of Region inside a Graph

Minor Fix

  • Added Key Press of Backspace to allow deletion in the graph.

@waaake waaake added the feature request feature request from the community label Oct 21, 2024
@waaake waaake self-assigned this Oct 21, 2024
@fabiencastan fabiencastan added majorFeature and removed feature request feature request from the community labels Oct 22, 2024
@cbentejac cbentejac added this to the Meshroom 2024.1.0 milestone Oct 23, 2024
Comment on lines 802 to 859
class Backdrop(InputNode):
""" A Backdrop for other nodes.
"""

# The internal inputs' of Backdrop Node needs a Integer Field to determine the font size for the comment
internalInputs = [
StringParam(
name="invalidation",
label="Invalidation Message",
description="A message that will invalidate the node's output folder.\n"
"This is useful for development, we can invalidate the output of the node when we modify the code.\n"
"It is displayed in bold font in the invalidation/comment messages tooltip.",
value="",
semantic="multiline",
advanced=True,
uidIgnoreValue="", # If the invalidation string is empty, it does not participate to the node's UID
),
StringParam(
name="comment",
label="Comments",
description="User comments describing this specific node instance.\n"
"It is displayed in regular font in the invalidation/comment messages tooltip.",
value="",
semantic="multiline",
invalidate=False,
),
IntParam(
name="fontSize",
label="Font Size",
description="The Font size for the User Comment on the Backdrop.",
value=12,
range=(6, 100, 1),
),
FloatParam(
name="nodeWidth",
label="Node Width",
description="The Backdrop Node's Width.",
value=600,
range=None,
enabled=False # Hidden always
),
FloatParam(
name="nodeHeight",
label="Node Height",
description="The Backdrop Node's Height.",
value=400,
range=None,
enabled=False # Hidden always
),
ColorParam(
name="color",
label="Color",
description="Custom color for the node (SVG name or hexadecimal code).",
value="",
invalidate=False,
)
]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we totally overwrite the internal inputs instead of using the ones from the parent class and adding "Font Size" to it?

With the current way, there's a lot of duplication and the "Node's Label" internal attribute is lost, which I think is a shame since we may want to name the backdrop itself, and not just use the "Comments" attribute. This would prevent having several backdrops named "Backdrop", "Backdrop2", "Backdrop3", and so on... if we want to name them. Similarly, the "Invalidation Message" is currently preserved although it has no impact anywhere so far.

@@ -135,7 +139,7 @@ Item {
Keys.onPressed: {
if (event.key === Qt.Key_F) {
fit()
} else if (event.key === Qt.Key_Delete) {
} else if (event.key === Qt.Key_Delete || event.key === Qt.Key_Backspace) { // Backspace supports both Windows and MacOS Keyboards
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to this, but when a backdrop contains nodes, is there no way to remove the background only and not the background AND everything it contains? (that's a real question, not necessarily a change request)

@waaake waaake marked this pull request as draft November 26, 2024 11:28
The core Node is now able to distinguish a backdrop node which
The region denotes an area which can be instantiated/represented by two points, the top-left and the bottom right and allows for detection of points or other regions which fall under it. This could be used to understand when a node is a part of a backdrop.
A Backdrop node is default of pale yellow colour and is of the same colour in the header and the bottom area representing the node. Backdrop node allows user resize by dragging on the mouse area at the edges and also allows text appearing below the header from the notes section in the attribute panel.
In standard MacOS keyboards the backspace key is referred to as the delete key. Supporting both backspace and delete keys for delete operation in the graph ensures consistency across the different key layouts across devices.
Updating Selection behaviour for Backdrop based Nodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants