Dev Ups

Published 2023-03-25 in design

Blender 101

I first used Blender 20 years ago. Back then all software was expensive, especially CAD tools. Decent C++ compilers cost money and installed from optical disks. Not only did you need to pay to create, you had to pay to consume too.

Blender was the exception, it was free. No one in industry would depend on its quirky, changing interface. A community of starving developers and creators nurtured it to where it is today.

After sinking days on end into developing my first humanoids, and then throwing them away out of sheer frustration at the time requirements, I gave up on Blender.

3D modelling is more stable work twenty years on. An investment in learning the skills will likely offer a return. Amateurs may even enjoy recognition. This is aimed at Roblox enthusiasts.

Blender 3.3.1 requires 840 MB, on Windows, with all defaults. 3.4.1 requires 914 MB. Buy now!

Here are the basics and shortcut keys for productivity.

Abbreviations

  • MMB = middle mouse button, likely the wheel
  • LMB = left mouse button

Of course I don't have a numeric keypad in 2023. No matter. Alt+MMB and drag to flip view orthogonally. Alt+Shift+MMB and you get all kinds of other, fixed angles to snap to.

If you lose orientation, refer to the compass in the top right of the editor window.

Top right of the editor window you'll find the orientation compass

Hold MMB to rotate. Shift+MMB to move whilst retaining facing, referred to as "panning".

Ctrl+Spacebar toggle maximising whatever pane the mouse is over.

Maximised edit view

Ctrl+Alt+Spacebar toggle fullscreen current pane. Like maximise, but also loses the top rows of menus.

Maximised, full-screen, edit view

Object interaction mode

Tab toggles between object mode and edit mode. This is displayed in the top left, in a drop-down, among other "Object interaction modes":

top left of blender when in edit mode

Next to edit mode are the 3 selection types available for editing:

  • Vertex(point) 1
  • edge 2
  • face 3

Object mode lacks this finesse but has greater scope. For example, it selects what can be edited in edit mode.

Ctrl+c copy.

Ctrl+v paste. This does something else in edit mode.

Shift+d duplicate.

Revision history

Before making changes, it's good to know undo and redo.

Ctrl+z to undo.

Ctrl+Shift+z to redo.

Viewing your revision history is useful to learn the names of operations, and to check they were accepted and worked.

Use the edit menu drop-down. It doesn't have a shortcut key, but I like it all the same:

Edit menu showing revision history

Editing

Face selection is a good place to start making big changes quickly. Here we have face selection active and are looking at the default starting object in blender projects, the cube:

Our subject, the cube

Select a face:

Cube with one face selected

E extrudes the face (or edge).

Cube with one face in active extrusion

Default extrusion is perpendicular (normal) to the face.

It's pretty powerful already. Alt+E gives a choice of further extrusion options.

x, y, and z to restrict any operation to that axis.

Shift+ {x|y|z} restricts operations to axis other than the selected one.

S scales the face, or edge. Remember to press x, y, and z. You can type a floating point for the new scale, relative to 1.0.

G grab. The selection follows the cursor. It moves. Unlike extrusion, this doesn't create a dividing line where the face was.

R rotate, probably not so useful for whole faces. You can type the degrees to rotate by, like 180 Enter, after R.

Ctrl+R loop cut. This subdivides the entire object in half. Use the mouse wheel to divide further. Click once to accept the division or use the mouse to change the division ratio.

You can find these basic editing operation shortcuts by hovering over their icons in the left-hand side of the edit window. No need to memorise prematurely.

O toggle proportional editing. When enabled, edits apply not only to the selected element but also those within the radius of effect. This is represented by a circle when editing. Use the mouse wheel to shrink and enlarge the effect.

Shift+Tab Snap to. Represented by a magnet in the middle of the top bar of the edit pane. Ctrl+Shift+Tab brings up the same options as we have from the top-bar drop-down. I choose "face project" which enables snapping to a face as we hover over/near it. Handy tool for neat edges with no gaps.

a select all.

l select linked. Everything connected, indirectly or directly, to the model/vertex/face under the cursor. This is additive, press it again to widen selection.

Shift+a add object. We get a pop up asking what basic (and monkey) shape we require. If we are in edit mode, the choices are all meshes.

In object mode we can add lighting and other advanced features. Be careful in object mode. Lighting and camera are already provided by default. We can select and delete them, accidentally in object mode, with a (all) then delete.

Ctrl+b bevel. Rounds sharp corners.

i inset. Like shrink selection in gimp, defines a "mini-me" inside the original. Double tap i when working with multiple faces, for symmetrical results.

Deletion options

delete delete, a pop up will ask what to delete. Vertices are fundamental to edges and faces. x also means "delete".

Delete pops up these choices

Delete isn't unambiguous, especially where the selected vertices have links to vertices we want to keep. Undo is useful here.

Where the goal is to maintain geometry, I would start with, "limited dissolve", which tends to be a little more conservative than the 3 other dissolve options.

Symmetry

Where symmetry is possible, we can take advantage of mirroring.

Ctrl+M to mirror. Follow with x, y, or z to select mirror direction. This is a one off operation.

We can "add modifier" from the "modifier properties" tab in the bottom right pane. From here, we have access to the mirror modifier which updates the reflection in real time and offers merging to reduce unsightly seams. If you export the object, there is an option "apply modifiers" that may be checked. The alternative is to apply manually, before exporting, which means we can still undo it. Hover the modifier and press Ctrl+A.

An assymmetric starting "cube"

Symmetric "cube" after adding mirror modifier

Manual Repairs

f adds (fills) an edge between 2 selected vertices, or a face between more vertices, or 2 edges.

Alt+LMB select all edges in plane in the object. Useful for cleaning up after loop cutting.

Shift+C centre cursor and fill screen.

. (numpad only) centre on the part you have selected. This is essential to prevent the camera from feeling locked up.

Faces

If you've ever had a surprising export or render, it could be because faces got reversed. Faces have internal and external sides. To save compute, the internal faces don't react to light and so are invisible.

Top right of the editor window is viewport overlays, which is opened to reveal face orientation

Rendering

z to select how objects display. The default is solid, but we can choose wire frame, solid, or rendered, which applies lighting to the texture and material faces.

Rendering makes compromises between efficiency and accuracy. The default render engine is Eevee and is very efficient but not realistic. Use it for all its worth. A real time graphics or game engine is likely not totally accurate either. It's only worth switching from "Eevee" to "Cycles" when rendering stills, or if rendering appears to be lacking.

"Cycles" defaults to rendering on the CPU, which is very slow. If you have a GPU, it could be worth using Cycles. This renders samples until the noise reaches a set threshold. You can tick the "denoise" box to use hardware denoising to require fewer samples. Swings and roundabouts.

Render properties with Cycles selected as the render engine and GPU as the device

Most of the time I use wireframe and solid.

Exporting

FBX is a popular output format. Roblox supports it, but I would avoid asking Roblox Studio to import formats other than OBJ. OBJ has a long history and Roblox support. If you find FBX assets, convert them to OBJ via Blender.

This is a beginner tutorial, so I'm going to assume that the intended consumer is Roblox. If it's something else, you can stop here. Learn how to import simpler meshes and textures into Roblox Studio. Learn this for both OBJ and FBX formats and when that trendy new FBX looks awful, you'll appreciate how OBJ is the solution.

We can choose "Limit to Selected Objects", and repeat if we have separate objects, for granular control of texturing within Roblox Studio.

Exporting with FBX uses peculiar scaling. Choose OBJ for better consistency between roblox and blender.

UNIVERSAL TRUTH 1: when exporting scale to 0.01. This maps 1m in blender to 1 stud in Roblox, exactly (at least for FBX exports).

UNIVERSAL TRUTH 2: one stud is 0.28m. This is less useful than fact one since we can simplify 1:1, and the 1:100 export scale is in no way relevant to a 1:0.28 ratio.

Simply import as a MeshPart, it will "magically" take the size and shape of the mesh we then import to it. The mesh (MeshID) can be swapped later. Any texture file in use at export time must remain in the same file location for Roblox to see it and succeed at importing. Each OBJ file has an accompanying MTL file, which records the path. We can upload our textures to Roblox first, and then reuse their ID explicitly to avoid an implicit local dependency. FBX has the option to bake the texture into the single file export, but FBX isn't optimal for Roblox Studio.

Humanoids are restricted to 10k triangles, accessories to 4k. The statistics option in the viewport overlays drop-down will count these for you.

Example export

Here is something to export and then import into Studio, a "table":

Table, showing its dimensions and statistics, in the 3D port of blender

Here are the FBX options used (notice the 0.01 scale):

FBX export options used

Here are the OBJ options used:

OBJ export options used

Import time

Now in Roblox, I have choices about how to import. Asset manager is good because it allows the upload of images. Ensure it is showing from the views tab and it should appear like this:

Asset manager requiring game be published or saved to cloud first

Telling us we need to publish first. That means our assets will go straight to the cloud. After publishing:

Asset manager's bulk import option

I click on bulk upload and am informed of the supported file types:

Asset manager supported file types

I select and import the FBX amd am asked about these options, which I deselect all of:

Asset manager import error

I receive this, unhelpful error.

Asset manager import error

I repeat on the OBJ and get is the same error. The OBJ was about 10 bytes, so I suspect I did not select the object before exporting, as evidenced by the first image in this section.

This is what a selected object looks like (now shaded yellow):

Table for export, now selected, and yellow

Before I concluded so much I attempted another way of importing which I'm more comfortable with, because it doesn't depend on the Internet, cloud, or publishing. Using Asset Manager is no good for demo's like this as there is no dry-run, the asset gets committed to my inventory.

Add a MeshPart to the workspace:

Add MeshPart

In the properties view below is a field for MeshID, with a folder icon, click it:

Click to set MeshID

I selected my file (the failing one, first) and got a helpful error message:

Helpful error

Based on this I strongly prefer the MeshPart solution to modelling with Blender in Roblox.

Using the correctly exported models, I'm informed it has location data. I always select no, I have positioned a MeshPart already:

Mesh location data

This is what it looks like imported:

Imported ok

This has no TextureID still. If I'd UV-mapped in blender it would have. Because it doesn't, I'm free to apply Roblox colours and materials to it. Here it is the default grey plastic.

The size is showing, in studs, proving that OBJ exports map 1:1 metres:studs. FBX maps 100:1.

Both the FBX and OBJ are identical once imported, and yes, the legs do penetrate the terrain. Positioning is of the centre of the object, the extremities changed between this and the brick-like MeshPart.

Shading and Texturing

I see artistic approaches which I will elaborate on.

  1. minimise mapped face sizes and paint them onto a sub pixel of a texture palette
  2. paint an image, colouring in the faces individually
  3. import a texture for specific decals or even photo realistic rendering

These increase the effort required. There is a fourth which is to just use the material properties. Roblox provides a precious few high quality, customisable, materials. These can have a drastic impact of lag and rendering performance. The default, of plastic is very good, bricks look nice too.

Texture mapping and shading deserves its own post, as my knowledge in this area is constantly evolving. I will end here by saying that Blender now provides a "UV editing" tab at the top with the screen divided by the required views/panes of the 3D viewport and "UV editor". That is what I use for 99% of my texturing and shading as it is fairly convenient and going beyond it is not sustainable, in my capacity.