Skip to main content

Figma

Smart Importer can import Figma data. This page explains how to import Figma data with Smart Importer and how to work with the results. 

You cannot import Figma data for which you do not have editing privileges.


Preparations for Importing Figma Data

Preparing the URL and Access Token

Before you import Figma data with Smart Importer, acquire the URL and access token for the Figma data. 

Obtain the URL and access token in the Figma desktopDesktop applicationasApp as follows.

Ensure that you have access to the Figma REST API (https://api.figma.com). In case of a connectivity issue, contact your IT department because thea APIfirewall might beblock blockedthe by a firewall.API.

Acquiring the URL

In the top bar of the Figma desktopDesktop application,App, right-click the relevant project tab, and then select Copy Link from the context menu. 

drawing-7-1740621465.png
Acquiring the Access Token
  1. In the Figma desktopDesktop app,App, select Figma Icon > Help and Account > Account Settings to open the dialog.
    drawing-7-1740621587.png

  2. In the Security tab of the dialog, click Generate new token under Personal access tokens.
    drawing-7-1740621955.png

  3. In the Generate new token dialog, set the Token name, Expiration, and Scopes, and then click Generate token.
    drawing-7-1768380041.png

  4. Figma displays the created access token under Personal access tokens on the Security tab of the dialog.
    drawing-7-1740622348.png

The instructions on how to obtain the URL and access token are for Figma Desktop App version 125.10.8.


How to Import Figma Data

  1. From the Scene Composer toolbar, select Import > Smart Importer > From Cloud Resource...
    • Scene Composer displays a new dialog titled Import from cloud resource. 
    drawing-7-1729497030.png
  2.  Enter the URL and access token in the respective fields and click OK. For information about acquiring the URL and access token, see Preparing the URL and Access Token.
    drawing-7-1729496909.png
  3. The Smart Importer dialog opens. The procedure for using Smart Importer is the same as for other file types.
  4. Adjust the necessary settings, and then click OK.
    • Smart Importer imports the data into the folder that you specified in Import to folder.
      drawing-7-1729497265.png

      If theyou entered an incorrect or invalid URL or access token entered in the Import from cloud resource dialog is incorrect or invalid,dialog, Smart Importer interrupts the import, and displays the following error dialog.

      drawing-7-1784179561.png

API access limits vary depending on your subscription plan. If that limit is exceeded, Smart Importer interrupts the import and displays the following error dialog. For Detailsdetails on each plan, see Figma’s official website.

drawing-7-1784179587.png

Importing Figma Data - Advanced

Importing as a scene

Smart Importer imports the topmost item of each page in the Figma data as a scene. Use the following naming convention to import a top-level item as a scene: <Page name>_<Parent item name>

drawing-7-1729498578.png

Relationship between Figma items and Scene Composer Nodes 

When you import Figma items with Smart Importer, Smart Importer imports each item as a specific type of node, as shown in the following table.


Scene Composer node type
Group Bitmap Text
Figma item type
Component ✓

ComponentSet ✓

Ellipse
✓
Frame ✓

Group ✓

Instance ✓

Line
✓
Polygon
✓
Rectangle
✓
Section ✓

Slice
✓
Star
✓
Text

✓
Vector
✓

Smart Importer imports bitmap and text items only when Figma provides their render data. For example, if you set a Figma item to hidden, Smart Importer cannot import it.

Importing as Controls or Bitmaps

Smart Importer can import any Figma item as a control or bitmap. The imported item can contain the following child items:

  • Component
  • ComponentSet
  • Frame
  • Group
  • Instance
  • Section
Importing as a control

Smart Importer imports an item as a control when the name is SC_<control name>. You can also specify control property values by naming child items after the corresponding control properties. If a child item name matches a control property name in Scene Composer, Smart Importer can automatically map the bitmap from the Figma file to that property.

For example, Scene Composer's CheckBox control provides multiple image properties. When a Figma file contains an item named SC_CheckBox with child items whose names match these properties, Smart Importer automatically assigns the corresponding bitmaps to the correct control properties (see the image below). This way, no manual assignment of image properties is necessary in Smart Importer.

drawing-7-1729499805.png

This functionality is supported only for Touchable and Common controls.

Importing as bitmaps

Smart Importer can import group items that contain child items as bitmaps when you prefix the group item name is prefixed with SC_Bmp.

drawing-7-1729501904.png

Import as State Machine

When you define Figma flow functionality (screen transitions) is defined,, Smart Importer imports the structure of screen transitions into Scene Composer as a state machine.  
TheYou can review the imported state machine can be reviewed in the State Machine Editor in Scene Composer.

Figma Settings: Scenes and Flows

In Figma, define multiple scenes and the flows that connect them. Create screen transitions beginning with the scene designated as the flow start point.

drawing-7-1776928546.png
Import Result on thein Scene Composer Side

Smart Importer imports the flow structure defined in Figma into CGI Studio as a state machine.

drawing-7-1776928764.png

The state machine starts from the state that corresponds to the scene that you set as the flow start point in Figma. After importing, for each generated state, Smart Importer automatically creates a screenshot of the corresponding Figma scene. Scene Composer's State Machine Editor displays this screenshot as a Scene Image.

drawing-7-1776929717.png

If a Figma file contains multiple flows, Smart Importer imports each flow is imported as an independent state machine.

drawing-7-1729503521.png
drawing-7-1729503495.png

If a transition in one flow is included in a separate flow (that is, when a transition is duplicated), Smart Importer does not import the separate flow. 

Names and Behavior After Importing as a State Machine
  • About Names After Import
    • The name of the state machine after import is StateMachine<Flow Name>.
    • TheAfter name ofimport, each state after import ishas the same name as the Figma item name that wasSmart importedImporter imports as a scene.
  • In Figma, you can select the interaction that triggers screen transitions, such as click, drag, or mouse over. 
    Regardless of the interaction defined in Figma, Smart Importer sets Scene Composer's Transition properties as follows:
    • Event: `Clicked`
    • Condition: `Check Click`

Importing a Layout

Auto layout

If you set Auto layout on a Figma Frame, Smart Importer imports the frame as a Stack Layout in Scene Composer and applies each Auto layout setting as a Stack Layout property.

drawing-7-1740634409.png

Smart Importer applies Figma Auto layout settings are inherited as properties of Scene Composer's Stack Layout:

drawing-7-1729578499.png

Auto layout

(Figma)

Stack Layout Properties

(Scene Composer)

1



Direction

Stack Layout

Layouter > Arrangement

Direction Arrangement
Vertical layout Vertical
Horizontal layout Horizontal
Wrap
2

Gap

TheEach node thatafter isthe placedfirst second or laternode in the Stack Layout
Layout > Margin > Left or Top

Direction Margin
Vertical layout Top
Horizontal layout Left
Wrap
3 Alignment

Nodes included in a Stack Layout

Layout > VerticalAlignment and HorizontalAlignment

4 Padding (Horizontal)

The node to be placed at the leftmost position of the Stack Layout
Layout > Margin > Left

5 Padding (Vertical)

The topmost node in the Stack Layout
Layout > Margin > Top

The following example shows how Scene Composer's Stack Layout inherits Figma's horizontal Auto layout settings.

drawing-7-1730094273.png
Text Layout

When Smart Importer imports a Figma text layer is imported into Scene Composer, it creates a Group node with LayoutType Overlay is created,, and additionally a text node is createdTextNode under it.that group. 

drawing-5-1732891835.png

Also, the layout property of Scene Composer's TextNode2D inherits the Typography Alignment of Figma's text layer.

drawing-5-1732891908.png

Importing Fonts

When importing Figma data with Smart Importer, you can import any fonts that are used in the Figma design but are not available in the current Scene Composer solution.

During import, Smart Importer compares the fonts used in the Figma design with the fonts available in the solution. If it detects a missing font, Smart Importer opens the Smart Importer dialog and displays font-selection options.

In the Smart Importer dialog, select one of the following options for each missing font:

  • Replace it with an existing font (select an existing font from the dropdown menu)
  • Import the font as a new resource (select Import from the dropdown menu)
drawing-7-1780564485.png
If you selectedselect Import, Smart Importer adds the corresponding font to the solution and storedstores it in folderthe Resources\Fonts. folder.
If you select an existing font, Smart Importer applies that font to the imported data.

In the Smart Importer dialog, the Import option is displayed in the dropdown menu for each font only when the corresponding font can be imported.

If the Resources\Fonts folder does not exist in the solution, Smart Importer automatically creates it.


Automatic Text Mapping

WhenDuring importingthe import of Figma datadata, usingSmart Importer can compare the Smart Importer, theTextNode content of text nodes can be compared with the Language Table duringand import,automatically andassign matching Text IDs can be automatically assigned.IDs. Previously, ityou was necessaryhad to manually assign a Text ID to each text nodeTextNode after import. This feature enables automation of the mapping process.

WhenSmart importingImporter Figma data,compares the displayed text strings containedStrings in the Figma data are compared with the masterMaster languageLanguage stringsStrings in the Language Table. If it finds a matching stringString, isit found,automatically assigns the corresponding Text ID for that string is automatically assigned.String.

Configuration
In the Smart Importer dialog, under the Import Settings tab, you can enable or disable this feature using the Map language table to texts option. The default setting is enabled.
drawing-7-1780564599.png
Behavior

This feature works in the following order: retrieve the text → compare it with the Language Table → assign the Text ID.

  1. Smart Importer retrieves the text String from the text node
    In the following example, it retrieves the String "TEST".
    drawing-7-1781072528.png

  2. Smart Importer compares the retrieved String with the master language in the Language Table

    In the following example, it compares the String retrieved in step 1 with the master language [00] in the Language Table.

    drawing-7-1780564721.png

  3. If Smart Importer finds a match, it assigns the Text ID
    In the example below, it assigns the Text ID of the matching Language Table entry to the text node
    drawing-7-1780564930.png

If multiple Text IDs exist for the same text String, Smart Importer uses the first matching Text ID is used.ID.

If there is no matching text String, noSmart Importer does not assign a Text ID is assigned.ID.