Commit graph

197 commits

Author SHA1 Message Date
Yann Lanthony
e2155ba962 [core][io] store nodes position in graph file
* increment file minor version (no incompatibility)
* nodeFactory: reload file position if available
2018-07-26 18:01:11 +02:00
Yann Lanthony
dfb0934ef4 [core] add node position property
Nodes can now be placed at a certain position
* add Position namedtuple
* expose 'position', 'x' and 'y' properties on BaseNode
2018-07-26 18:01:10 +02:00
Yann Lanthony
5843c36435 [core][io] add io version 'Features' mechanism
* centralize available features based on file version in 'IO' class
* add IO.Features enum
2018-07-26 18:01:10 +02:00
Yann Lanthony
ec08de812e [core][io] move file keys to an inner 'Keys' class 2018-07-26 17:45:03 +02:00
Yann Lanthony
93dd055f72 [clean] fix variable names and typos
* node_factory & attribute_factory to camelCase
* fix depths variable in updateNodesTopologicalData
2018-07-26 12:11:43 +02:00
Yann Lanthony
dd3d9cd54b [core][ui] add upgradeAllNodes methods
+ check if node is upgradable in UpgradeNodeCommand
2018-07-20 17:55:30 +02:00
Yann Lanthony
8679fd8bf7 [core] maintain a model with CompatibilityNodes on topology change 2018-07-20 17:52:30 +02:00
Yann Lanthony
3417f58335 [graph] add GraphModification inside upgradeNode method 2018-07-20 15:35:55 +02:00
Yann Lanthony
f5820b3eb1 [graph] expose fileReleaseVersion as property
+ clear header in Graph.clear method
2018-07-20 15:30:27 +02:00
Yann Lanthony
ae716602ab [core] update nodes topological data after nodes status update
evaluate nodes computability requires up-to-date status
2018-07-19 16:08:00 +02:00
Yann Lanthony
30cd8001fd [core][graph] update nodes computability on topology change
CompatibilityNodes introduce a new notion of computability per node.
An uncomputed (and therefore uncomputable) CompatibilityNode blocks the computation of all its successor.

* update nodes computability on topology change (in addition to min/max depth)
* evaluate leaves computability to determine if the whole graph can be processed
2018-07-19 13:50:45 +02:00
Yann Lanthony
89dd55f43b [core] dfsToProcess: stop branch visit when discovering a computed node 2018-07-19 13:50:45 +02:00
Yann Lanthony
ab4e82aa88 [core] add GraphVisitMessage exceptions mecanism
allow to stop branch or graph visit by throwing specific exceptions in visitor callbacks
2018-07-19 13:50:45 +02:00
Yann Lanthony
2952e11691 [core] move duplicateNode methods to core.graph
handle this low-level operation engine side

* fix ListAttribute children links duplication
* handle CompatibilityNode duplication
* move corresponding unit test in test_graph.py
* [ui] add DuplicateNodeCommand
2018-07-19 13:50:45 +02:00
Yann Lanthony
33eb7f3a7f [core] introduce CompatibilityNode for improved scene compatibilities
Improve node serialization/deserialization to be able to recreate the exact same node in the graph when loading a meshroom project, even if the corresponding node's description has changed or does not exist anymore. This allows to recover already computed data on disk, without being impacted by changed uids. CompatibilityNode also provides an on-demand upgrade system to turn into a Node that meets the current node description (if possible).
 
* new abstract class BaseNode, base class for Node and CompatibiliyNode 
* Node: serialize everything needed to spawn a CompatibilityNode with precomputed outputs: inputs, uids, parallelization settings, unresolved internal folders and outputs
* node_factory: handles node deserialization and compatibility issues to create either a Node or a CompatibilityNode
* add compatibility unit tests
2018-07-19 13:50:45 +02:00
Yann Lanthony
a9e61108ab [core][io] save header with versions metadata in graph file
* save a header with versions metadata:
   * meshroom release 
   * file format
   * node types used in the graph
* save the graph in a dedicated "graph" category
* multiview: store pipeline version in graph header
2018-07-19 13:50:45 +02:00
Yann Lanthony
5d14189206 [graph] convert cache directory to unix-style filepath in cacheDir setter 2018-07-19 13:50:45 +02:00
Yann Lanthony
1f675a0e42 [core] split graph.py into separate modules
core.graph is now splitted into: 
  * graph.py
  * node.py
  * attribute.py
2018-06-26 12:19:14 +02:00
Yann Lanthony
3ad2146e06 [core] remove links when clearing ListAttribute 2018-06-18 14:58:37 +02:00
Yann Lanthony
4d8a177ae3 [core] ListAttribute: don't call 'validateValue' on links
Links (Attribute reference or link expression) should not go through value confirmity checker
2018-06-18 14:58:36 +02:00
Yann Lanthony
168866aed0 [core] rename 'graph.isLink' to 'graph.isLinkExpression'
avoid confusion with Attribute.isLink method
2018-06-18 14:58:36 +02:00
Yann Lanthony
99d6068250 [graph] make ListAttribute connectable at root level
ListAttribute can now be connected :
 * at root level to another ListAttribute (new)
 * at child level to basic Attributes
2018-06-18 14:58:35 +02:00
Yann Lanthony
2cd724f957 [graph] ListAttribute: replace '__getitem__ by 'at'
__getitem__ is spuriously called when the object is used inside a Qt model and exposed to QML, leading to unexpected behaviors
2018-06-18 14:43:18 +02:00
Fabien Castan
d83022714f [core] add pyCompatibility module
For python 2 / 3 compatibility
2018-05-21 17:12:22 +02:00
Fabien Castan
fb549ff3df [python] use items instead of iteritems for python2/3 compatibility 2018-05-21 16:13:43 +02:00
Yann Lanthony
0adc4d8cc6 [core] add low-level retro-compatibility for attribute changes
First version of retrocompatibility, allowing to load files referencing removed or type-incompatible attributes.
* add node_factory to centralize node instantiation
* discard invalid attributes (i.e. not part of the node description anymore or with incompatible value type) when loading a file
* raise on unknown nodes
* add 'core.exception' module to declare Meshroom's exception types
2018-04-13 22:10:13 +02:00
Yann Lanthony
f401ca7c8b [core] fix and use 'validateValue' for ListAttribute and GroupAttribute 2018-04-13 21:51:13 +02:00
Yann Lanthony
8ed0d0a7a2 [graph] add 'asLinkExpr' method 2018-03-21 15:53:34 +01:00
Yann Lanthony
995c18961b [graph] init chunks upon node creation 2018-03-21 15:53:34 +01:00
Yann Lanthony
39abaf657a [graph] add 'isLink' helper method
evaluates if the given value matches the link expression pattern
2018-02-12 17:58:47 +01:00
Yann Lanthony
9aca41be27 [graph] fix command line invalidation for "no-uid" attributes
mark node dirty even if no uid is impacted by the attribute change, since updateInternals must be called to update the command line.
2018-02-08 19:11:47 +01:00
Yann Lanthony
25992286d0 [ui] add partial graph submission up to a certain node 2018-02-07 14:35:50 +01:00
Yann Lanthony
2b76266fe7 [graph] GroupAttribute: emit valueChanged when children values change
make sure 'isDefault' property is re-evaluated when a child value changes
2018-02-05 18:22:56 +01:00
Yann Lanthony
75f33bdba0 [graph] add Attribute.defaultValue() method 2018-02-05 18:21:25 +01:00
Yann Lanthony
c1e9675fee [graph] expose Attribute.isDefault as a property 2018-02-05 15:10:36 +01:00
Yann Lanthony
1f223ccc54 [graph] limit scope of graph update to outdated nodes
Don't update every nodes in the graph on each modification. Instead, use dfs visit to find nodes impacted by a change (of value or of topology) and limit the update to those nodes.
2018-01-26 13:02:31 +01:00
Yann Lanthony
b67fae013b [graph] check if node belongs to a graph in Attribute.isLink property 2018-01-26 12:47:09 +01:00
Yann Lanthony
273cfd9f0e [ui] handle multiple CameraInit nodes in a Reconstruction
* [ui] ImageGallery: add control to navigate image groups
* [graph] expose Node.attribute as a Slot
2018-01-15 14:33:27 +01:00
Yann Lanthony
1f0ed1f2c9 [graph] add minDepth property on nodes 2018-01-12 13:59:09 +01:00
Yann Lanthony
530af4d905 [graph] sort nodes by index when loading graph file 2018-01-12 13:59:09 +01:00
Yann Lanthony
1bc6168814 [graph] add helper methods to get nodes by type and sort them by name 2018-01-12 13:59:08 +01:00
Fabien Castan
7561b1e8c7
Merge pull request #82 from alicevision/dev_perf_graph
Improve graph performance
2018-01-08 21:51:48 +01:00
Yann Lanthony
516f909db4 [graph] add nodesFromNode method based on reverse dfs visit
Get the whole node chain from a start node to the graph leaves following graph edges
2018-01-08 13:08:55 +01:00
Yann Lanthony
924dbc8d32 [graph] improve formatting + remove redundant parentheses 2018-01-05 19:20:57 +01:00
Yann Lanthony
2d30a65252 [graph] improve Visitor class docstring 2018-01-05 19:19:38 +01:00
Yann Lanthony
614ef3a5d1 [graph] improve Node constructor arguments naming 2018-01-05 19:18:40 +01:00
Yann Lanthony
c3eda1e629 [graph] allow reverse dfs visit
# Default direction: from start node to root
# Reverse direction: from start node to leaves
2018-01-05 19:01:28 +01:00
Yann Lanthony
b3ab554bc9 [graph] compute and store nodes depths on graph topology change 2018-01-05 19:01:27 +01:00
Fabien Castan
8e1452d5bc [core] add quotes on strings
to deal with space characters on command line
2018-01-05 16:59:31 +01:00
Fabien Castan
76ec5a1913
Merge pull request #78 from alicevision/dev_ui_nodelogs
Add NodeLog Component that displays logs/statistics/status files of a Node
2018-01-03 21:19:41 +01:00