Search This Blog

Showing posts with label 2.79.2.79b. Show all posts
Showing posts with label 2.79.2.79b. Show all posts

Monday 20 December 2021

BPY SCRIPT TO ADD MATERIAL TO AN EXISTING OBJECT.

To run this script open blender, add a cube object and select it.Copy and paste these codes into you text editor and run it to add a material to the cube. Here Red material(color) is added to the Cube.

-------------------------------------------------------------------------------------------------------------------------------

 import bpy

mat_red=bpy.data.materials.new("red")

mat_red.diffuse_color=(0.8, 0, 0)

mesh=bpy.context.object.data

mesh.materials.clear()

mesh.materials.append(mat_red)

-------------------------------------------------------------------------------------------------------------------------------

Thursday 11 March 2021

TO COPY NODE TREE FROM ONE OBJECT TO ANOTHER.


Assume that you you have made a node tree to set up a new material for an object(Let us say an UV Sphere). Now you add  another object (let us say a Cube). To copy the node tree from UVSphere to the Cube follow these simple steps:


1. Select the UVSphere. In the node editor set up a simple material node tree and save it. Now select all the nodes using Box select option. To copy these node tree to clip board click on the first floppy disk (like icon in light yellow color on the menu bar of the node editor.


2. Select the Cube,click on new material and click on new. You will see a Diffuse BSDF node connected to the Material Output node.Click inside the node editor window using LMB. Now click on the floppy disk icon on the right side. The node tree of the UVSphere will be pasted here. Select the 3D window  and press Shift+Z to see the rendered view of both objects with the new material. Change in material setting of the nodes of UVSphere does not affect the material settings of the Cube.

Thursday 3 December 2020

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.





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.


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...