Skip to main content
Question

setBoundVariableForEffect

  • December 19, 2024
  • 2 replies
  • 12 views

Pecherin_Maxim

Hi! Let’s get straight to the point.

I have an element in a design where an effect (e.g., box-shadow) is used, and the effect involves several variables: color, blur, spread… I’m trying to unbind the variable that sets the radius, as described in the documentation on this page: https://www.figma.com/plugin-docs/working-with-variables/#example-binding-a-variable-to-a-node-or-style

const effectsCopy = clone(node.effects);
effectsCopy[0] = figma.variables.setBoundVariableForEffect(effectsCopy[0], 'radius', null);
node.effects = effectsCopy;

However, I’m encountering an issue where not only the radius variable is unbound but all variables used for this effect are completely unbound.

Is this a bug, or am I doing something wrong?

2 replies

tank666
  • 4854 replies
  • December 19, 2024

Related topic: setBoundVariableForEffect Bug.


Pecherin_Maxim

The object returned by the function is no longer valid, as all the used variables have been removed from it, and I cannot use it.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings