Tarmac fork can sync image assets locally

When I’m working on a project, I don’t like to have to publish images just for prototypes, since I often end up throwing all the initial images away later. Also, I like being able to build a place directly from Rojo and start working locally. This way, someone can just pull the code from the project repository, run a script and start working.

Unfortunately, that workflow did not worked well when the project needed image assets… until now!

Wait, what's a tarmac?

If you don’t know about tarmac, it’s a tool that can automatically publish image files and generate a bunch of Lua files that returns the asset ID. For example, if you had a file named game-logo.png, tarmac is able to publish the image and generate a Lua file (that’s called syncing) that looks like this:

-- This file was @generated by Tarmac. It is not intended for manual editing.
return "rbxassetid://123456789"

With those files, you can require them in your code and apply them where you need. This is really useful if you’re working with Roact or if you’re generating UI with code in general.


I’ve forked tarmac and added a new way to sync the image assets locally (by copying the images into the content directory of Roblox Studio installation).

If you have cargo, you can install it with this command:

cargo install --git https://github.com/jeparlefrancais/tarmac.git --branch main

Now, to sync your assets locally:

tarmac sync --target local

It will generate Lua asset files that look like this:

-- This file was @generated by Tarmac. It is not intended for manual editing.
return "rbxasset://.tarmac/project-name/image-asset-name.png"

The cool thing is that, once you’re satisfied with the current images you have, you can still use tarmac to publish them to Roblox without having to change any code. Tarmac will just generate new files and replace the asset ID.

If you are interested, source code is over here: https://github.com/jeparlefrancais/tarmac/tree/local-sync

One other feature I’ll probably add is to be able to sync audio files locally. Let me know if you think that would be useful :slight_smile:

7 Likes

This addition is awesome! I made a fork awhile back that alpha bled regular images in tarmac. Before, tarmac only alpha bled packed images. Would you be interested in me making a PR with this addition and also adding it to these local images?

3 Likes

Yes that would be a great improvement too!

That would be brilliant - I’d be happy to help out where possible. Tarmac and assoc. are super useful toolings for me and my workflow!

1 Like

I just published a release with my changes and Nezuo’s contribution. For those using foreman you can depend on it just like that:

tarmac = { source = "jeparlefrancais/tarmac", version = "0.7.1" }
2 Likes

Hey!

I get the error Your platform is not currently supported when attempting to sync locally - I am using WSL2. Would it be possible to fix this?

Hi :grin:

Yeah I can look into that, would you mind filing an issue on github with any other detail you might have? A screenshot of the command you run with the verbosity flag (-vvvv) could help too