Search Unity

Feedback Figma Converter for Unity - Official Asset Thread

Discussion in 'Assets and Asset Store' started by da_assets, Jul 20, 2021.

  1. da_assets

    da_assets

    Joined:
    Jul 20, 2021
    Posts:
    4
    Available in the Asset Store.



    Hello everybody. My asset converts a layout from Figma to Unity in just a few clicks. At the moment, I have completed the main phase of work on the asset and am looking forward to the feedback to identify and fix its shortcomings.

    @figma_unity_converter
     
    Last edited: Jan 12, 2022
  2. CamilleFM

    CamilleFM

    Joined:
    Oct 5, 2021
    Posts:
    5
    Hi @da_assets - posting here because I don't use Telegram.

    Is it possible to use this tool programmatically, in a build?

    e.g. the use case - create a Unity build, which can automatically update (or via some trigger) to the latest Figma file? That way the design can be changed in Figma and then immediately shown in VR without rebuilding or requiring an Editor, for example.

    This would assume the auth token / API key lasts awhile, I'm hoping it's 90 days.
     
  3. CamilleFM

    CamilleFM

    Joined:
    Oct 5, 2021
    Posts:
    5
    As well, I am having trouble getting the sprites to appear in 1.0.8 - tried in both a 3D project as well as a 2D project. Can you please tell me what I'm doing wrong? The sprites do not exist anywhere in the Assets either.

    Figma:
    figma1.PNG

    Unity:
    figma2.PNG

    Thanks
     
  4. da_assets

    da_assets

    Joined:
    Jul 20, 2021
    Posts:
    4
    Hey! Thank you for purchasing my asset.
    I found the cause of this bug and will release an update soon (version 1.0.9).
     
  5. da_assets

    da_assets

    Joined:
    Jul 20, 2021
    Posts:
    4
    I'm didn't find information about Figma's api key expiration time in their documentation, but the idea is very interesting. Perhaps I will implement this in future updates.
     
    CamilleFM likes this.
  6. CamilleFM

    CamilleFM

    Joined:
    Oct 5, 2021
    Posts:
    5
    Thank you!
     
  7. CamilleFM

    CamilleFM

    Joined:
    Oct 5, 2021
    Posts:
    5
    Hi @da_assets, I actually got this working it was pretty quick - albeit could probably be more robust as it just makes use of the existing FigmaConverterUnity instance in the scene at runtime :)

    The only thing required is to run this code (at startup or button press or whatever), and this re-downloads the latest version - note that you'll have to create code to delete the old versions too:

    Code (CSharp):
    1.     [ContextMenu("Refresh")]
    2.     public void Refresh()
    3.     {
    4.         Converter.mainSettings.ApiKey = Token;
    5.         Converter.mainSettings.ProjectUrl = ProjectUrl;
    6.  
    7.         LoadTasks();
    8.     }
    9.  
    10.     private async Task LoadTasks()
    11.     {
    12.         //await Converter.AuthWithBrowser();
    13.         await Converter.DownloadProject();
    14.         Converter.GetFramesFromSelectedPage();
    15.         await Converter.DownloadSelectedFrames();
    16.         Converter.DrawDownloadedFrames();
    17.     }
    It didn't need to re-auth because I was just using the existing token that I had already pulled, it seems to last 3+ days so far. So that is one thing you might want to work on if you want it fully automated with re-authing too.

    I also modified FigmaConverterUnity so that "Selected = true" for all pages (so it downloads all pages automatically, otherwise it wouldn't download any).

    I still need to test it in a build and VR.

    Edit: actually the build needs more work - all the references to #if UNITY_EDITOR need to be removed and then we have the issue of all the AssetDatabase code which is editor side.
     
    Last edited: Jan 13, 2022
  8. CamilleFM

    CamilleFM

    Joined:
    Oct 5, 2021
    Posts:
    5
    Hi @da_assets thanks so much for quickly putting out that fix! 1.0.9 works a lot better!

    There is just one shape that didn't come through properly now, the rest work great! It seems to be the freeform shapes -here's a quick look:

    Figma (note the grey triangle):

    figma_1.PNG

    Unity: the bottom one comes in fine:
    unity_1.PNG

    Unity: Just the triangle is missing:
    unity_2.PNG
     
  9. da_assets

    da_assets

    Joined:
    Jul 20, 2021
    Posts:
    4


    Sorry for the long answer. How exactly did you create this triangle? Can you send a link to your layout?