Lesson 3 of 6

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

Rig Beacon Yard's drone in Blender. Learn armatures, bones and weight painting, place rotor bones from the game's own numbers, and follow Roblox's rules for root bones and influences.

Tool lesson, about 40 minutes, 10 steps

By the end you can

  • Explain why the drone's rotors cannot spin today, and compare a rigid rig, a skinned mesh and a scripted spin
  • Build an armature in Blender with a root bone, a body bone and four rotor bones placed from the template's positions
  • Bind the mesh to the armature and set weights so each rotor follows exactly one bone, within Roblox's rigging rules

Before this: From Blender to Roblox: FBX, the Importer and MeshParts

1Four rotors that never spin

Watch the drone chase you across the yard. It glides, turns and stuns, but its four rotors are frozen. Nothing is broken. When the server dresses the drone in its uploaded model, it welds every part to the gameplay part:

	for _, descendant in visual:GetDescendants() do
		if descendant:IsA("BasePart") then
			descendant.CFrame = delta * descendant.CFrame
		end
	end
	for _, descendant in visual:GetDescendants() do
		if descendant:IsA("BasePart") then
			descendant.Anchored = parent.Anchored
			descendant.CanCollide = false
			descendant.CanTouch = false
			descendant.CanQuery = false
			descendant.Massless = true
			local weld = Instance.new("WeldConstraint")
			weld.Part0 = parent
			weld.Part1 = descendant
			weld.Parent = descendant
Figure 1.1

Why do the drone's rotors never spin before m13-art-pass?

  1. Every visual part, rotors included, is welded to the gameplay part, so they move only as one block
  2. Rotors cannot spin in Roblox
  3. The rotor meshes are too detailed to animate
  4. The server has not loaded the rotor meshes yet
Answer

Every visual part, rotors included, is welded to the gameplay part, so they move only as one block. A WeldConstraint locks two parts together. With every rotor welded to the root, the whole drone moves as one rigid object.

The next milestone, m13-art-pass, changes exactly this. It finds the parts that a Motor6D joint drives, and welds only the others:

	-- Rotors hang on Motor6D joints so RotorClient can spin them. A weld to
	-- the root would hold them still, so only the other parts are welded,
	-- and nothing is anchored: the anchored root carries the whole rig.
	local driven: { [BasePart]: boolean } = {}
	for _, descendant in visual:GetDescendants() do
		if descendant:IsA("Motor6D") and descendant.Part1 ~= nil then
			driven[descendant.Part1] = true
Figure 1.2

In m13-art-pass, which drone parts does DroneService leave without a WeldConstraint?

  1. The parts that are Part1 of a Motor6D: the four rotors
  2. The drone's eye
  3. The drone's landing skids
  4. The body
Answer

The parts that are Part1 of a Motor6D: the four rotors. A rotor already hangs on a joint, and a weld on top would hold it still. Everything else is still welded to the gameplay part.

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

2Three ways to make a rotor turn

There are three common ways to move one piece of a model independently:

  1. A scripted spin. Keep separate rotor parts and turn each one in code every frame.
  2. A rigid rig. Keep separate parts and join them with Motor6D joints that an animation can turn. Roblox's classic R6 and R15 characters work this way.
  3. A skinned mesh. One mesh with an internal skeleton of bones. Each vertex follows one or more bones. Roblox calls rigging "connecting a mesh with an internal poseable skeleton", and skinning the step that makes it bend naturally1.

Beacon Yard's own m13-art-pass drone uses option 2: each rotor hangs on a Motor6D joint named Rotor<XX>Motor, and a client script turns it. Its script, RotorClient, also accepts Bones named Rotor<XX>, so a skinned drone could turn the same way. This lesson builds option 3, because it is the one that needs an art tool, and because a drone that someday wobbles or folds its arms needs bones anyway.

Both sidesAn armature and its bones is the wooden frame inside a puppet.
In the pictureIn Roblox
The wooden frameThe armature
Each stick of the frameA bone
The cloth sewn to the frameThe mesh's vertices, bound by weights

See the whole analogy cast

An armature is the wooden frame inside a puppet. Strings pull the frame, and the cloth and stuffing around it go along. Bones are the frame's pieces; the mesh is the cloth.

Think of it as The wooden frame inside a puppet

Match each approach to what moves the rotor.

  1. Scripted spin
  2. Rigid rig
  3. Skinned mesh
Answer

Scripted spin: Code sets the rotor part's CFrame every frame; Rigid rig: A Motor6D joint between body and rotor, driven by an animation; Skinned mesh: A Bone inside one MeshPart, with the rotor's vertices weighted to it. Scripted spins and rigid rigs move separate parts. A skinned mesh keeps one MeshPart and moves its vertices through bones.

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

3An armature and its bones

In Blender an armature is an object that holds bones. Add, Armature creates one with a single bone at the 3D cursor. In the armature's Object Data properties, turn on Viewport Display, In Front so you can see bones inside the mesh. With the armature selected, Tab into Edit Mode: there E extrudes a new bone from the tip of the selected one2, and Add, Single Bone adds a loose one3.

Name every bone in the Outliner as you go. Roblox keeps bone names on import, so RotorFL in Blender is RotorFL in Studio2.

Put the steps in order to get a visible armature with a second bone.

  1. Select the bone's tip and press E to extrude a new bone
  2. Turn on Viewport Display, In Front
  3. Rename both bones in the Outliner
  4. Tab into Edit Mode on the armature
  5. Add, Armature
Answer

1. Add, Armature 2. Turn on Viewport Display, In Front 3. Tab into Edit Mode on the armature 4. Select the bone's tip and press E to extrude a new bone 5. Rename both bones in the Outliner. Create the armature, make it visible through the mesh, edit it, extrude the next bone, and name them before you forget which is which.

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

4A skeleton for the drone

Roblox's rigging rules shape this skeleton. The root bone sits at 0, 0, 0 and influences no vertices. Every bone has rotation 0 and scale 1 when you export. A vertex may follow at most four bones4.

So the drone gets six bones: Root at the origin, Body parented to it, and RotorFL, RotorFR, RotorBL and RotorBR parented to Body. Each rotor bone's head goes at the rotor's centre. You already know where those are: the template stores them in Roblox coordinates, and the basics lesson showed how to convert back to Blender's.

Blender
The drone in Blender: a red box body with arms and skids selected as Drone, with five child mesh objects (the four flat grey rotor discs and eye) collapsed under it in the Outliner, reading Objects 1 / 6 and Triangles 84 / 304.

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

Figure 4.1.

The drone before joining into one mesh for rigging. Each grey rotor disc gets its own bone, with its head at the disc's centre.

The template puts RotorBR at Roblox (-1.0735, 0.696, 0.791). Where does the RotorBR bone's head go in Blender, using Blender (x, -z, y) from Roblox (x, y, z), the conversion of the template's Forward -Z export?

  1. (-1.0735, -0.791, 0.696)
  2. (-1.0735, 0.696, 0.791)
  3. (-1.0735, 0.791, 0.696)
  4. (1.0735, -0.791, 0.696)
Answer

(-1.0735, -0.791, 0.696). x stays -1.0735, Blender y = -(0.791) = -0.791, and Blender z = 0.696. A back rotor sits at negative y, because forward is +y in Blender.

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

5Bind the mesh to the armature

Parenting with weights binds the mesh. In Object Mode, select the mesh first, then Shift-select the armature so it is active, and choose Parent, With Automatic Weights. Blender adds an Armature modifier and creates one vertex group per bone, named after it, with weights it guesses from distance3.

Automatic weights suit bodies that bend. A rotor should not bend at all: it should follow its bone completely and nothing else. For a machine like this, the Roblox guide's robot example does it by hand: in Edit Mode select the rotor's vertices, pick its vertex group, set the weight to 1 and Assign3. Assign the body's vertices to Body the same way.

Automatic weights gave some rim vertices of RotorFL a little influence from Body. What happens when RotorFL spins?

  1. Those vertices lag behind and the rotor's rim smears toward the body
  2. Nothing; Body never moves
  3. The whole drone spins
  4. Blender refuses to export
Answer

Those vertices lag behind and the rotor's rim smears toward the body. Shared weights blend the two bones' motion, which is right for an elbow and wrong for a propeller. Assign rotor vertices fully to their rotor bone.

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

6Read the weights in Weight Paint mode

Weight Paint mode shows one vertex group at a time as colour: blue is 0, red is 1, green and yellow are in between. Select a bone's group and the mesh lights up where that bone pulls5. For the drone you want each rotor solid red in its own group and solid blue in every other group.

Then test before you export. Switch the armature to Pose Mode, select RotorFL, press R, then Z, and turn it. Only that rotor should move. Clear the test rotation when you finish3.

Windows

  • Clear pose rotation: Alt+R
  • Join selected meshes: Ctrl+J (or Object, Join)
  • Undo: Ctrl+Z

macOS

  • Clear pose rotation: Option+R
  • Join selected meshes: Ctrl+J (or Object, Join; Blender keeps Control for Join on macOS)
  • Undo: Cmd+Z

Both sidesRemember: An armature and its bones is the wooden frame inside a puppet.

Which of these follow Roblox's rigging rules for the drone?

  1. The Root bone at 0, 0, 0 with no vertices weighted to it
  2. Each rotor's vertices weighted 1 to their rotor bone
  3. Body vertices weighted to Root so the drone moves as one
  4. A vertex weighted to five bones for a smoother blend
Answer

The Root bone at 0, 0, 0 with no vertices weighted to it; Each rotor's vertices weighted 1 to their rotor bone. Root stays at the origin and drives nothing directly; Body carries the body's vertices. No vertex may follow more than four bones.

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

7Where the puppet picture breaks

In a puppet, each piece of cloth is sewn to one piece of the frame. Think about what weights let a vertex do that cloth cannot, then open the breakdown.

Where does it break?“The wooden frame inside a puppet” is a good picture of an armature and its bones. Where does it stop being true?

It breaks here. Cloth is sewn to one stick, but a vertex can be split between up to four bones, moving part of the way with each; that blend is how skin bends at an elbow.

The true model. Each vertex stores a weight per bone, and its final position is the weighted blend of where those bones would carry it. Weights of 1 on a single bone give rigid parts; shared weights give smooth bends.

A vertex on an elbow is weighted 0.75 to UpperArm and 0.25 to LowerArm. LowerArm moves the vertex's target point 8 studs; UpperArm does not move. Roughly how far does the vertex move?

Answer

2 studs (within 0.01). 0.25 of 8 studs is 2 studs. Blended weights are how skin bends smoothly, and why a rotor must have one weight of 1.

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

8Build it: rig the drone

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
Skinned mesh with bones (Blender or Maya)One MeshPart with an internal skeleton; vertices follow bones by weight.Creatures, characters, anything that bends, and machines you want to animate as one asset.Needs rigging skill; bones change the look only, not collision.
Rigid parts with Motor6DSeparate MeshParts joined by Motor6D joints, posed by the Animation Editor.Robots, vehicles and the classic R15 avatar, where pieces never bend.Many parts to manage; seams show if parts bend.
Scripted spinCode turns a part every frame on the client.Simple constant motion such as fans and rotors.No art tool needed, but every motion is code to maintain.

Build along

m12-money to m13-art-pass

    This build is for learning the rig. The game loads a drone only by the name Drone, in ReplicatedStorage.Assets, and part 2 saves your result as DroneRig, a name nothing in the game loads. So your rigged drone will not appear in Play. It is there to inspect and to test.

  1. Open your drone model, or model a simple one: a box body and four flat discs at the template's rotor positions. Join it into one object with Ctrl+J (Object, Join on both Windows and macOS), name it Drone and apply all transforms.

    You should see One mesh object named Drone sits at the origin with its scale applied.

  2. Add an armature at the origin. In its Edit Mode name the first bone Root, extrude Body from it, and add four bones for the rotors with their heads at the rotor centres. Set each rotor bone's parent to Body in the Bone properties.

    You should see The Outliner shows an armature with Root, Body, RotorFL, RotorFR, RotorBL and RotorBR, the rotors parented to Body.

  3. Select Drone, Shift-select the armature, and choose Parent, With Automatic Weights.

    You should see The Drone mesh has an Armature modifier and six vertex groups named after the bones.

  4. In the mesh's Edit Mode, assign each rotor's vertices to its rotor group at weight 1 and the body's vertices to Body. Remove those vertices from every other group.

    You should see Each rotor is solid red in its own group in Weight Paint mode, and the Root group is empty.

  5. Test every rotor bone in Pose Mode, then save as drone-rig.blend.

    You should see Rotating RotorFL in Pose Mode turns only that rotor; Alt+R (Option+R on macOS) puts it back.

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

9Challenges

Level 1, Apprentice

Challenge

Make a three-bone chain and name the bones Root, Base and Tip.

Start from
A new Blender file

Done means

  • An armature with three named bones in a chain
  • In Front is on, so the bones show through a mesh

Hints

  1. Add, Armature, then Tab into Edit Mode.
  2. Select the tip of a bone and press E to extrude the next.

How do the rotors of Beacon Yard's m13-art-pass drone spin?

  1. Motor6D joints hold the rotors on the server, and RotorClient writes each joint's Transform every frame on every client
  2. The server sets Bone.Transform on a skinned mesh
  3. Each rotor is welded to the body and rotated by its own Script
  4. An animation clip plays on the server
Answer

Motor6D joints hold the rotors on the server, and RotorClient writes each joint's Transform every frame on every client. In m13-art-pass the rotors hang on Motor6D joints on the server and are spun by RotorClient on each client, because Transform does not replicate and a spinning blade is a look, not a game rule.

Level 2, Builder

Challenge

Finish the drone rig from the build-along and screenshot Pose Mode with one rotor turned 45 degrees.

Start from
Your drone model

Done means

  • Six bones named Root, Body, RotorFL, RotorFR, RotorBL and RotorBR
  • Root at 0, 0, 0 with an empty vertex group
  • Each rotor turns alone in Pose Mode

Hints

  1. Use the template positions converted to Blender coordinates.
  2. In Weight Paint mode, a rotor should be red only in its own group.

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

10Recap

Recap

  1. Before m13-art-pass every drone part is welded to the gameplay part, so the rotors never spin; a scripted spin, a Motor6D rig or a skinned mesh can change that.
  2. An armature holds bones; parenting With Automatic Weights binds the mesh and makes one vertex group per bone.
  3. Roblox's rules: root at the origin with no influences, bones at rotation 0 and scale 1, at most four bones per vertex; rotors take weight 1 on one bone.

An armature and its bones is the wooden frame inside a puppet, until cloth is sewn to one stick, but a vertex can be split between up to four bones, moving part of the way with each; that blend is how skin bends at an elbow.

Next Rigging and skinning in Blender, part 2: bones in Roblox

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