Creating your first Python script in Blender

In this tutorial we take you through creating a python script that will perform the typical initial steps for setting up mirror-modifier based box modeling work:

-Add a cube

-Take it to edit mode

-Scale it to half the size on x-axis

-Move it 0.5 units right on the x-axis

-Select the face that is on the center axis

-Delete that face

-Add the mirror modifier

-Turn on clipping for the mirror modifier

Continue reading “Creating your first Python script in Blender”

Multiple scene views in Unity 3D

Sometimes it’s useful to see the 3d world you are creating from multiple different angles simultaneously. Many 3D programs like 3Ds Max even offer quad views that have four different angles available. In Unity you can view your scene from multiple angles in the editor by right-clicking on the scene window tab at the top and choosing “add tab” and then “scene”. You can now drag and drop this new scene window tab to a place in the interface that you prefer and change it’s view angle to your liking. One way of working could for example be to have always one top view available and next to that one free view.

Export from Blender EEVEE to Unity 3D using glTF


The workflow between Cycles and Unity hasn’t been very optimal because the FBX exporter in Blender doesn’t support the node based Cycles materials.
Blender 2.8 brings significant improvement to the game developer workflow along with it’s new glTF exporter and the Eevee render engine.
Here we have a PBR textured public domain asset in EEVEE. We can select materials and check how the nodes are mapped to the principled shader. We have a standard RGB image for the albedo/base color input. The metallic and roughness texture maps are just grayscale images, so for the sake of efficiency they have been mapped to to blue and green channels of an RGB image.
And we have a normal map plugged into the normal input via the normal map node.
Let’s see how easy it is to transfer all of this into Unity.
I’ll select the entire object hierarchy by control clicking the parent object in the outliner.
The let’s go to file, export, glTF 2.0.
Let’s only export the selected objects by checking this checkbox. There are plenty of other options as well and the glTF standards supports also animations, including shape keys.
While Blender is working, let’s prepare Unity for the import by downloading the UniGLTF package from Github.
Well simply install this as a custom package and now we have the UniGLTF menu option up here, from which we can choose import. Unity want’s us to save the imported objects as a prefab so let’s do that.
Now this does take some time, so we’ll speed up the video a bit here.
After the import has finished, we can simply drag the prefab into our scene and marvel at how Unity has automatically placed all the texture maps correctly.
This will make the life of game developers a lot easier.
Thanks for watching and see you next time on one minute video tutorials dot com.

How to bring materials from Quixel DDO to Blender EEVEE

Did you create some texture maps in Quixel and wanted to use them in Blender’s new EEVEE render engine? You plugged them into the principled shader but the outcome looked very different from what you had in the 3DO preview of Quixel? Maybe especially the metals looked way too dark and almost black?

Here is a simple workflow that seems to work pretty well between Quixel and EEVEE:

IN QUIXEL:

1. When you create your project, make sure you choose the metallness workflow.

2. Add your materials.

3. Export with the exporter into PNG files using the Metalness PBR (Disney) -preset.

IN EEVEE:

1. Give your object a material with the principled shader.

2. Plug in the following texture map files into the following inputs in the principled shader:

-Albedo to base color
-Metalness to metallic (set node to non-color data)
-Roughness to roughness (set node to non-color data)
-Normal to normal map node and that to the normal input (set node to non-color data)

Now your metals and other materials should look pretty close to how they looked in Quixel 3DO.

Blender 2.8 Questions and answers

Q: How do we change the 3d-cursor location in 2.8?

A: Hold down shift and right-click.

Q: Where is the button to start an animation render in EEVEE/2.8?

A: f12 renders a still image, ctrl+12 renders animation. You can also start it from the “render” drop-down menu in the top bar.

Q: Where is the 3d-viewport manipulator widget (arrows for moving stuff around)?

A: Enable it from the toolshelf (the tool that looks like arrows to four directions).

Q: How can I change the scrubbing for the timeline to left mouse button?

A: Go to edit –> preferences –> Input and find the category called “animation”. There you can set the “Change frame” property to the left mouse button.

Q: How do we deselect in 2.8?

A: “A” selects all, alt + “A” deselects all. You can also hit “A” rapidly two times in a row to deselect all.

Q: How do you select keyframes in the 2.8 dopesheet?

A: With the left mouse button, unless you change timeline dragging to the left button, in which case you need to hold down shift.

Q: How can I get to the search feature that used to open with spacebar?

A: Press F3.

Q: How can I enter the camera fly mode? Shift+F doesn’t seem to be working.

A: Search with spacebar (or F3) for “walk” or change the shortcut from preferences –> Input –> 3D view ” view navigation ” input. The current new shortcut is Shift + ~ which doesn’t work on all keyboards.

Q: Why can’t I see parent-child relationships in the outliner like in the old version?

A: You can, if you switch to the “Scenes” mode in the outliner. Unfortunately locating selected objects with “.” doesn’t work in that mode yet. Control-clicking on a parent object will select all the children just like in 2.79 though.

Q: How can I make a new scene or duplicate a scene in Blender 2.8?

A: Hit F3 and type in “scene” in the search box, it will give you the option to make a new scene with the same options as in Blender 2.79.

Q: How can I switch scenes in Blender 2.8?

A: Change outliner mode to “scenes” and simply click on the name of the scene you want to use. Unfortunately this feature seems prone to crashing Blender at the moment.

Q: How do you switch between vertex select mode, edge select mode and face select mode in 2.8?

A: These buttons are in the top row now. But there is also awesome news: the shortcuts are now much better than before: 1 for vertex select, 2 for edge select and 3 for face select.

Q: Why is ctrl+click extrusion not working in 2.8?

A: There is a “extrude to mouse cursor” tool now in edit mode. Just click on it and start clicking with the mouse.

Q: How can one hide the HDRi background when rendering in EEVEE?

A: Hiding it from the viewport while working is a bit more complex, but hiding it from the actual render only requires one to set film to transparent in the render settings, just like in Cycles.

Save bone selection in Blender

Did you know that you can easily save certain bones into a group in Blender so that you can selected those bones quickly when needed? Simply use the bone groups feature to group your bones into different groups that can then be selected from the same bone groups panel. This comes particularly handy when using the pose library: you probably want to create matching bone groups for the poses that you are creating, especially now that the poses are only saved and applied for the bones that you have selected. You can even give different groups of bones different color to be able to visually separate them from each other.

Here’s the process of adding bones to a bone group:

1. Select the bones you want to add to the group (in Pose mode for example)
2. Create a new bone group with the + button
3. Hit the assign -button

Now you can easily selected that set of bones any time from the “select” button.

Blender 2.8 Grease Pencil basics

Getting the started with the new grease pencil tool in Blender 2.8 can be a bit tricky at first. In this post I will simply list some “gotchas” that I bumped into in case it may help others:

Question 1: Why can’t I create a fill color for my object with the fill-tool?
I’m clicking inside a closed stroke, but the stroke seems to be getting thicker instead of a fill appearing.

Answer: You probably need to set the fill opacity alpha to 1. it’s zero for materials by default which makes the fill transparent.

Question 2: How can I tween or interpolate between grease pencil shapes?

Answer: The basic tween workflow can be tested like this:
-Draw a shape
-Duplicate the first keyframe on the dopesheet timeline (shift + d) and move it further in time
-Go to this second keyframe and enter the sculpt mode
-Change the shape of the stroke by sculpting
-Go between these two keyframes and from the “interpolate” menu on the top choose “sequence” to have Blender automatically create the in-betweens

Question 3: Why does the brush size and strength change from what I set it to be in the top bar when I try to sculpt my strokes with grab tool in sculpt mode?

Answer: Still working on the answer for this one! 🙂

Question 4: What’s the difference between “Draw block”, “Draw ink”, “Draw Marker” “Draw Noise”, “Draw Pen” and “Draw Pencil”?

Answer: Try them and you will see they all produce a different kind of stroke. The Draw Ink -brush doesn’t seem to do ink-like angles when painting with a mouse, but using a pressure sensitive tablet and pen helped.

Question 5: How do I create new grease pencil layers or collections in 2.8?

Answer:You can add new layers to grease pencil by selecting the little pen icon in the properties area (one tab before the materials tab) and creating layers there.

Question 6: Where does the white background come from when using the new 2d-animation project preset?

Answer:N-panel –> “grease pencil paper”

Basic workflow suggestion for 2.8 Grease pencil:
-Add a new empty grease pencil object in object mode (shift+a keyboard shortcut). This step is needed to be able to activate the draw mode in the next step.
-Switch from object mode to draw mode
-Select your pencil/brush type from the left side tool panel
-Modify your brush settings from the “tool settings” panel in the right side property buttons -area. You might want to try the turn on the “active smooth” for example to get an interesting, smooth and accurate drawing experience even with just the computer mouse.
-Sculpt your strokes in the sculpt mode. You can for example add width variations to the stroke with the width tool.
-Go to the materials tab and change stroke color and add a fill (change fill opacity to 1 first)

That’s it for now, I will append this article with more questions and answers as I continue studying the tool.

Best practices for creating new scenes in Blender

The possibility of creating new scenes comes really handy in Blender: instead of creating multiple .blend files and keeping track of them, you can have a single .blend file with various different scenes instead. You can create new scenes from the “Scene” menu at the top of the interface by clicking on the little + button. When you do so, you will be presented with five different options:
“New”
“Copy settings”
“Link objects”
“Link object data” and
“Full copy”

In this article we will explain the differences between those options.

NEW
Selecting “New” will create a completely empty scene with all the settings set to default. This is rarely what we want, since typically we want to use at least some common settings between the various scenes and usually we want to share things like meshes and armatures as well.

COPY SETTINGS
Selecting “Copy settings” will create a completely empty scene, but with similar settings than in the previous one. These settings can be things like the “render” settings and “scene” settings.

LINK OBJECTS
Selecting “Link objects” will create a scene with all the same objects and every aspect of them is linked together: if you rotate an object in the first scene, it will also rotate in the second scene. While one can imagine situations in which this is useful, it doesn’t offer us the flexibility of creating different animations in different scenes for the same objects. It can however be a handy starting point: perhaps you want some aspects of your scene, like the surroundings for example, to be fully linked so that if you reshape the landscape in scene 1 it will automatically also change in scene 2. You could combine that behavior with making some objects independent of each other with the “make single user” command.

Link objects can also be used as a clever way of alternating between different selections, since selected objects are scene-independent. So you could have some objects selected in scene 1 and other objects selected in scene 2 and then switch between those scenes simply to decide which set of selected objects you currently need.

LINK OBJECT DATA
Selecting “Link object data” will create a scene with all the same objects and settings. The objects will share the same meshes, vertex groups, materials etc but they can still be independently manipulated in object mode (like translated, rotated and scaled for example). Editing the mesh in edit mode will edit the mesh all the scenes. Creating a new animation in one scene will not repeat that animation in the other scene. However, any animations before creating the new scene will share the same action and if you edit such an animation in one scene, it will also change it in the other. If that’s not what you want, you need to make the action “single user” by selecting “object” –> “make single user” –> “object animation”. Now those two objects can be animated individually. This “link object data” option is probably the one to go for as it offers a good balance between freedom and connection.

FULL COPY
Selecting “Full copy” will create a scene with all the same objects and settings but everything will be an independent copy. So changing things in one scene will in no way affect the other. This is very stress free and gives you the ultimate freedom, but you also loose all connectivity and can end you up with a very bloated project file, because everything is always duplicated. So for example the same material can end up having tens or even hundreds of copies so changing the material can get tedious.