I have a simple extension that defines one dependable integer foo
I want to have a bit of logic before you can set it’s value. So I have something like this:
@getter
def Foo(self):
return self._foo
@Foo.setter
def Foo(self, val):
if val > 5:
print("value is too big!")
self._foo.val = 5
else:
self._foo.val = val
This works as expected if I type something like this in the textport:
op('/project1/base1').Foo = 10
>>> value is too big!
op('/project1/base1').Foo
>>> tdu.Dependency... value 5 (don't remember exact output :)
But if I have a custom parameter bound to that dependable value, then when I set it to, say, 8 it gets set to 8 in both custom parameter and on the extension. I would expect maybe ui goes to 8 for a split second but then immediately bounces back to 5