Search This Blog

Showing posts with label blendernet.blogspot.com. Show all posts
Showing posts with label blendernet.blogspot.com. Show all posts

Tuesday 23 February 2021

IMAGE BASED LIGHTING (IBL)

  This learning material for Image Based Lighting (IBL) is written as applicable to Blender Version 2.79b. Image based lighting setup  is done using cycles node, with render Engine set to Cycles. Download and keep an HDRI image ready for use as the background Image.


Now the steps are as follows:

1. Set up a basic scene with a Cube  as the main object and a plane below it to serve as the ground. Add material and texture to both the Cube and Plane using cycles nodes. 

2. Change the lamp to Sun and set  strength to 3. Rotate it to direct its light ray on to the Cube.

3. Set the Camera and hit  0 (zero) key in Number pad to go to camera view. Adjust its position and direction to get desires view. 

4. In the properties Panel in the right, select World settings. Go to surface panel and for Surface select Background. 

5. Split the 3D window into three windows. Two at the top and the third one below. The top left window may be used to see the rendered view(Shift+Z), the top right window to see the 3d view and the window opened below may be used as a Node editor. 

6. In the Node Editor window, select World  for World setting. 

7. Add three nodes -  Environment texture, Background node and World Output node from left to right. Connect Color in Environment Node to Color in Background Node and from Background   here to Surface in World Output Node. Now the background would turn to a pink Color in the Rendered view, which indicates that all your node setting are ready for IBL. 

8. In the Environment Texture Node go to Open File option and open the HDRI image file. Now you will be able to see the image on the HDRI image file as the background in your scene. To see the rendered scene, hit Shift+Z in the top left window which we had opened for seeing the rended output.

9. If you want see the rendered image in full screen, first click inside the top left window and then press Shift + Space Bar. To go back to previous view hit Shift+Space bar key again. It toggles between the two view modes.


Thursday 3 December 2020

ANIMATION

 ANIMATION-2

ADDITIONAL FEATURES


 Here we shall learn about some additional  features of animation in Blender. When we want to animate a character(say a Cube), apart from changing its location, its angle of rotation and size(scaling) can also be animated. Again combinations like location and rotation, location and size,rotation and size or all three location-rotation-scale can be varied. Further these changes can be effected on all three axes - X,Y and Z.
 Further not only the objects in Blender like the Cube, Cylinder,Cone, UVSphere can be animated, the Camera and Lights can also be animated .  Further, the different shades of colour of an object or the brightness level can also be animated.  
 If there are more than one object in the 3D Screen, when we animate, we must set key frames for each Object. Again when the movement of the object is complex, (when we make a robot to walk like a man) then the number of keyframes would also increase very fast. This can be a very daunting task. To simplify the keyframing process and to speed it up, we can use Auto keyframing.


BLENDER ANIMATION

 ANIMATION 1 -INTRO

The word "Animation" is derived from the word "Animate" , which means to make an object come alive or to move like a living being. Cartoon characters are a good example of animation where the characters are made to walk, jump,slide,laugh or do  any other motion.


ANIMATION CONCEPT

Let us understand the basic concept of animation. Look at the image of an arrow facing upwards in Fig-1. 


                                                      Fig-1


We want this arrow to smoothly turn to the horizontal position as shown in Fig-2.


 Fig-2

To animate this arrow, we draw images of the arrow at in-between positions as shown in Fig-3.


                                                                         Fig-3

 The whole set of image, from beginning to end,  would then be as shown below in Fig-4.



                                               Fig-4


When we animate these images the computer will generate images for all in-between positions and show all the images in  sequence. The arrow will appear to turn smoothly from Vertical to Horizontal position as shown in the video, whose link is given below:

https://drive.google.com/file/d/1krmBTsjkgH9fgMNc59FPzZn7MZxIsxkb/view?usp=sharing


 In animation, one basic idea we must know is that when a sequence of images are run quickly at a minimum rate of 24 images per second the human eye sees the image movement  as a continues movement. This   idea is used in all animation, videos and movies.

 In Blender each of this image, where some change is made, is called  a Keyframe. We must set the key frames in Blender. In the Arrow animation example we discussed above, we have set four keyframes.  When we animate, Blender generates all the intermediate frames.

Now we shall learn to animate a Cube in Blender. The steps are given below:

1. Open Blender and then a new file and add an object(Cube)  at x,y location(0,0) in the Top view(Press Numpad 7).
2. In the Timeline window as shown below, set the frame number to 1.


2. Position the cursor in 3D window and press "I" key. In the "Insert keyframe Menu" panel which opens, select "Location".

 


 

An yellow line will appear in the Timeline window which indicates that a key frame is inserted.



3. Next set the frame number to 125 in the Timeline window as shown below. 

 


In the 3D window move the cube to x,y location (5,5). Hit "I" key, then select Location in the "Insert Keyframe Menu" panel. An yellow line will appear in the time line window which indicates that a key frame is inserted at frame 125.




4. Next set the frame number to 250 in the Timeline window as shown below.

 


In the 3D window move the cube to x,y location (10,10). Hit "I" key, then select Location in the "Insert Keyframe Menu" panel. An yellow line will appear in the time line window which indicates that a key frame is inserted at frame 250.
5. Now set the frame number to 1 by pressing |<< key in the TimeLine window. This can also be done by entering 1 in the window as shown in the image above. To play the animation, press > key.
6. Save the Blender file.





Wednesday 25 November 2020

UNITS IN BLENDER

 UNITS IN BLENDER(Blender Version : 2.79b)

 Units of measure in  Blender are as default set as Blender units. When we open the default screen and then press "N" key to open the properties window where we can see the dimension of the default cube is 2 units along all X,Y and Z axis. These units are defined as Blender units which serves as a general  unit of measure to set dimensions of any object or to compare their dimensions.
 

 Measuring units in Blender can also be set as mm(millimetre), cm(centimetre), m(metre) or as inch, feet, yard etc. To set the units with these units, the procedure is as follows:

 In the Properties window click on the "scene" BUTTON.(the third button from the left). You will see the drop down panel with heading "Units" and the button marked "None" which  would be highlighted with Blue colour. Click on Metric. Now move to 3D window and make sure you have added an object(let us say a Cube). Now hit "N" key to open the panel which would display the location, scale and dimension of the cube. Under Dimension, enter 10cm for x,y, and z dimension. The background  grid would change accordingly and the unit as  cm will be displayed at the top left corner of the 3D window.

 If you select the option "Imperial", then you can set the unit as inches or feet.


Thursday 29 October 2020

SCRIPT TO DELETE ALL OBJECTS IN 3D WINDOW

Script to delete all objects in 3D window:


import bpy


bpy.ops.object.select_all(action='TOGGLE')
bpy.ops.object.delete(use_global=False)

BPY SCRIPT TO ADD A CUBE AND A MATERIAL TO IT

The following script can be used  to add  a cube and a material to it:

 

import bpy

bpy.ops.mesh.primitive_cube_add(location=(0,0,0))
obj_matl=bpy.data.materials.new("obj_clr")
obj_matl.diffuse_color=(1,0,0)
mesh=bpy.context.object.data
mesh.materials.append(obj_matl)

Friday 16 October 2020

GETTING YOUR FEET WET

 EDIT MODE

Open a new 3D window, change to front view by clicking on "1" key (in number pad), hit Shift+C to move the cursor to the 3D origin. Press Shift+A to add an object, then go to Mesh and then click on Cube. A cube object will be added. Press Tab key to go to edit mode, press "A" key to deselect all.

To select a vertex click RMB on it. If you  want to select another vertex also, hold the Shift key down and then keep the cursor on the second vertex and then press RMB.

If you want to select an edge, first click on the edge select button in the horizontal panel in the bottom.It is positioned to the right of the edit mode  button. Then position the cursor on the edge you want to select and press RMB.

TO select a face, first select the face select option then select the face in a similar way.



SAVING FILE IN BLENDER

In Blender, the file you are working on must be saved when ever some substantial change is done in your file. Blender DOES NOT auto-save your file. Choose the proper directory where your Blender files are saved. Blender files are saved with the extension ".blend".


DUPLICATING AN OBJECT

To duplicate an object, select the object in object mode, press Shift+D.Then move the mouse, the duplicated object will move in the direction of the mouse movement. Click LMB to confirm the location of the duplicate  object.


STEPS FOR PROPER WORK FLOW

When you want to create a simple object (like a metallic bowl)  or a more complex one,it is worthwhile to spend some time to plan your steps to achieve the desired result. Working as you think would not help you move forward in a focused manner. "Set a target . Achieve it" This would be a better approach.

 
Basic steps for a proper work flow are listed below. You may adapt it to your specific needs:

1. Make a pencil sketch of the model you want to create.
2. Think of the tools in Blender which you would use to design your model.
3. Create the mesh of your model.
4. Add material.
5. Add texture..
6. Add light.
7. Set world horizon colour, if you want.
8. Position camera to get a good view of your model.
9. Render the image.
10.Save results.


CAMERA VIEW

If you want to set the camera position to a desired view which you have already got on your 3D screen, press Ctrl+Alt+0 (Zero key on Number pad).

 

EXTRUDING IN BLENDER

To extrude a set of vertices, select them using Box select option, then press "E" key then "z" key to extrude along z axis. Once you have extruded to desired length, click LMB to confirm.


Wednesday 14 October 2020

EDIT MODE IN BLENDER

 14/10/2020

EDIT MODE

An object in Blender in the edit mode is defined by its vertices, edges and faces. If we consider a square plane, it has four vertices at the four corners,four lines(called as edges in Blender) connecting these four vertices and a  surface (called face in Blender) which stretches between the four edges.

Similarly if we consider a Cube it has 8 vertices, 12 edges and 6 faces. These details of the plane and cube are shown in the image below:





An UVSphere in edit mode would like this:




Thus we may conclude that all objects are constructed using vertices,edges and faces. The same  process is used for making both simple mesh like a cube or to construct more complex shapes which may go up to construct a human body shape or a complex machine part like a bolt, a gear wheel.

A bolt in mesh mode is shown below:



WORKING IN EDIT MODE

To work in edit mode, first open a 3D window in Blender, and add an object like a Cube.Hit Tab key go to edit mode.In edit mode you will see all the vertices,edges and faces. When these vertices,edges and faces are not selected they would appear in black colour. Hit "A" key to select all. Now you will see all the vertices,edges and faces in yellow colour.
You can toggle "A" key to select/deselect all objects in the 3D window.

In edit mode we can work with vertices, edges and faces in a detailed manner to design  any desired shape. A number of tools are available to work in edit mode.

Look at the image below which shows the horizontal panel in edit mode. To the right of the button marked "Global" you will see four square buttons. The first one has a point(vertex) in orange colour, clicking on this enables vertex-select mode. The second button has a vertical line(edge) in orange colour,clicking on which will enable edge select mode, similarly the third button  is used to enable face select mode. The fourth button shows four vertices and edges in the foreground and four vertices  in the background. This button,when clicked on, enables selection of vertices in both foreground and background.



Another way to select  a particular set of vertices and edges is to use the Box or Circle mode, which is activated by pressing "B" or "C" key. This method  is explained earlier under the sub-head "SELECTING OBJECTS".

Once one or more vertex/edge are selected we can delete them,move(translate) them or extrude them or rotate them to create a modified mesh.

After we finish our work in edit mode the modified mesh can be seen as an object in the  object mode(Press Tab key).

TOOL PANEL

Both in object mode and edit mode the Tool panel can be activated by pressing "T" key with the cursor within the 3D window. The Tool panel will be positioned along the left side of the 3D window. Different operations like translate, rotate, extrude and delete can be applied to the object selected in either mode. Side tab with label "Tools", "Create", "Relations, "Animation" are also shown.You may explore using these tools one by one.

NOTE: In Blender, it may be noted that there is always more than one way to do any operation like adding an object,editing, translating,rotating or scaling it.









Monday 12 October 2020

BASIC OPERATIONS IN BLENDER

13/10/2020

 

BLENDER WINDOWS ICON

The icon of  these main windows are as shown in the image below.

 BASIC OPERATION IN BLENDER

ADDING OR DELETING OBJECTS

Here we shall try to add some objects and delete them. Objects are some geometric figures like a Plane, Cube, Sphere, Cylinder, Cone etc.
To begin with, click (RMB) on the cube displayed in the middle of the 3D window. Once it is selected an orange coloured outline will appear around the Cube. Next hold down the Shift key and then  press X key. A window will appear with "OK ?" and Delete Shift X. Click on the blue button to delete the Cube.

This is the standard procedure to delete any object. Select the object by clicking the RMB, once the object is selected, press Shift+X and click on the blue button.

To add an object to the 3D window, click within   the 3D window. The 3D cursor will move to the point where you clicked(LMB). Try this out a few times. Next press Shift+A, you will see a list of objects like Plane,Cube, UVSphere, Cylinder  etc appear. Click on any object name and the object will be added to the 3D window.

Try out this procedure for adding a few more objects in the 3D screen.

At any point of time,  a list of all the objects in the 3D window will be shown in the Outliner window, which is  at the top right corner of the display.

To select  all the objects in the 3D window press "A " key. All the objects will have an orange outline around it. You may delete all the objects.



SELECTING OBJECTS.

To select a particular object, position the cursor on the object and click RMB. To select all objects hit "A" key. Two other ways to select objects are  Box select and Circle Select. To use box select, keep the cursor in the 3D window, hit "B" key. Hold the LMB and draw a box to enclose the objects you want to select. To use Circle select, in a similar way, hit "C" key. A circle will appear. Re-size it by scrolling the MMB(Middle Mouse Button) to enclose the desired objects, then click LMB.


DIFFERENT VIEWS

One way of classing view type is the direction from which you view an object. Here we normally talk about Top view,Front view and (Right) side view.To change to different views, use the Number pad keys. Hit 7 for top view, number 1 for front view and number 3 for side view.

Another way of classifying view type is as Orthographic and Perspective view.In Orthographic view, all objects  appear at the same scale,irrespective of distance or depth. A pair of  railway line would appear as two parallel lines. In perspective view ,objects at a distance appear smaller. It adds depth to the view. In perspective, as in real life, the railway lines may look like they are getting smaller and closer as we see, more farther away. To change between the two views use number key 5. It toggles between the two views.

The current view type is displayed at the top left corner of the 3D window.



BASIC BLENDER VOCABULARY

OBJECT

Any 2D, 3D geometric figure is called as an object. As mentioned earlier, Plane, Cube,UVSphere ..... all these are objects. Here Camera, Light  everything is an object. It is like a character in a play. You work on it to make it do what ever you want.

OBJECT AND EDIT MODE.

We normally work  with both objects and meshes. Consider a Cube. If we want to move  the Cube from point A to point B, we select it and drag it to where ever we want and leave it there. If you want to change the shape of the cube, either you want to change it into a rectangular cube, or you want to distort it into into an irregular shape, we will  work in the Edit mode.

Object and  Edit mode is displayed at the bottom of the 3D window as shown below.



 


To change between the the two modes , hit the Tab key. It toggles between the two modes.

CENTRE OF AN OBJECT

In Blender all objects have a geometric centre. Its location and angle of rotation is specified with reference to this  centre and the 3D origin.

3D AXES IN BLENDER

In Blender we work on any object in object or edit mode with respect to the geometric origin (0,0,0) for locating an object. Its angle of rotation is with respect to the x,y,z axis. These three axis are shown in Red, Green and Blue colour respectively.The orientation of the x,y and z axis at any instant is shown at the bottom left corner of the 3D window.

 

GRAB, ROTATE AND SCALE (G, R,S - Keyboard shortcut)

To move an object from point A to B, first select it by clicking on it with RMB. Next hit "G" key to grab it. Move the mouse. The object will move in the direction of the mouse movement. Where ever you want to position the object click  the LMB.  

To rotate an object, select it by clicking RMB. Hit "R" key to rotate. Rotate  the handle with double arrow heads by moving the mouse. The object will rotate. At the desired rotated angle, click the LMB.

 To Scale  an object, select it by clicking RMB. Hit "S" key to scale. Pull   the handle with double arrow heads. The object will scale up or down to grow bigger or smaller. At the desired size, click the LMB.

To move,Rotate or Scale an object, it can be done to a specified distance,angle or size.First select the object and hit G to grab the object.

To move an object by 3 units along X axis - hit x then 3 and Enter key.
To move an object by 3 units along Z axis - hit z then 3 and Enter key.

To rotate an object  90 degrees,around x axis,    hit R then X then 90 and then Enter key.
To rotate an object  120 degrees,around y axis ,hit R then Y then 120 and then Enter key.

To scale an object  2 units along x axis ,hit S then X then 2 and then Enter key.
To scale an object  3 units along z axis ,hit S then Z then 3 and then Enter key.

NOTE: In Blender, for any feature to be used, the cursor must be within the particular window. Let us say you want to move an object from point A to point B. Then the cursor should be first clicked within the  3D window.


NUMBER PANEL

 
When you are working with an object in 3D window, we can get access to the current position of the object with respect to the x,y,z axis. Further you can also access the object's angle of rotation with respect to the x,y,z axis, its scale and dimension in Blender units. To activate the Number panel, hit the N key.To close it, hit the N key again. It toggles between the display / hide mode for the Number panel.


BLENDER KEYBOARD SHORTCUTS AND MOUSE CLICKS

 
Blender has defined numerous key board shortcuts which would help us to speed up our work. We need to quickly learn and use such shortcuts regularly. A few of these shortcuts and mouse clicks are listed below.

- Object/Edit mode               Tab key (Toggle)
- Add object                          Shift+A
- Select/Deselect all objects A (Toggle)
- Grab an object                   G
- Scale object                        S
- Rotate object                      R
- Number panel                    N (Toggle)
- Tool panel                           T (Toggle)

MOUSE CLICKS

Left mouse button clicked               LMB

Right Mouse button  clicked           RMB

Middle mouse button clicked          MMB



TO MIRROR ARMATURE BONES ON X AXIS 1. Assume that we are making a human rig in standing position. 2. Set the view to front view. 3. Create t...