how do I detect an input field has changed in ui panel ?
I tried this but the function does not trigger
def changeActiveBoneName():
print("Active bone name changed")
class SomeRegisteredClass:
boneName: StringProperty(
name="boneName",
description="Bone name",
update=changeActiveBoneName()
)
def changeActiveBoneName(self, context):
print("Active bone name changed")
print(f"The value is now {self.boneName}")
class SomeRegisteredClass:
boneName: StringProperty(
name="boneName",
description="Bone name",
update=changeActiveBoneName
)
Current setup will call update function once you enter the text and press enter to confirm the change.
What you have is correct but you have made couple of syntax errors. update = changeActiveBoneName instead of update = changeActiveBoneName()
and def changeActiveBoneName(self,context): instead of def changeActiveBoneName():
If you want to call update function as you write/change the text field you need to define options and set it to TEXTEDIT_UPDATE in your property like this,