Commit graph

56 commits

Author SHA1 Message Date
Fabien Castan
d9b4b26a69
Merge pull request #2382 from alicevision/dev/pushButtonAttribute
[core/ui] Add support for PushButton attribute
2024-05-17 20:11:40 +02:00
Aurore LAFAURIE
862c5506a9 [core] Remove of saving PushButton behavior 2024-05-15 17:15:46 +02:00
Aurore LAFAURIE
55c657dc1d [core/ui] Modifiable label and description of node available 2024-04-25 17:03:33 +02:00
Aurore LAFAURIE
bb8b544550 [core] PushButton Description Conflict handled for function descripted 2024-04-25 17:01:54 +02:00
Aurore LAFAURIE
eb1a0faf97 [core] PushButton attribute implemented
Add PushButtonParam class and implement onAttributeClicked method
2024-04-24 15:29:08 +02:00
Aurore LAFAURIE
8e55257c59 [core] BugFix : Dynamic Param with onAttributeChanged behavior should not be applied if CompatibilityNode
If it is a CompatibilityNode, we should only get the value of the attribute to create fully all the attributes instead of throwing an error.
2024-04-23 12:42:36 +02:00
Aurore LAFAURIE
1b55dc8649 [ui] Attribute becomes grey in graph editor and attribute editor when connected but disabled
If attribute is disabled but has output connections, it becomes grey.
If the connection is removed while being disabled, it hides itself.

Both is working in GraphEditor on the nodes and in the AttributeEditor.
2024-04-19 17:16:20 +02:00
Aurore LAFAURIE
eda320374b [core] Bypass validation on values for ChoiceParams 2024-04-08 12:05:05 +02:00
Aurore LAFAURIE
498fd6cbd2 [core] Add new type of ChoiceParam that changes dynamically according to other values
Add new type of ChoiceParam that changes dynamically according to other
values.

When value of an attribute is changed onAttributeChanged is called,
allowing to have unique reaction within node files.

Also add of callDesc function to be able to have other functions such as
onNodeCreated at creation of node.
2024-03-28 12:06:40 +01:00
Fabien Castan
c6d0933d4f [core] Value need to be exposed without quotes to allow to compose simple expressions
For instance, on the Meshing node "outputMesh" param expression is:
value="{cache}/{nodeType}/{uid0}/mesh.{outputMeshFileTypeValue}",

So the extension here should not contains quotes.
2024-02-02 20:14:15 +01:00
Fabien Castan
a35f1c72e2 [core] Update formatting with quotes for List and Group
If the joinChar is NOT space, we use global quotes.
If the joinChar is space, we use quotes per element.
2024-02-02 15:16:58 +01:00
demoulinv
a7fc167512 [core] String formatting of parameters with/without quotes to deal with spaces in strings
We have the problem of spaces in file paths, choices (like colorspace),
etc.
An empty list is not send to the command line.
An empty string is send to the command line as "".
Add new unit test to ensure it follows the expected rules.
2024-02-01 18:28:51 +01:00
Abdelrahman AL MAROUK
b5093ac3a0 [ui] improve atts filtering and add search bar ...
...for node attributes and 3D inspector

- add search bar for node attributes
- add search bar for 3D inspector
- improve attributes filtering by adding more flexibility
and fixing some issues
2023-08-30 16:21:11 +02:00
Candice Bentéjac
e6bf7e6e2d [core] Add validValue and errorMessage support for ChoiceParams
ChoiceParams can now also have their `validValue` and `errorMessage`
parameters.

The `validValueChanged` is also emitted whenever a parameter's value
changes. This ensures that the `validValue` parameter is always re-
evaluated when the attribute is updated, even if `validValue` itself does
not change.
2023-08-22 11:22:11 +02:00
Candice Bentéjac
63bd6d61cd [core] Add new desc parameters to flag attributes with erroneous values
This commit adds two new description parameters:

- `validValue`, which is true if the value of the attribute is not
erroneous (i.e. valid for the type of the attribute but invalid in the
context of that specific attribute) and false otherwise. This holds a
different significance than the "validateValue" method, which only checks
if the parameter's value is expected with respect to the attribute's type.
For example, we could want an IntParam that flags any value that is not
even: an odd integer value would successfully go through the
"validateValue" method, but would then be flagged as an invalid value
at the attribute's level.

- `errorMessage`, an attribute-specific string that contains a message
explaining why the attribute's `validValue` parameter might be set to
false.

By default, all the attributes' values are valid, and they have no error
message.
2023-08-21 16:30:11 +02:00
Grégoire De Lillo
5a62157cdd [core] desc/attribute: Add brackets option for GroupAttribute
Add brackets option for GroupAttribute command line value.
Brackets is a two chars string. The GroupAttribute command line value is encapsulated between the two chars. (e.g. '[]')
2023-06-30 17:33:09 +02:00
Candice Bentéjac
311ab9cb40 [core] Add a property to ignore an attribute during the UID computation
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.
2023-02-17 15:34:39 +01:00
Candice Bentéjac
330382ab0c Add "label" as an internal attribute
Setting the "label" internal attribute allows to give a custom
label to replace the node's default label.
2023-02-15 08:36:10 +00:00
Candice Bentéjac
909f38ccb8 [core] Check a graph exists before accessing its name
If the graph does not exist, return "UNDEFINED" as its name.
2023-02-03 17:43:31 +01:00
Candice Bentéjac
635f85e7fd Remove all references to pyCompatibility
- "pyCompatibility.basestring" are replaced by standard Python3 "str"
- "Sequence" and "Iterable" from "collections" are now directly imported
with "collections.abc"
2022-12-05 17:16:21 +01:00
Candice Bentéjac
1f800aefd5 Compare attribute's resolved link with default value
If an attribute is a link, when checking whether its value is
the default value, only the resolved value should be compared
with the default one. Otherwise, the attribute's "isDefault"
property will always evaluate to True, even when a non-default
link has been provided.

This issue was especially evident with input File attributes,
for which the default value is generally '' (empty string); if a
link was set as a value (thus non-empty), its unresolved value
would still be '', thus setting the "isDefault" property to True.
2022-09-01 14:13:49 +02:00
Fabien Castan
b291a9ed07
Merge pull request #1727 from alicevision/dev/externalPipelines
Use project files to define pipelines
2022-07-26 15:06:16 +02:00
Candice Bentéjac
f2a904ac9b Fix compatibility with Python 3
- Import "collections" correctly depending on the version of
Python
- Fix regex that raised deprecation warnings in Python 3
2022-07-19 14:52:18 +02:00
Candice Bentéjac
708eb85c9c Evaluate variables in nodes' string parameters 2022-07-12 09:31:37 +02:00
Fabien Castan
af4dae9a77 Merge branch 'dev/ImageGalleryFilter' of https://github.com/N0Ls/meshroom into N0Ls-dev/ImageGalleryFilter 2021-09-01 11:03:55 +02:00
Landrodie
79955ddae6 [core] Change attribute name and label properties
Adding new properties and updating the call to previous ones.
Properties are now :
* label : getLabel
* fullLabel : getFullLabel
* fullLabelToNode : getFullLabelToNode
* fullLabelToGraph : getFullLabelToGraph

Same for the name.
2021-08-23 17:52:40 +02:00
Fabien Castan
1704e8935d [core] fix upgrade for linked ListAttribute 2021-08-19 10:09:43 +02:00
Fabien Castan
5ab6ed8e52 [core] Improve project files upgrade
- upgrade groups with changes in params
- new upgradeAttributeValues per node
2021-08-13 16:07:14 +02:00
Fabien Castan
078120696a [ui] GraphEditor: fix some readOnly regarding CompatibilityNodes 2021-01-22 14:30:33 +01:00
Fabien Castan
5fb6a5fb0f [ui] GraphEditor: only connect compatible attributes 2020-12-28 16:18:51 +01:00
Fabien Castan
ecf10a65f7 [ui] GraphEditor: visualize edges between params (non File attributes) 2020-12-18 01:13:54 +01:00
Julien-Haudegond
635f36216b [core] Attribute.isLink: fix unreachable return 2020-09-05 13:05:20 +02:00
Julien-Haudegond
74fa3022fe [core] Graph: avoid double update while adding/removing an edge
Graph.markNodesDirty() is called in three different places:
- Attribute.requestGraphUpdate()
- Graph.addEdge()
- Graph.removeEdge()

However, addEdge() and removeEdge() are especially decorated to request a graph update so, with the old markNodesDirty() implementation, the update was done twice in a row.
2020-08-27 17:16:40 +02:00
Julien-Haudegond
79e1c69d5d Merge remote-tracking branch 'origin/develop' into dev/nodesAndTaskManager 2020-08-24 15:19:31 +02:00
Julien-Haudegond
688027a69f [ui] MediaLibrary: fix dependency binding 2020-08-21 17:25:18 +02:00
Julien-Haudegond
0c9dc81a82 [core] fix validateValue and setValue for Attributes 2020-08-13 14:24:44 +02:00
Julien-Haudegond
cd89a49156 [core] GroupAttribute: add new ways of setting value
- Add: set value with JS Object
- Add: set value from a JSON String
2020-08-13 14:24:44 +02:00
Fabien Castan
588c2e59b8
[core] GroupAttribute: check "enabled" property of child params in uid computation
Disabled params should not be part of the UID computation, even for child attributes of an enabled GroupAttribute.
2020-08-11 11:50:59 +02:00
Fabien Castan
bab908d2eb Merge branch 'develop' into dev/nodesAndTaskManager 2020-07-30 10:56:19 +02:00
Julien-Haudegond
9e6c137ea2 [core] fix enabled issue when version mismatch 2020-07-29 17:02:16 +02:00
Julien-Haudegond
524a4ab629 [core] fix enabled parameter inside group and list 2020-07-29 11:32:52 +02:00
Julien-Haudegond
2d953d7319 [core] add enabled property on attributes
The new property "enabled" allows to define a lambda to dynamically enable/disable parameters.
Disabled parameters are not used in the uid, not exported to the command line and not visible in the interface.
2020-07-24 17:36:17 +02:00
Fabien Castan
c02267b4ce [core] avoid error during project load 2020-07-18 14:43:55 +02:00
Karthikeyan Singaravelan
165ba412e4
Import ABC from collections.abc (#983)
Use compatibility layer for Python 2 support
2020-07-16 16:02:51 +02:00
Fabien Castan
2401a366e2 [core] expose a recursive option in getLinkParam 2020-07-02 18:15:03 +02:00
Fabien Castan
7d99ba4b59 [core] copy attribute desc default value
to ensure that it is not editable if the value is a list
2020-07-01 01:54:16 +02:00
Fabien Castan
bbc56cfb31 [core] Add support for lambda function in Attribute desc value
Allows to dynamically configure the default value of the Attribute in python.
2020-06-28 17:39:50 +02:00
Fabien Castan
76fd327fde [ui] qml warning fix by using directly the edge object instead of the property 2020-03-10 12:57:38 +01:00
Yann Lanthony
fcb2b23c1a [core] add "Attribute.hasOutputConnections" property
Give access to whether an attribute has output connections.
2020-01-24 11:18:08 +01:00
Fabien Castan
f1267d7e67
[core] Attribute: avoid accessing member function of an invalid object 2019-11-29 11:34:15 +01:00