-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add internal attributes in "Notes" tab #1744
Conversation
9f49363
to
457c826
Compare
457c826
to
365c76f
Compare
4d3ed5c
to
1387090
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to deal with node upgrade of internal attributes.
40e6783
to
32eacc3
Compare
Done |
8022140
to
3aecc8d
Compare
|
9644f9f
to
5cee129
Compare
f517502
to
218b267
Compare
On windows via the gui:
Also tested with meshroom batch Note: would it be possible to include the custom name (if any), in the status file created by each of the node? |
Does not break backward compatibility on projects from current develop . |
752bb11
to
bdb5097
Compare
c74e3d0
to
9657771
Compare
Add two internal attributes, "Comment" and "Invalid comment", in a specific "Notes" tab, which will contain any further internal attribute. Internal attributes exist for all nodes.
Setting the "label" internal attribute allows to give a custom label to replace the node's default label.
Setting this attribute allows the user to change the color of a node, either by directly providing an SVG color name or an hexadecimal color code, or by picking a color with the selector.
…tion" as an advanced attribute
If the "Comments" internal attribute is filled, add a corresponding icon in the node's header, as well as a tooltip that contains the comment.
"hasAttribute" was previously never called before attempting to access an attribute. With the addition of internal attributes, we want to check the attribute's/internal attribute's before accessing it to avoid KeyError exceptions. "hasAttribute" (and the newly added "hasInternalAttribute") would not parse the attribute's name before checking for its existence, meaning that errors could be generated for list or group attributes as their checked name could contain other elements (e.g. "featuresFolder[0]" for a ListAttribute named "featuresFolder").
…nly default values Non-default internal attributes need to be written in the templates, but the "internalInputs" entry in the dictionary should not be written at all if all the internal attributes are set to their default values.
If some internal attributes are saved in the templates, their description should be checked just like the input attributes to ensure there are no conflicts.
pyCompatibility has been removed at the same time as Python 2 support.
The "label", "color" and "comment" properties are not constant anymore, their changes in value are notified with the internalAttributesChanged() signal, like the "invalidation" property. This implies that the connection on "internalAttributesChanged" on the QML side is not needed anymore.
…tes' tooltip The tooltip now displays both the invalidation message, followed by the comments. The invalidation message is displayed first in bold font, followed by an empty line and the comments in regular font. The tooltip now appears if at least one of the invalidation or comment messages exists. The invalidation and comment messages are formatted with HTML tags prior to their display. The descriptions of both attributes is also updated to indicate which one is displayed in bold or regular font.
d601e4a
to
6d9eec5
Compare
By default, an attribute that belongs to the UID group 0 is taken into the node's UID computation independently from its value, as long as it is enabled. When such an attribute is added to a node's list of attributes, it automatically invalidates all computations made for this node prior to its addition. This commits adds a new attribute property, "uidIgnoreValue". This property determines whether the attribute must be taken into consideration during the node's UID computation: if the value of the attribute is the same as "uidIgnoreValue", then it should be ignored; otherwise, it should be taken into account. By default, "uidIgnoreValue" is set to "None", meaning that any attribute that may be considered during the UID computation will be taken into account. In the context of the internal attributes, "uidIgnoreValue" is set to empty string, so the "invalidation" attribute will not automatically invalidate 100% of the nodes from existing graphs until its value is set to a non-empty string.
6d9eec5
to
311ab9c
Compare
hasInternalAttribute() should not support more cases than internalAttribute()
Description
This PR adds support for internal attributes, which are attributes that exist for all nodes independently from their type.
Internal attributes are displayed in the "Notes" tab of the graph editor (also added in this PR) and can be set for each node individually and independently.
Four internal attributes are added with this PR: comments/invalid comments (to write some comments regarding a node), label (to rename a node), and color (to change a node's color).
Regarding the "comments" internal attribute, an icon is added to the node's header if a comment has been set, and hovering over that icon displays a tooltip containing the comment.
Internal attributes will be written to the template files if and only if they have non-default values (so they need to have been set). If no internal attribute has a non-default value, the "internalInputs" entry is not even written in the template file. The unit test checking on version/description conflicts in templates is updated accordingly.
A new property,
uidIgnoreValue
, is added to the generic Attribute object. Its goal is to leave an attribute out of the node's UID computation if its value is set to the value it specifies. By default, it is set toNone
and any attribute that is considered for the UID computation will be taken into account. In the case of the internal attributes,uidIgnoreValue=""
for the "invalidation" attribute: this prevents from invalidating all the existing graphs simply because this attribute has been added; instead, nodes will be invalidated because of that specific attribute if and only if its value is set to a non-empty string (when the invalidation is actually wanted).Features list
uidIgnoreValue
, which allows to ignore an attribute during the node's UID computation depending on its valueImplementation remarks
uidIgnoreValue
is set toNone
by default for all types of attributes. It also is only exposed in the constructor of theStringParam
attributes.