Skip to main content
Calin_Stefanescu
Feb 22, 2024 5:15 AM UTC
Solved

Cannot assign variable that is resolved as FLOAT to text node via API

I have a list of variables that I want to apply to text nodes. These variables are numbers. I want to do it via API because there are a lot of them. The problem is that when I try to bind these variables using the “node.setBoundVariable” function, the resolved type for the variable is “FLOAT” and not “STRING”, which is correct, but this prompts the error : “in setBoundVariable: variable of resolved type ‘FLOAT’ cannot be bound to this field”. I undestand that the text node was expecting a string but I can bind the number variable to text manually in the software and I even have a scoping section for “text” when opening the options for the number variable.

This topic has been closed for replies.
djv
djvSolution
Community Support
Feb 23, 2024 5:39 PM UTC

Hey @Calin_Stefanescu, thanks for reaching out!

This is actually an intentional product limitation. The UI supports binding number variables to text content, because we can have a stringify expression behind the scenes. But since expressions can’t be used for binding in general, the plugin API doesn’t expose expressions, only direct aliases.

1 reply

djv
Figmate
djvSolution
Community Support
Feb 23, 2024 5:39 PM UTC

Hey @Calin_Stefanescu, thanks for reaching out!

This is actually an intentional product limitation. The UI supports binding number variables to text content, because we can have a stringify expression behind the scenes. But since expressions can’t be used for binding in general, the plugin API doesn’t expose expressions, only direct aliases.