Python Muscle of an Arm
by Barry Bonds


Before starting this tutorial.You need an Arm model.



Step 1:)

Draw out ikas as shown below.

You may think these are too many ikas for arm.But These ikas are needed to create more real arm animation.
To avoid polygon skin ripped . I drew out ikas like this.

Parent these ikas as shown below. Ika1>Ika2>Ika3>Ika4>Ika5>Ika6.
(To parent Ika1 to Ika2.The dull pink ika is child. the bright pink ika is parent.
So Ika1 must be bright pink.Ika2 must be dull pink.

Them,hit Ctrl+P>Use Limb>Limb 0.)




And draw out two more Ikas as shown below for the body.(Ika7,Ika8)

Parent ika1 to ika7,ika8.



Step2:)
Try to see how this works.

We must change all ikas to skeltons.
Select all ikas ,them main ika(ika1) must be bright pink.
Press Ctrl+K.

To make a skeleton deform the arm.Parent the ika1 to the arm .(Ctrl+P>Use Skeleton)

After that.We must tweak the MAX deform distances and weights.
Spend time testing small changes.

After you've done.

Let's see how.

It seems nice.But I want more real deformation.



Step3:)

I don't like the deformation of the elbow.
So I Added a little ika(elbow)as shown below.
Parent Ika4 to the elbow.(Ctrl+P>Use Limb>Limb 0)



Then clear parent of the arm(select the arm and hit Alt+P>Clear parent)

Select all ikas like before.(The main ika must be bright pink)
Press Ctrl+K.
Parent the ika1 to the arm.(Ctrl+P>Use Skeleton)

The pre-setting is alive.So we only tweak the MAX deform distances and weights of the elbow.

Let's see how.

It seems excellent!!

But I want more real deformation. Muscle.



Step4:)

Drow out a ika(Muscle) for Muscle as shown below.

Parent the ika3 to the Muscle.



Step5:)

Now we are ready for some scripting
Go to Text input Window(Shift+F11).Then click '-'buttons>Add New.

Name it 'mus001.py'or so.

Enter a script like this.

import Blender
Blender.Object.Get("muscle").RotZ = 9.7-0.1*Blender.limk.RotZ

Select the Ika3 and,,,,,.
Click Scpict buttons and Click 'DisplayObjectScpiptLink'button.
Click the 'New' button and enter the name of the text object(Mus001.py) in the
blank button. And select 'Redraw'.

To understand the lines of code is already here in Blendermania.
Read 'Python Scripting for Procedural Animation'

'9.7'means the rotation of 'Muscle'
'0.1'means 1/10 of the Rotation of the ika3.(this time)(You can change this as you like.)

Let's see how.



The change is little,so try to change '0.1' to '0.3' for more easy-seeing.

Excellent!!!!!!!!!!



Step6:)

I want to add some controllers of the ikas of the arm in the Edit window.
It will ease animating,I thought.

Draw out 3 ikas(name them 'R1','R2','R3')as shown below.

The one is for Ika3 Rot,the one is for ika4 rot,the one is for ika5 rot.

The script for Ika3 is

import Blender
Blender.Object.Get("Ika3").RotX = Blender.link.RotY

The script for Ika4 is

import Blender
Blender.Object.Get("Ika4").RotZ = Blender.link.RotY-1

The script for Ika5 is

import Blender
Blender.Object.Get("Ika5").RotX = Blender.link.RotY

Parent the ika1 to 'R1','R2','R3'.(Ctrl+P)and select arm and hit Alt+P
Select all ikas(Ika1 must be bright pink) and hit Ctrl+K and
parent ika1 to arm.

Because those ikas doesn't work well without parenting.

And link these scripts with these ikas as before.

You see it works well.