Hi,
Whenever one of the fills that are being assigned is a "PATTERN" it throws an error.
Assignment of an existing pattern fill:
figma.currentPage.selection[0].fills = [{
"type": "PATTERN",
"visible": true,
"opacity": 1,
"blendMode": "NORMAL",
"sourceNodeId": "1:2",
"tileType": "RECTANGULAR",
"scalingFactor": 1,
"spacing": {
"x": 0,
"y": 0
},
"horizontalAlignment": "START",
"verticalAlignment": "START"
}]
The error:
Uncaught Error: in set_fills: Property "fills" failed validation: Invalid discriminator value. Expected 'SOLID' | 'GRADIENT_LINEAR' | 'GRADIENT_RADIAL' | 'GRADIENT_ANGULAR' | 'GRADIENT_DIAMOND' | 'IMAGE' | 'VIDEO' at [0].type at RectangleNode.set_fills [as fills] (7607-39a655741d0aff8…min.js.br:910:62574) at <anonymous>:1:38
set_fills@7607-39a655741d0aff8b.min.js.br:910(anonymous)@VM249:1