Creating an animation rig in Blender: Difference between revisions

m
Line 476: Line 476:
Now we'll need to edit the Rig Layers panel a bit and add the wrist snapping functionality by putting three code snippets into rig_ui.py and running it.
Now we'll need to edit the Rig Layers panel a bit and add the wrist snapping functionality by putting three code snippets into rig_ui.py and running it.


#<li value="70"> Go to the Scripting tab and select the rig_ui.py script.
#<li value="71"> Go to the Scripting tab and select the rig_ui.py script.
#Right at the start of the script you will see the <code>rig id</code> field. Copy its value and save it in some text editor, as you'll be pasting it in the next few steps.  
#Right at the start of the script you will see the <code>rig_id</code> field. Copy its value and save it in some text editor, as you'll be pasting it in the next few steps.  
#Find the following line (use another text editor if you can't find it in Blender's Text Editor):
#Find the following line (use another text editor if you can't find it in Blender's Text Editor):


Line 494: Line 494:
</pre>
</pre>


#<li value="73"> Find the following line:
#<li value="74"> Find the following line:
<pre>        props.bones = '["upper_arm_ik.R", "hand_ik.R", "upper_arm_ik_target.R"]' </pre>
<pre>        props.bones = '["upper_arm_ik.R", "hand_ik.R", "upper_arm_ik_target.R"]' </pre>
Add the following code snippet below it - this will add a button and functionality for the wrist snapping on the '''right''' arm. Also, replace <code>'''YOURRIGID'''</code> with your <code>rig_id</code> from point 71.
Add the following code snippet below it - this will add a button and functionality for the wrist snapping on the '''right''' arm. Also, replace <code>'''YOURRIGID'''</code> with your <code>rig_id</code> from point 71.
Line 510: Line 510:




#<li value="74"> Find the following line:
#<li value="75"> Find the following line:


<pre>        row.prop(context.active_object.data, 'layers', index=8, toggle=True, text='Torso') </pre>
<pre>        row.prop(context.active_object.data, 'layers', index=8, toggle=True, text='Torso') </pre>
Line 523: Line 523:
</pre>
</pre>


#<li value="75"> Find the following line:
#<li value="76"> Find the following line:
<pre>        row.prop(context.active_object.data, 'layers', index=9, toggle=True, text='Torso (Tweak)')</pre>
<pre>        row.prop(context.active_object.data, 'layers', index=9, toggle=True, text='Torso (Tweak)')</pre>


Line 529: Line 529:
<pre>        row.prop(context.active_object.data, 'layers', index=8, toggle=True, text='Torso')</pre>
<pre>        row.prop(context.active_object.data, 'layers', index=8, toggle=True, text='Torso')</pre>


#<li value="76">Find the following code:</li>
[[Image:IKWrist.png|200px|right|thumb|Rig's expected state at point 80.]]
[[Image:ModifiedRigLayers.png|200px|right|thumb|Rig's expected state at point 80, with hand_ik.R selected, showing the newly added IK wrist snapping functionality.]]
 
#<li value="77">Find the following code:</li>
<pre>
<pre>
         row.prop(context.active_object.data, 'layers', index=21, toggle=True, text='Leg.R (FK)')
         row.prop(context.active_object.data, 'layers', index=21, toggle=True, text='Leg.R (FK)')
Line 538: Line 541:


Remove the <code>row = col.row()</code> and <code>row.seperator()</code> lines.
Remove the <code>row = col.row()</code> and <code>row.seperator()</code> lines.


#<li value="78"> Find the following line:
#<li value="78"> Find the following line:


<pre>row.prop(context.active_object.data, 'layers', index=28, toggle=True, text='Root')</pre>
<pre>       row.prop(context.active_object.data, 'layers', index=28, toggle=True, text='Root')</pre>


Change the value of <code>index</code> to 24. Index is the layer number, and Root should be layer 24, not 28.  
Change the value of <code>index</code> to 24. Index is the layer number, and Root should be layer 24, not 28.  


#<li value="79">We recommend backing up your file at this point.
#<li value="79">We recommend backing up your file at this point.
#Run the script, and move to the Layout tab. Your rig should look as shown in the screenshot
#Run the script, and move to the Layout tab. Your rig should look as shown in the screenshots on the right.




191

edits