GIFs not available in the API

Uploaded a video where it can be seen the differences (or not) between GIF, IMAGE and SOLID fills type.

I would have expected that the layer called giphy 1 to be an GIF fill type.

While this could be a decision from Figma team, when you try to copy the fills from a node to another, the GIF is lost.

This can be easily reproduced by dropping a GIF in Figma, and trying to use the fills of this node to a new or existing node.

This is important to be fixed, because there is no way to restrict or alert the user about this use case.

Since the user will rely on the plugin to perform a certain action, this may pass as a working action and to find out after hours you used the command that it didn’t do what you expected.

1 Like

Can you show the code that pastes fills?

It may be a bit overwhelming to show the code of the entire flow for that command, since is split in modules and the function that run the specific command is built to work for multiple use cases.

But, here is a very simplified version where you can see that the use of fills from a node to another node is not working as expected.

// To reproduce:
// 1. create a layer and add a GIF as property
// 2. select this layer and run command in console to save a source
var source = figma.currentPage.selection[0];

// 3. select a new layer, preferable a rectangle or a frame, and run the following script in console:
var node = figma.currentPage.selection[0];

node.fills = source.fills;

Attached a file only with the module where I set the new fills:

I would like to know if you have any idea of how to filter this type of nodes/fills, even if it is out of context. :grin:

@Gleb

Did you manage to reproduce it? :grin:

No, I haven’t tried. Hopefully your code would help the Figma team figure it out.

Also I don’t understand the filtering question. Do you want to filter out nodes with GIFs? You will need to fetch image data and check it somehow to do that.

Any updates on this, please? :pray:

It is really annoying to not be able to use plugins to adjust the properties of GIFs faster.

I’m unable to use Styler to create, update GIFs styles or Automater to change the media fit behavior to Fill or Fit. :disappointed:

This may also be useful:

I noticed that this is not only an UI bug, since after a while the node modified by plugin API is not behaving as a GIF in the prototype either…

1 Like