How to create a simple glass reflection effect with Blender Environment Texture

In this tutorial I am going to show you how to create a simple glass reflection effect with the Blender Environment Texture.

1) First start up a new Blender project, change to Cycles Render then create a plane below the default cube and scale it up to 3.5 time.

s 3.5
scale the plane to 3.5 time

2) Next under the property panel select world and then under the Surface sub panel click on the Use Nodes button to create new node. Select Environment Texture from the button besides the Color palette. Load the texture which you wish to show up as the background image for this project and set it’s strength to 5.

use environment texture to light the scene
use environment texture to light up the scene

3) Next delete the default lamp (Right click on the lamp then press x and delete).

4) Now select the plane and create a new material under it’s Material menu, leave everything as default but change it’s surface shader to Glossy BSDF.

use Glossy BSDF
use Glossy BSDF

5) Next switch back to the world menu and under Ray Visibility uncheck the camera checkbox so we can now hide the background image but still using it to light up the scene.

Hide Background
Hide Background

6) Next under the Render menu turn the background scene into transparent.

set background to transparent
set background to transparent

7) You might also want to complete the following steps to reduce the noise and the fireflies effect on the object.

Sampling Menu
Sampling Menu
Light Paths Menu
Light Paths Menu

Now the cube will float on top of a shinny glass as shown in the following image.

Blender Glassy Effect
Blender Glassy Effect

How to light up a Blender object with Environment Texture

In this tutorial I am going to show you how to light up a Blender object not by using the default lamp but just by using a background image.

Start a new Blender project then switch it to Cycles Render and then go to the property panel and select the world tab. Under the Surface sub panel click on the Use Nodes button and then click on the button beside the color palette and select Environment Texture, next click on open and select an image as the background image for the scene!

Environment Texture
Environment Texture

Turn off the lamp by clicking on the eye icon once so we only light up the default cube with the background image.

All Scenes
Under All Scenes turn off the Lamp

Next under the Render tab Film sub panel checked the Transparent checkbox so the background image will not appear in the scene but still will light up the default cube.

Turn Off Background
Turn Off Background

Next select the default cube then go to the Material tab and click on the Use Nodes button. Select Magic Texture from the button beside the color palette.

Change to Magic Texture
Change to Magic Texture

Now click on the Render tab and render the scene.

Render Object
Render Object

As you can see the background image has replaced the lamp to light up the object’s scene.

Starting to sculpt in Blender

In this short tutorial I will show you how to sculpt a sphere and turn it into something interesting.

First let start a new Blender project then delete the default cube and add in a sphere, Mesh->UV Sphere.

Next add in a Multiresolution Modifier

Multiresolution Modifier
Multiresolution Modifier

Next click once on the Subdivide button under the Multiresolution Modifier to increase the Preview, Sculpt and Render value to 1.

Click Once
Click Once

Then switch from the Object Mode to Sculpt Mode and make sure that Mirror x has been selected. This is just like using the Mirror Modifier on our object.

Symmetry
Symmetry

Select subtract so we can dig a hole on the object, before that make sure you switch to Front Ortho View first. Now start to sculpt a hole on the right part of the sphere.

Select Subtract
Select Subtract
Sculpt Hole
Sculpt Hole

Now you should understand why we need to set the X Mirror at the beginning of the tutorial.

Next click on the Subdivide button once, not too many time, just once to smooth the object a little bit.

Next switch from subtract to add.

Select Add
Select Add

Create below figure.

Sculpt a cat
Sculpt a cat

Click on Subdivide again to smooth the object.

You can also press the F key then move your mouse to increase or decrease the area of the brush as well as press the Shift+F key to increase or decrease the strength of the brush.

That is it! Hope you like this short sculpt tutorial, sculpt is not easy to master, you need to keep on practicing in order to perfect your skill.

How to create a cloth simulation effect with Blender

Once a while I would like to watch youtube video on how to create various object in Blender and today I have watched a video regarding the cloth dropping physic simulation which is pretty cool and thus this lead me to create the following object.

Cloth Dropping Effect
Cloth Simulation Effect

After I have created the above prototype I have decided to create my own cloth physic simulation and have finally came out with below tutorial which I think you will like it. So let get started.

The concept behind this new Blender project is simple, the cloth will drop from the top and landed on a sphere object.

First let open a new Blender file and switch to Cycles Render, we are going to turn the default cube into a sphere. With the default cube is still selected press the Tab key to get into the Edit mode. Now press the W key and then select Subdivide Smooth for 3 times. The previous default cube will become a sphere.

Subdivide Smooth
Subdivide Smooth

OK that is it, now deselected everything by pressing the A key and then get out of Edit mode by pressing the tab key.

Next press Shift+A and then Mesh->Plane to create a plane which we will use as the cloth.

Create a Plane
Create a Plane

Move the plane up so it is just slightly above the top of the sphere. Press S then 2 and press enter to scale the plane. Create another plane with the same method then move it down so it touches the bottom of the sphere, then press S and 3 to scale it, this plane will become the ground in this project. Now right click to select the sphere and scale it down a little by pressing S then move your mouse inward and then left click to confirm the size. You should also move the top cloth down to a new position as explained before. Now you should end up with the below position if you do it right.

Cloth-Cube-Ground
Cloth-Cube-Ground

Now lets create another new window and turn it into UV Image Editor.

Split Window into Two
Split Window into Two

Next with the top plane still selected go to the property panel and select Add Modifier then select Subdivision Surface, under Subdivisions set both view and render value to 5 and click on the Apply button.

Subdivision Surface
Subdivision Surface
Set both View and Render value to 5
Set both View and Render value to 5

Next get into Edit mode on the 3D View window then press the U key and then with the cloth still selected pick Unwrap. Next go to the UV Image editor window and open a new image which we will use as the texture for the cloth. You can download any image texture which you wish as long as it does not has watermark on it.

Open an Image from the UV editor
Open an Image from the UV editor

Next with the cloth still selected on the UV Image Editor press the S key and then move the mouse outward to cover the entire image.

cover the entire texture with cloth
cover the entire texture with cloth

Next go to the property panel and select the Material tab then click New to create a new Material and click on the button at the side of the Color palette then select Image Texture.

Image Texture
Image Texture

Next select the image texture you have just imported into your project.

cloth texture
cloth texture

OK now we can close the UV Image Editor window (I assumed you already know how to do that :))

Now for the fun part, with the cloth still selected press on the last tab which is the Physics tab on the property window then click on the Cloth button.

Click Cloth Button
Click Cloth Button

Under the Cloth sub panel set the Quality steps to 10 and under Presets leave it as Cloth Presets.

Set Quality Steps to 10
Set Quality Steps to 10

Under the Cloth Collision sub panel set the both the Cloth Collision and Self Collision Quality to 10.

set quality to 10
set both the cloth collision and self collision quality to 10

Next right click to select the sphere and this time under Physics panel select the Collision button, do the same to the ground as well.

Alright, now we can take a look at how the physic simulation works. Press the right arrow Play button at the bottom of the 3D window. You can either leave the animation till the end or pause it at the right spot which you wish to by clicking on the pause button.

click play
click play

You should see the below outcome (at a certain point of the animation).

cloth simulation
cloth simulation

Alright now lets create a texture for the ground. Right click the ground object then go to the property panel and select the Material tab. Click New as before then just leave everything as default and change it’s color to something you prefer.

select the color for the ground
select the color for the ground

Next press A to deselected everything, then change the View to Front Ortho. Press A and create a new plane. Scale it up to 3 times it’s current size. Rotate the plane on the Y axis by pressing the R key then the Y key and type in 90 then enter. Now you should see something like below, if not then move the new plane a little bit to the left of the sphere.

Move plane to left
Move plane to left

With the new plane is still selected, go to the material panel again and change the surface to Emission then pick a light blue color as it’s color and set the strength to 4.

Texture for the Emission plane
Texture for the Emission plane

Also because this plane will serve only as a reflector therefore we don’t want to show it in our camera view. Go to the Object tab and under Cycles Settings’ Ray Visibility unchecked the Camera’s checkbox.

Hide the Plane
Hide the Plane

Now lets click on the World tab (the one looks like earth) on the property panel then click on Use Nodes button, next click on the button at the side of Color palette and select Sky Texture and then set the strength to 7. You can play around with the sky texture and find the best effect for the object background.

Sky Texture
Sky Texture

Next press N to open another property panel and checked the Lock Camera To View checkbox under View, press N again to close the property panel.

Lock Camera
Lock Camera

Switch to camera view and position the object within the camera range. You can increase the Camera coverage by changing the Resolution of the camera screen under Resolution which is under the Dimensions sub panel of the Camera main panel.

reset the camera resolution
reset the camera resolution

One last thing to do here is you need to set the Samples value under the Render box to 500. This is under the Camera tab->Sampling sub panel.

Sampling
Sampling

That is it, now click on the Render button at the top of the Camera panel and you might see the below outcome. Don’t forget to save the image after this!

How to add modifier to blender object programmatically?

Hi, in this article I am going to add a Bevel modifier to a cube in Blender with python script. In my previous tutorial I have already shown you how to run python script in Blender Text Editor as well as me writing a few lines of code to rotate and change the color of the cube. Applying a Bevel modifier to an object in Blender is super simple, all we need is to include these two lines of code within the previous code.

obj.modifiers.new("Bevel", "BEVEL")
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Bevel")

Here is the full script which will create the Bevel effect on the previous rotated object.

import bpy

scene = bpy.context.scene
material = bpy.data.materials.new("PKHG")
material.diffuse_color = (0.539,0.546,0.0042)
material.diffuse_fresnel = 3.0
material.darkness = 0.3
material.diffuse_intensity = 0.5
material.diffuse_intensity = 0.7
material.diffuse_toon_size = 3.0
for obj in scene.objects:
    obj.rotation_euler = (0.785398, 0.785398, 0.785398)
    obj.modifiers.new("Bevel", "BEVEL")
    bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Bevel")
    obj.active_material = material

If you look at the 3D View window now after you have run the python script you will see this yellow cube with bevel effect!

Applying Modifier
Applying Bevel Modifier

How to create a mirror for an object in Blender 2.77

In this article I will show you how to apply the mirror modifier to an object in Blender so we can model one side of that object while Blender automatically creates the other side for us. Let’s take a look.

First of all start a new Blender project and press the tab key on your keyboard to get into the edit mode, make sure you have selected the default cube, if not press the A button to select the entire cube. Next press the W key then select subdivide to divide the cube into more division. Press A again to deselect everything, change to WireFrame mode, switch to Front Ortho view, also make sure you are in the Vertex select mode, next press the B key and drag your mouse to select only the left Vertices of the cube as shown below.

Select only half of the cube
Select only half of the cube

Next press x and delete the selected Vertices.

Delete Vertices
Delete Vertices

Now click on the Modifier icon on the property window, then click on Add Modifier and select Mirror.

Mirror Modifier
Mirror Modifier

Under the Mirror Modifier panel do the below setting.

Enable Clipping
Enable Clipping

That is it! Now you can edit the right side of the cube and those changes will automatically reflected in the other.

Mirror Modifier Effect
Mirror Modifier Effect

Question most people always ask : How to turn the mirror of the above object into the real object

The answer is really simple, make sure you are in the Object mode then press on the Apply button on the Mirror Modifier panel.

Turn the mirror object into solid object
Turn the mirror object into solid object

Now you can paint on the cube as you wish.

How to run the python script in the Blender 2.77 text editor

For the python learner Blender is one of the real deal to show our python programming skill, today I have take a look at this cool Blender’s Text Editor which we can directly type in the python code and run it to see the outcome in the Blender’s 3D View Editor.

Blender’s Text Editor is where we will write our python script and run it before we actually create a Blender addon and install it in Blender. To use the Text Editor all we need to do is to click on the 3d cube button on the bottom of our 3D View window and then replace the 3D View Window with the Text Editor window, make sure we have two windows open so we can see the python script’s outcome from another 3D View window.

Open Text Editor
Open Text Editor

Next click on the New button bellow the Text Editor window to create a new Text Editor.

Click New
Click New

Now we can start to enter the python script into that new text editor, lets input below script into the text editor and see the outcome by ourself.

import bpy

scene = bpy.context.scene
material = bpy.data.materials.new("PKHG")
material.diffuse_color = (0.7,0.0,0.5)
material.diffuse_fresnel = 3.0
material.darkness = 0.3
material.diffuse_intensity = 0.5
material.diffuse_intensity = 0.7
material.diffuse_toon_size = 3.0
for obj in scene.objects:
    obj.rotation_euler = (0.785398, 0.785398, 0.785398)
    obj.active_material = material

Next click on the Run Script button at the bottom of the editor and see the outcome as follow on the other 3D View window.

The selected object
The selected object

Basically what that above script does is to rotate the selected color cube in an angle and includes various other settings into the selected cube.

If you are interested in Blender programming then Blender Documentation is where you can find all the Blender functions that you can use in your python program. Besides that, this blog will also show article regarding how to write a python program which we can use in Blender from time to time so make sure you bookmarked this blog (I don’t collect email from you, only bookmark my blog and return for more interesting articles if you want to).

How to export Blender object into Panda3D 1.9.2 game engine

Panda3D 1.9.2 is a nice game engine which we can use it to create commercial game or free game and then either sell or distribute our game on the gaming market place. One cool thing about Panda3D is that it actually allows us to import object creates in Blender to our game which we can then use it as a gaming character. Today I am going to show you how to export Blender object into Panda3D 1.9.2 gaming engine with ease.

First of all if you are using Blender 2.77 and above then you will need to import YABEE addon into Blender before you can export your model in the EGG format to the Panda3D game engine. Chicken addon does not work on Blender 2.77. Therefore go ahead and download the YABEE addon first from the above mentioned link and then go to File->User Preferences and click on the Add-ons tab then click on the Install from File button at the bottom of the Add-ons panel and import the YABEE addon into blender.

Next create what ever object you wish to in Blender and then select that entire object which you want to export and go into the Edit mode, under the Edit mode press the u key then select Unwrep. Next go back to Object mode and go to File->Export->Panda3D(.egg). As for now follow below screen shot to do the export setting on the sidebar of the addon panel. You can adjust the setting later on.

YABEE EGG
YABEE EGG

After you have selected the folder to export the EGG file and provided the file with a name, for example boy.egg, click on the Export to Panda3D EGG button to export the file. You will find out that there are one egg file and one tex folder in that folder, the tex folder is where YABEE exports and keeps all the textures for the Blender’s model you have created.

Now lets put the object into the game. Create a python file and name it boy.py as follow in the same folder you have exported the egg file.

import direct.directbase.DirectStart

class Boy:

	def __init__(self):
		base.setBackgroundColor(0,0,0)
		self.track = loader.loadModel("./boy.egg")
		self.track.reparentTo(render)

b = Boy()

base.run()

Notice that the ./boy.egg is the relative path to the egg file. Next under your windows command prompt type in ppython boy.py to run the program. You must use ppython instead of python or else you will see an error because Panda3D uses it’s own set of python tool to run the program. You should see below object after you have started the program,

Panda3D
Panda3D

if not then press on the left mouse button and drag the mouse within the Panda panel screen above to reveal the object. If you are interested in learning Panda3D programming then you can find it all in https://www.panda3d.org.

That is all, I wish you good luck in your next Python game project!

How to create a human with MakeHuman 1.1.x then exports it to Blender

I am a game developer who always needs to create game character for my game with Blender, a free software which we can use to create movie and game graphic. However, creating a new game character in Blender takes time so I have decided to use another free software to assist me to speed up the game character creation process, the software I am going to talk about today is MakeHuman which is currently at version 1.1.0. You can use MakeHuman to create various humanoid characters and then import them into Blender where you can later turn that human character into creature or robot as you wish.

Below tutorial will show you how to create a human in MakeHuman 1.1.0 and then import it into your Blender program. OK lets get started.

  1. If you do not have MakeHuman installed yet in your pc then you can download it from it’s official website. http://www.makehuman.org/download.php.
  2. Before you start to create your first human in MakeHuman you need to do a few simple set up, MakeHuman 1.1.0 and above does not support the mhx file export and Blender does not support mhx2 file import by default so therefore you will need to download the plugin from this official website https://thomasmakehuman.wordpress.com/ then follow the instructions given by the author of this plugin to include this plugin in both MakeHuman and Blender.
  3. After you have downloaded MakeHuman and installed the require plugin, you can now open up the MakeHuman program and start to create humanoid. Lets create a simple one. Under the Modeling tab slided the Age’s, Gender’s and Height’s handle to the end of the left. Under the Geometries tab select the hat, shoe and cloth for this new born baby. Under the Materials tab select the skin and the eye color under Human sub panel. At last under Pose/Animate tab select default for this baby skeleton.

    MakeHuman 1.1.0
    Under Human sub panel, select the Skin then the Eyes color
  4. Next click on the Export button which is the third button from the top left then select the MakeHuman Exchange (mhx2) under Mesh Format sub panel then export your work to the pc hard drive.
  5. Now create a new Blender project and import the mhx2 file you have just created into Blender. Make sure the Auto Run Python Scripts checkbox is checked under the File tab of User Preferences panel. That is it! Now you can edit the mesh just like how you edit the other mesh by adding more objects into it.

    Make Human
    Make Human

How to import the ready made material into your Blender project

After you have created an object in Blender Cycles, you will need to start creating the material for that object which most of the time will take many man hours to do so plus you will need to manage the complicated node structure by yourself which most of the time can contain up to 50+ nodes. As a game developer, those time can well be spent to write beautiful program for your game instead of creating material for your game graphic. Luckily Blender has a feature calls Link which can help you to directly imports and assigns a material on your newly created object. Here is how to do it…

1) Search for a free to download Blender material file and downloaded it to your pc.

2) Start a new blender cycles project and create your first simple Mesh object. Next split the 3d window into two part, change the top window to node editor window, select the object in the bottom window then create a new material under the property window on the right of the 3d window and click on the Use Nodes button under Surface.

3) Make sure you are in the object mode, go to File->Link, then look for the Blender file you have just downloaded from the Internet, click to open it’s material library then pick a material file which you need.

Link from Library
Link from Library

4) Click on the little brown ball button at the bottom of the Node Editor window and select the material which you have linked into your project.

Select Material
Select Material

5) That is it, render the object with the new material assigns to it and see the outcome by yourself.

Look at the Node Editor
Look at the Node Editor

You can assign another new material on different object from different group on the same project, for example a ship or a house as you wish to.