Commit graph

97 commits

Author SHA1 Message Date
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
Candice Bentéjac
1993fc49c8
Merge pull request #2094 from alicevision/dev/bracketsForGroupAttribute
[core] Add brackets option for GroupAttribute
2023-07-04 17:31:52 +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
Grégoire De Lillo
b8be831310 [core] desc: Execute command-line in node folder 2023-06-30 17:26:36 +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
6381371e7d Display the invalidation and comment messages in the internal attributes' 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.
2023-02-15 08:36:16 +00:00
Candice Bentéjac
3bc9445615 [core] Internal attributes: move "invalidation" before "comment" 2023-02-15 08:36:15 +00:00
Candice Bentéjac
835e396d8d [core] Remove reference to pyCompatibility
pyCompatibility has been removed at the same time as Python 2 support.
2023-02-15 08:36:15 +00:00
Fabien Castan
cc3c19ba15 [core] internal attributes: update descriptions and declare "invalidation" as an advanced attribute 2023-02-15 08:36:12 +00:00
Candice Bentéjac
21d01acc9a Add "color" as an internal attribute
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.
2023-02-15 08:36:11 +00: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
9bc9e2c129 Add "Notes" tab with "comment"/"invalid comment" attributes
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.
2023-02-15 08:36:10 +00:00
Fabien Servant @ TCS
06d7d96fa2
rename variable for python compliance 2022-12-08 09:33:06 +01:00
fabien servant
7e4c5db9d2 [node] move cgroup parameters to class attributes 2022-12-07 18:05:12 +01:00
fabien servant
93b98afedc [node] move cgroup properties reading in the constructor 2022-12-07 17:53:48 +01:00
mh0g
41e8643834 removed pyCompatibility 2022-12-06 16:21:21 +01:00
fabien servant
ae0ca71c1c [nodes] replace CommandLineNode with AVCommandLineNode for alicevision nodes 2022-12-06 15:07:01 +01:00
Fabien Servant
788bd7738b [core] add cgroups checks 2022-12-06 15:07:01 +01:00
Candice Bentéjac
8bef398bed Remove workarounds and backports for Python 2 support
In particular:
- In common/, remove the backport of weakref.WeakMethod
- In docs/ and ui/, use the standard FileNotFoundError class
- Use built-in open() instead of io.open(), and stop importing io
- In core/stats.py, use the standard implementation of xml.etree instead
of the C one
2022-12-05 17:16:21 +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
Loïc Vital
630c6e06ec [core] non-exclusive choice param: handle string value by splitting around commas 2022-11-03 11:14:53 +01:00
Candice Bentéjac
1275975c6a [core] Check that ranges of a node's attributes are valid before loading it
For IntParam and FloatParam, which may have ranges, check before loading
the node that the non-null ranges are of the same type as the attribute.
If at least a range is not correct (e.g. "(0, 10, 0.1)" for a FloatParam,
for which "(0.0, 10.0, 0.1)" is expected), then the node is rejected (in
the same manner as when a default value is deemed invalid).
2022-09-28 10:47:00 +02:00
Candice Bentéjac
545f3a7218 [core] Check that the description of a node is correct before loading it
At Meshroom's launch, check that every node we attempt to load has a
valid description, i.e. that every parameter has a default value that
matches its parameter's type.

If there is at least one parameter with an incorrect default value,
the node is not loaded and a corresponding message will be displayed.

This prevents the user from loading erroneous nodes that may lead to
unexpected behaviours (such as a change of a node's UID between the
moment when it is written and the moment it is loaded).
2022-09-28 10:39:18 +02:00
Candice Bentéjac
659c8a05ed Add abstract InitNode
InitNode is an abstract class which is meant to be inherited
by all the initialization nodes (such as CameraInit), included
those that might be created by the user.

InitNode contains methods that can be reimplemented by the
children classes if necessary.

This abstract class allows to keep on using scripts such as
meshroom_batch without having to modify them specifically or
being limited to using a CameraInit node.
2022-08-05 10:42:59 +02:00
Candice Bentéjac
708eb85c9c Evaluate variables in nodes' string parameters 2022-07-12 09:31:37 +02:00
Fabien Castan
a62c951bf5 [core] more generic str to bool conversion 2022-04-11 16:56:38 +02:00
Grégoire De Lillo
0aa173c982 Merge branch 'develop' of https://github.com/alicevision/meshroom into dev_depthMapOptim
Conflicts:
	meshroom/core/desc.py
	meshroom/nodes/aliceVision/CameraInit.py
	meshroom/nodes/aliceVision/ImageMasking.py
2021-09-29 19:34:10 +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
dc3f4dd2be [nodes] add semantic to customize attibute UI 2021-07-19 12:03:00 +02:00
Fabien Castan
b000c6f311 [core] no cmd line range arguments if we have only a single chunk 2021-05-25 18:22:08 +02:00
Fabien Castan
8214f0a0e8 Merge remote-tracking branch 'origin/develop' into dev_depthMapOptim 2021-02-15 23:18:53 +01:00
ChemicalXandco
3d33134ca9 [ui] add support for node categories 2021-02-14 16:12:39 +00:00
Fabien Castan
f92a835b2f Merge remote-tracking branch 'origin/develop' into dev_depthMapOptim 2021-01-13 12:45:31 +01:00
Julien-Haudegond
887b33490e [core] avoid direct includes to PySide2 2020-08-13 14:24:44 +02:00
Julien-Haudegond
06372bc89e [core] fix elif after raise 2020-08-13 14:24:44 +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
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
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
0e606eef4e [ui] Add the notion of Node Documentation 2020-03-26 10:54:00 +01:00
Fabien Castan
8c36acfe9d Merge branch 'develop' of https://github.com/alicevision/meshroom into dev_depthMapOptim 2020-03-20 09:14:51 +01:00
Grégoire De Lillo
1f7663259a [core] compatibility : List of groups update is more flexible 2020-02-17 10:19:28 +01:00
Fabien Castan
82e5a6a63f Merge branch 'develop' of github.com:alicevision/meshroom into dev_depthMapOptim
Conflicts:
	meshroom/nodes/aliceVision/StructureFromMotion.py
2020-02-12 12:12:33 +01:00
Fabien Castan
7f84097c24 [core] Option to make chunks optional 2020-02-05 12:35:59 +01:00
Fabien Castan
5569b8551e Merge branch 'develop' of github.com:alicevision/meshroom into dev_depthMapOptim 2020-01-21 22:05:55 +01:00
Yann Lanthony
0b4d2c8927
[core] desc.Node: allow usage of DynamicNodeSize on output attributes
Also consider IntParam value as node size.
2019-12-13 19:26:53 +01:00
Yann Lanthony
a0ba44fbff
[core] desc.Node: add update/postUpdate hooks
Enable node descriptions to react before/after the invalidation of a node instance.
2019-12-13 19:26:42 +01:00
Guillaume Buisson
63d0cc3b83 [nodes] add semantic to customize attibute UI 2019-11-20 09:50:40 +01:00
Guillaume Buisson
064d76de3d [attribute] refactor attribute/desc to customize command line arguments formatting 2019-11-20 09:50:40 +01:00