mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-19 01:27:31 +02:00
[core] Attribute: change isLink check for _applyExpr()
This commit is contained in:
parent
95471e3e1b
commit
ee7c0d0fd5
1 changed files with 3 additions and 3 deletions
|
@ -49,7 +49,7 @@ else:
|
||||||
bytes = str
|
bytes = str
|
||||||
basestring = basestring
|
basestring = basestring
|
||||||
|
|
||||||
stringIsLinkRe = re.compile('^\{.+\}$')
|
stringIsLinkRe = re.compile('^\{[A-Za-z]+[A-Za-z0-9_.]*\}$')
|
||||||
|
|
||||||
def isCollection(v):
|
def isCollection(v):
|
||||||
return isinstance(v, collections.Iterable) and not isinstance(v, basestring)
|
return isinstance(v, collections.Iterable) and not isinstance(v, basestring)
|
||||||
|
@ -63,7 +63,7 @@ def GraphModification(graph):
|
||||||
"""
|
"""
|
||||||
if not isinstance(graph, Graph):
|
if not isinstance(graph, Graph):
|
||||||
raise ValueError("GraphModification expects a Graph instance")
|
raise ValueError("GraphModification expects a Graph instance")
|
||||||
# Store update policy
|
# Store update policy for nested usage
|
||||||
enabled = graph.updateEnabled
|
enabled = graph.updateEnabled
|
||||||
# Disable graph update for nested block
|
# Disable graph update for nested block
|
||||||
# (does nothing if already disabled)
|
# (does nothing if already disabled)
|
||||||
|
@ -210,7 +210,7 @@ class Attribute(BaseObject):
|
||||||
g = self.node.graph
|
g = self.node.graph
|
||||||
g.addEdge(v, self)
|
g.addEdge(v, self)
|
||||||
self._value = ""
|
self._value = ""
|
||||||
elif isinstance(v, basestring) and len(v) > 2 and v[0] == '{' and v[-1] == '}':
|
elif self.isInput and isinstance(v, basestring) and stringIsLinkRe.match(v):
|
||||||
# value is a link to another attribute
|
# value is a link to another attribute
|
||||||
g = self.node.graph
|
g = self.node.graph
|
||||||
link = v[1:-1]
|
link = v[1:-1]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue