user: Show practical ways to work with Basic Rig Generation in a Blender add-on or script – include code.

assistant: 1. Add a meta-rig structure from the Add ‣ Armature menu.
2. Edit the bone positions to match the character geometry.
3. In the armature properties click on the *Generate Rig* button to generate the rig.

### Add a Predefined Meta-Rig

Rigify stores all the information required to generate complex rig controls and mechanism in
more simple armatures called “meta-rigs”.

The predefined meta-rigs can be found in the *Add* menu.
Currently available meta-rig types are:

- Basic Human (doesn’t include face and fingers)
- Basic Quadruped
- Human
- Cat
- Wolf
- Horse
- Shark

### Edit Bone Positions

To correctly match your character, meta-rig bones must be moved to correct positions.
This can be achieved in two different ways: Pose Mode or Edit Mode.

#### Rigify Human Alignment Tips

- Limbs: Keep the legs as straight as possible in the front view (Rigify human works better in predictable cases).
  Give the knee and the elbow a slight bend angle (Rigify needs to know where your knee/elbow is pointing).
- Torso: Keep the spine as straight as possible in the front view (Rigify human works better in predictable cases).
  The last bone of the spine is the head. By default the next two bones (top to bottom)
  are considered the neck bones. It is suggested to keep the neck bones as aligned as possible while editing.
- Face: Positioning face bones can be tricky if you are not an expert in bone editing and
  they are almost useless if you plan to make facial animation through shape keys.
  Consider removing face features from your character if they aren’t really needed.
  If you don’t need the face all the face bones can be deleted.
  All the face bones are in the *Face* armature bone collection by default.
  You can select them by displaying only that collection, selecting all of its content and
  then deleting the bones in Edit Mode to correctly remove the face.

  If you want to scale all the face bones at once, consider scaling the face master bone
  in Pose Mode (see Pose Mode matching method).
  The face master bone is placed in the same position of the head bone.
  To select it easily, hide all other bone collections.

  For more tips, see the [Positioning Guide](bone_positioning.xhtml).

### Pose Mode Matching (Basic)

Enter the meta-rig Pose Mode. Rotate, scale, and translate the bones in the correct position.
When bones are in correct positions (always staying in Pose Mode)
use Apply ‣ Apply Pose As Rest Pose.

### Edit Mode Matching (Advanced)

Some basic armature display setup is suggested before entering bone Edit Mode.

With the meta-rig selected, go in the Properties and click on the Object tab.
Scroll down to the display panel and enable X-ray and under *Maximum Draw Type* selector select *Wire*.
This way the bones will always be drawn in wireframe on top of your geometry.

Then, always in the Properties click on the Armatures tab and under display check the *Axis* checkbox.
This way you the bones rotation axes will be displayed during the edit process.

For more detailed information on armature display modes please refer to
the [Display panel page](../../../animation/armatures/properties/display.xhtml).

### Generating the Rig

With the bones in the correct positions, jump back in Object Mode, go to the Armature tab,
scroll down to the bottom and click on the *Generate Rig* button to finalize the rig creation.
The generation process will take from few seconds to one minute depending on
rig complexity and hardware specifications of your machine.
If the generated rig needs tweaking, you can modify the meta-rig accordingly and
then click again on the generate button. If the rig already exists,
Rigify will simply overwrite it retaining all your modifiers and constraints and – where possible –
all the previously generated features.

For information about additional generation options, see the [Advanced Rig Generation](#advanced-rig-generation) section.

### Binding the Geometry to the Rig

To bind the geometry to the rig you can use your preferred tools. Just few things you have to know:

- All the deforming bones are in the *DEF* bone collection.
- Eyes and Teeth bones of the legacy face are not deforming. You are supposed to bind the eyes and
  teeth geometry through Child Of constraints.
- Usually armature deform with automatic weights do a really good job out of the box
  if you correctly place your bones (and there is enough topology to work with!).

For more detailed information on bone collections, Armature modifier and weight painting refer to the Blender manual.