Lesson 2 of 6

From Blender to Roblox: FBX, the Importer and MeshParts

Take a Blender mesh into a Roblox game. Export FBX at stud scale, read the 3D Importer's settings, avoid the centimetre import, and wire the asset id into Beacon Yard's templates.

Tool lesson, about 75 minutes, 11 steps

By the end you can

  • Export a mesh from Blender as FBX at the right scale and axes, and recognise the 100-times-too-big centimetre import
  • Choose the Importer settings that decide size, ownership, upload and rigging, and set collision on the MeshPart
  • Get an uploaded mesh into Beacon Yard through Ids.local.luau, scripts/gen-assets.mjs and an .rbxmx template

Before this: Blender basics for Roblox, part 2: model a prop the game can use

1Seven hops from .blend to the yard

Press Play in a fresh clone of Beacon Yard and the coins are glowing yellow balls. That is not a bug. The repo ships no uploaded meshes, because an uploaded mesh belongs to a Roblox account. Your coin reaches the yard in seven hops, and this lesson walks every one.

Blender
The Beacon Yard coin selected in Blender, a gold beveled disc with its origin in the middle and a triangle count of 608 in the statistics overlay.

Select a numbered pin, or a row below, to read what it marks.

Figure 1.1.

The start of the trip: one object, named Coin, origin in the middle, scale 1.

Put the hops in order, from Blender to the coin you see in Play.

  1. Copy the new mesh asset id
  2. Import the FBX in Studio with Upload to Roblox on
  3. Run node scripts/gen-assets.mjs
  4. Rebuild the place file with rojo build and reopen it
  5. Export Coin from Blender as FBX
  6. Put the id in src/shared/Ids.local.luau as COIN_MESH_ID
  7. Press Play: CoinService clones ReplicatedStorage.Assets.Coin
Answer

1. Export Coin from Blender as FBX 2. Import the FBX in Studio with Upload to Roblox on 3. Copy the new mesh asset id 4. Put the id in src/shared/Ids.local.luau as COIN_MESH_ID 5. Run node scripts/gen-assets.mjs 6. Rebuild the place file with rojo build and reopen it 7. Press Play: CoinService clones ReplicatedStorage.Assets.Coin. Export, import and upload, copy the id, store it in your git-ignored Ids file, generate the model from its template, rebuild so Studio sees it, then Play.

Open this step in lesson mode · Link to this step · This confused me

2Export FBX with the axes Roblox expects

FBX is the format Roblox's docs recommend for meshes because it carries everything the Importer understands: hierarchy, textures, rigs and animation1. In Blender, select only the mesh and choose File, Export, FBX. The settings that matter:

  • Limit to Selected Objects, so the camera and light stay out.
  • Forward Z Forward, Up Y Up, the pair Roblox's Blender guide gives for keeping Blender's forward and up axes2. Beacon Yard's own v1 templates were built with Blender's default pair, Forward -Z, instead (see the box in the next step).
  • Apply Scalings: FBX Unit Scale, which Roblox's Blender guide calls the recommended way to keep scale2.
  • Add Leaf Bones off and Bake Animation off for a prop with no rig1.
Blender
The options panel of Blender's Export FBX file window. Under Include, Limit to Selected Objects is ticked. Under Transform, Apply Scalings reads FBX Units Scale, Forward reads Z Forward and Up reads Y Up. Under Armature, Add Leaf Bones is unticked. The Animation section is collapsed with its box unticked, and the Export FBX and Cancel buttons sit along the bottom.

Select a numbered pin, or a row below, to read what it marks.

Figure 2.1.

Blender's Export FBX window with the four settings set, before pressing Export FBX.

Roblox also accepts glTF and OBJ. Its guide notes that glTF does not need the FBX scaling settings at all2.

Settings are part of the asset

The FBX is not just the mesh; it is the mesh plus the export choices. Two people exporting the same .blend with different settings produce two different files. Write the settings down once, or save them as an export preset, and use them every time.

Which export choices does a static prop like the coin need?

  1. Selected objects only
  2. Z Forward and Y Up
  3. Bake Animation on
  4. Apply Scalings set to FBX Unit Scale
  5. Add Leaf Bones on
Answer

Selected objects only; Z Forward and Y Up; Apply Scalings set to FBX Unit Scale. Export only the coin, with Z Forward and Y Up, and Apply Scalings set to FBX Unit Scale so it keeps its scale in Studio. Leaf bones and baked animation are for rigged, animated models.

Open this step in lesson mode · Link to this step · This confused me

3The coin that came in 100 times too big

When this course first imported its meshes, every one arrived enormous. The Blender files used 1 unit per stud and the export did not convert units, but Studio's Importer read the FBX file's unit as centimetres. Each MeshPart came in 100 times its intended size. Roblox's guide describes the same symptom: when you export FBX with Blender's default settings, models "often import at an unexpectedly large scale"2.

The guide lists three ways to fix it. The recommended one is to export with Transform, Apply Scalings: FBX Unit Scale and leave every other scale value at 1.0. The alternatives are an export Scale of 0.01, or Scene Properties, Units, Unit Scale of 0.01, which can cause camera and modifier trouble in Blender. glTF needs none of this2. Whichever you use, check that Scale Unit in File Geometry reads Studs and look at the preview size3. Applying transforms in Object Mode is good hygiene, but it is a different thing: it bakes the object's Scale into its vertices and does not change how the FBX file's unit is read.

The coin is 1.992 studs across. Imported as centimetres, how many studs across does it arrive?

Answer

199.2 studs (within 0.1). 1.992 times 100 is 199.2 studs, wider than the whole 96-stud yard. Spot it in the Importer preview before you upload.

Open this step in lesson mode · Link to this step · This confused me

4Read the Importer before you press Import

File, Import opens the 3D Importer with a preview and settings. Most defaults are right for a prop; these are the ones to read every time3:

  • Upload to Roblox is on by default and adds the asset to your inventory. Turn it off for a size check, or every try makes a new asset.
  • Creator decides who owns the asset: you, or the group that owns the game.
  • Add to Workspace inserts the model and, for a saved or published game, grants that game permission to use the asset.
  • Rig Type should be No Rig for a prop. Import as Package stays off for something you are still shaping.
  • World Forward and World Up under File Transform should read Front and Top, which keeps the model facing the way it faced in Blender2.
  • Scale Unit under File Geometry should read Stud.
Roblox Studio
Studio's 3D Importer with the coin in the preview, Upload to Roblox off, Add to Workspace on and Scale Unit reading Stud under File Geometry.

Select a numbered pin, or a row below, to read what it marks.

Figure 4.1.

Warnings appear in the hierarchy and settings panels; read them before importing.

Go deeper glTF arrives as a different tree

The Importer builds a different hierarchy for glTF than for FBX. An FBX mesh lands as a MeshPart directly inside the top Model; a glTF mesh lands as a Model inside the top Model, holding one MeshPart per primitive. If you switch formats, check the tree before you weld anything, or you will weld the wrapper and leave the mesh behind.

You only want to check whether your coin comes in at the right size. Which Importer setting should you turn off?

  1. Upload to Roblox
  2. Add to Workspace
  3. Set Pivot to Scene Origin
  4. Scale Unit
Answer

Upload to Roblox. With Upload off the model still lands in Workspace for a look, but no inventory asset is created. Turn Upload on for the import you mean to keep.

Open this step in lesson mode · Link to this step · This confused me

5What arrives: a MeshPart

A plain mesh imports as a MeshPart: a part whose shape is the mesh, with position, size, anchoring and collision like any other part4. Two properties decide what it costs. CollisionFidelity is how closely the invisible physics shape follows the mesh: Default, Hull, Box, PreciseConvexDecomposition or Tunable. RenderFidelity controls how much detail is drawn at a distance. Beacon Yard's coin template sets collision to Box and switches collision, touch and queries off, because the costume never plays the game:

<bool name="Anchored">false</bool>
<bool name="CanCollide">false</bool>
<bool name="CanQuery">false</bool>
<bool name="CanTouch">false</bool>
<bool name="Massless">true</bool>
<token name="CollisionFidelity">2</token>
<token name="RenderFidelity">2</token>
Figure 5.1

Both sidesRemember: A mesh on a gameplay part is a mascot costume over a player on the field.

Why is Box the right CollisionFidelity for the coin's visual?

  1. Nobody stands on it or walks through it, and its collision is off anyway, so the cheapest shape is enough
  2. Box makes the mesh render faster
  3. Box is required for uploaded meshes
  4. Box keeps the gold colour
Answer

Nobody stands on it or walks through it, and its collision is off anyway, so the cheapest shape is enough. Box is the cheapest physics shape. Precise shapes are for things players walk on or through, like an arch.

Open this step in lesson mode · Link to this step · This confused me

6Your id, the template and gen-assets

After an upload, you need the mesh asset id, not the model id. The Importer's Copy asset ID gives you the id of the Model that wraps the mesh3, and the MeshId on a MeshPart needs the mesh itself. Select the MeshPart inside the imported model in Workspace, find MeshId in Properties, and copy the numeric id (the digits at the end of the asset URL). That number belongs to your account, so it never goes in a committed file. Beacon Yard keeps every account number in src/shared/Ids.luau at 0, and you put yours in the git-ignored Ids.local.luau. Then one script builds the models:

// Builds the account-bound art from your ids. The repo ships no uploaded
// meshes or textures, only id-free templates. This script reads
// src/shared/Ids.luau and your git-ignored src/shared/Ids.local.luau, then:
//
//   assets/templates/<Model>.rbxmx  ->  assets/roblox/<Model>.rbxmx
//     Only when every mesh id the model needs is set. A texture map whose
//     id is 0 is left out, so the mesh keeps its plain colour.
//   MATERIALS below                 ->  assets/materials/<variant>.rbxmx
//     Only when the variant's colour map id is set.
//
// Both output folders are git-ignored. Rojo maps them to
// ReplicatedStorage.Assets and MaterialService. A model or variant whose
// ids are missing is deleted from the output, and the game falls back to
// plain parts and materials with an [Ids] warning.
Figure 6.1

Here is that script run twice in a clean checkout: once as cloned, and once with a placeholder coin id.

Evidence, figure 6.2gen-assets.log
# Run 1: every id is 0 (the repo as cloned)
skip  Beacon: set BEACON_MESH_ID, BEACON_EMITTER_MESH_ID
skip  Coin: set COIN_MESH_ID
skip  Drone: set DRONE_BODY_MESH_ID, DRONE_EYE_MESH_ID, DRONE_ROTOR_FL_MESH_ID, DRONE_ROTOR_FR_MESH_ID, DRONE_ROTOR_BL_MESH_ID, DRONE_ROTOR_BR_MESH_ID
skip  Wrench: set WRENCH_HANDLE_MESH_ID, WRENCH_JAW_MESH_ID
skip  beacon_yard_concrete: set CONCRETE_COLOR_MAP_ID
skip  beacon_yard_steel: set STEEL_COLOR_MAP_ID
skip  beacon_yard_asphalt: set ASPHALT_COLOR_MAP_ID
skip  beacon_yard_plate: set PLATE_COLOR_MAP_ID
skip  beacon_coin_gold: set COIN_GOLD_COLOR_MAP_ID
skip  YardSteelPlate: set STEEL_PLATE_COLOR_MAP_ID
gen-assets: 0 written, 10 skipped. Rebuild the place file so Studio picks them up.
exit 0
 
# Run 2: Ids.local.luau sets COIN_MESH_ID to a placeholder number (not a real asset)
skip  Beacon: set BEACON_MESH_ID, BEACON_EMITTER_MESH_ID
model Coin -> assets/roblox/Coin.rbxmx
skip  Drone: set DRONE_BODY_MESH_ID, DRONE_EYE_MESH_ID, DRONE_ROTOR_FL_MESH_ID, DRONE_ROTOR_FR_MESH_ID, DRONE_ROTOR_BL_MESH_ID, DRONE_ROTOR_BR_MESH_ID
skip  Wrench: set WRENCH_HANDLE_MESH_ID, WRENCH_JAW_MESH_ID
skip  beacon_yard_concrete: set CONCRETE_COLOR_MAP_ID
skip  beacon_yard_steel: set STEEL_COLOR_MAP_ID
skip  beacon_yard_asphalt: set ASPHALT_COLOR_MAP_ID
skip  beacon_yard_plate: set PLATE_COLOR_MAP_ID
skip  beacon_coin_gold: set COIN_GOLD_COLOR_MAP_ID
skip  YardSteelPlate: set STEEL_PLATE_COLOR_MAP_ID
gen-assets: 1 written, 9 skipped. Rebuild the place file so Studio picks them up.
exit 0
 
$ git status --short   (outputs are git-ignored)
(no output: nothing to commit)
Terminal
A PowerShell window after node scripts/gen-assets.mjs: one line writes model Coin to assets/roblox/Coin.rbxmx, seven lines skip models and materials whose ids are not set, and a summary reads 1 written, 7 skipped.

Select a numbered pin, or a row below, to read what it marks.

Figure 6.3.

gen-assets writes only the models whose ids are set.

Ids.local.luau sets COIN_MESH_ID but not DRONE_EYE_MESH_ID. After node scripts/gen-assets.mjs and a rebuild, what does Play show?

  1. Your coin mesh, and the drone as a plain stand-in with one [Ids] warning
  2. Your coin mesh and a drone with no eye
  3. No meshes at all, because one id is missing
  4. An error that stops the server
Answer

Your coin mesh, and the drone as a plain stand-in with one [Ids] warning. The Coin template needs only COIN_MESH_ID, so it is written. Drone needs six mesh ids; with one missing, gen-assets skips it and AssetModels warns once and uses the stand-in.

Open this step in lesson mode · Link to this step · This confused me

7Who may load it, and why the files are .rbxmx

Uploaded meshes are Restricted by default once you enable Asset Privacy (under Creator Dashboard, Settings, Advanced): only experiences you grant can load them. Without Asset Privacy enabled, newly uploaded meshes, images and decals default irreversibly to Open Use, which lets any experience load the id5. Enable Asset Privacy first, keep course art Restricted and grant your own experience. Add to Workspace does that grant for the saved or published game you import into. The place you build with rojo build is a different, local file, so that grant may not cover it. If the coin fails to load there, Output shows a clickable error: click it and allow the game, or grant the experience under the asset's permissions in Creator Dashboard. A game grant cannot be revoked later.

The generated models are XML .rbxmx, not binary .rbxm. When this course first saved its models, Rojo 7.5.1 refused the binary files: it expected MeshPart.Tags as one type and found another. XML loads cleanly, and it also diffs as text.

A friend clones Beacon Yard and puts your COIN_MESH_ID in their Ids.local.luau. Your mesh is Restricted to your experience. What do they see?

  1. Their place cannot load the mesh, so they need to upload their own
  2. Your mesh, because ids are public
  3. Your mesh, but only in Studio
  4. A copy of the mesh is made in their inventory
Answer

Their place cannot load the mesh, so they need to upload their own. Restricted means the permission is checked when the asset loads. That is why Beacon Yard asks every learner to upload their own art and keeps ids out of the repo.

Open this step in lesson mode · Link to this step · This confused me

8Where the costume picture breaks again

The costume rule says art never changes gameplay. One import setting quietly breaks that if you are not watching. Decide which before you open the breakdown.

Where does it break?“A mascot costume over a player on the field” is a good picture of a mesh on a gameplay part. Where does it stop being true?

It breaks here. A MeshPart is a full BasePart: turn its collision or touch back on and the costume starts playing the game, blocking players or firing Touched.

The true model. Any MeshPart can collide, be touched and carry scripts. Beacon Yard chooses to keep rules on plain parts and switches those properties off on every visual, so art changes cannot change gameplay.

You import the coin with Add to Workspace on and leave the new MeshPart in Workspace with its default collision. What can happen?

  1. Players bump into a solid coin-shaped part that no script owns
  2. The coin pays out twice
  3. The Importer deletes CoinService
  4. Nothing; imported MeshParts never collide
Answer

Players bump into a solid coin-shaped part that no script owns. Imported MeshParts collide by default. Beacon Yard only uses the model inside ReplicatedStorage.Assets, and clones it as a costume with collision off. Delete the copy the Importer dropped into Workspace.

Open this step in lesson mode · Link to this step · This confused me

9Build it: your coin in the yard

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
3D Importer (File, Import)Studio's own importer with preview, warnings and settings.The everyday path for one or a few models.One person, by hand; settings must be checked each time.
Roblox Blender pluginRoblox's open-source Blender add-on that uploads selected objects through Open Cloud.Artists who iterate in Blender and want to skip the export and import step.Another add-on to install and sign in; still produces asset ids to manage.
Asset Manager bulk importImport many files at once through the Asset Manager.Batches of static meshes, images and audio.Roblox's docs say it does not handle rigged, skinned or animated meshes.
Open Cloud Assets APIUpload assets over HTTP from a script or CI.Fully managed pipelines where art lives in Git.Needs an API key and tooling; covered in the deploy lesson.

Build along

m12-money

    The two files this build writes, Ids.local.luau and assets/roblox/Coin.rbxmx, are git-ignored. They are your own outputs, so no tag diff contains them.

  1. In Blender, select your Coin, choose File, Export, FBX, tick Selected Objects, set Forward to Z Forward and Up to Y Up, set Apply Scalings to FBX Unit Scale, and export coin.fbx.

    You should see coin.fbx is written next to your coin.blend.

  2. In Studio on your Beacon Yard place, File, Import the FBX with Upload to Roblox off. Under File Transform, set World Forward to Front and World Up to Top. Check the size against a 2-stud part, then cancel. If the preview faces the wrong way, change World Forward or re-export with the other Forward value. The axis box in the next step explains why.

    You should see The preview shows a coin about 2 studs across, and File Geometry reads Studs.

  3. Import again with Upload to Roblox on and Creator set to you. In Workspace, select the MeshPart inside the imported model, open Properties, and copy the numeric id from MeshId (the digits at the end of the asset URL). Do not use Copy asset ID in the Importer here, because it copies the Model's id. Delete the copy that landed in Workspace.

    You should see The import finishes and you have copied the number from the MeshPart's MeshId, not the Model's id.

  4. Copy src/shared/Ids.local.example.luau to src/shared/Ids.local.luau, set COIN_MESH_ID to your id, then run node scripts/gen-assets.mjs.

    You should see node scripts/gen-assets.mjs prints model Coin -> assets/roblox/Coin.rbxmx.

  5. Run rojo build -o beacon-yard.rbxlx, reopen the built place in Studio, and press Play. If the coin does not load and Output shows an asset permission error, use the recovery from the step on who may load it: click the error to grant the game access.

    You should see In Play, each coin shows your mesh, and the Output has no [Ids] warning about the Coin model.

Open this step in lesson mode · Link to this step · This confused me

10Challenges

Level 1, Apprentice

Challenge

Without opening Blender, write down the export settings for a static prop. Then say which setting Roblox recommends for the oversized FBX import, and name one alternative.

Start from
The game at milestone m12 (download)

Done means

  • You named the three FBX export settings Beacon Yard relies on: selected only, Z Forward and Y Up, and Apply Scalings set to FBX Unit Scale
  • You said that FBX Unit Scale is the recommended fix for oversized imports, and named one alternative

Hints

  1. Look back at the export step.
  2. Scale problems come from the scale setting, not from the axes. Roblox's guide lists three controls.

Why does Beacon Yard put your mesh id in Ids.local.luau instead of the template?

  1. The id belongs to your account; the local file is git-ignored and the id guard fails on ids in committed files
  2. Templates cannot hold numbers
  3. Rojo cannot read templates
  4. Ids.local.luau loads faster
Answer

The id belongs to your account; the local file is git-ignored and the id guard fails on ids in committed files. Ids are account-bound. Templates hold placeholders, Ids.local.luau holds your numbers and stays out of Git, and the CI id guard catches a slip.

Level 2, Builder

Challenge

Do a size check only. Say whether your coin matches the 2-stud template size, and fix the export if it does not.

Start from
The game at milestone m12 (download)

Done means

  • You imported your coin FBX with Upload off and compared it with a 2-stud part
  • You created no new asset

Hints

  1. If the preview dwarfs the yard, check Apply Scalings and Scale Unit.
  2. Cancel the import if the only way forward creates an asset.

Level 3, Professional

Challenge

Get your own coin mesh into the yard. The check (challenges/blender-to-roblox.luau) is in the game repo at m14-ship; the steps are in challenges/solutions/blender-to-roblox.md.

Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("blender-to-roblox", "blender-to-roblox-coin") in the server command bar. Copy the pass code from Output.

Done means

  • ReplicatedStorage.Assets.Coin is a Model whose MeshPart Coin has a MeshId
  • That MeshPart has CollisionFidelity Box, CanCollide off and CanTouch off
  • During Play, a coin in Workspace.Yard wears an uploaded MeshVisual model, not the neon stand-in
  • The test prints TEST PASS for coin_template, coin_costume_flags and coin_visual_uploaded

Hints

  1. Set COIN_MESH_ID in Ids.local.luau, run node scripts/gen-assets.mjs, then rebuild and reopen the place.
  2. The stand-in is a single neon Part named MeshVisual; the uploaded visual is a Model named MeshVisual.
  3. challenges/README.md shows how to run a challenge from the server during Play.

Open this step in lesson mode · Link to this step · This confused me

11Recap

Recap

  1. Export FBX with selected objects only, Z Forward and Y Up, and Apply Scalings set to FBX Unit Scale; default FBX exports import unexpectedly large, and a file read as centimetres arrives 100 times too big.
  2. Read the Importer every time: Upload off for size checks, Creator for ownership, Add to Workspace grants this game, No Rig for props.
  3. Your id goes in the git-ignored Ids.local.luau; gen-assets fills the .rbxmx template, and the game wears it as a costume with collision off.

A mesh on a gameplay part is a mascot costume over a player on the field, until a MeshPart is a full BasePart: turn its collision or touch back on and the costume starts playing the game, blocking players or firing Touched.

Next Rigging and skinning in Blender, part 1: an armature for the drone

Open this step in lesson mode · Link to this step · This confused me