Panneau Drivers¶
Référence
- Éditeur
Éditeur Graph
- Mode
Drivers
- Panneau
- Raccourci
N
Référence
- Menu
- Raccourci
Ctrl-D
Ce panneau est visible dans la Sidebar de l” Éditeur Drivers ou en tant que menu déroulant lors de l’ajout d’un pilote à une propriété.
It shows the property that is being driven, followed by a series of settings that determine how the driver works.
Paramètres de Driver¶
Type¶
Voici deux catégories de pilotes :
Built-in functions (Average, Sum, Min and Max)
The driven property will have the value of the average, sum, lowest or highest (respectively) of the values of the referenced Driver Variables. If there is only one driver variable, these functions will yield the same result.
Custom (Scripted Expression).
Une expression Python arbitraire qui peut se référer aux Driver Variables par le nom. Voir Expressions.
Driver Value¶
The current result of the driver setup. Useful for debug purposes.
Variables¶
Voir Driver Variables.
Update Dependencies¶
Ceci va forcer une mise à jour des dépendances de la Driver Value.
Show in Drivers Editor¶
Opens the fully featured Drivers Editor. This button only appears in the popover version of the Drivers panel.
Variables de pilote¶
Les variables sont des références aux propriétés, aux canaux de transformation ou au résultat d’une comparaison entre des transformations de deux objets.
Drivers should access object data via Driver Variables, rather than direct references in the Python expression, in order for dependencies to be correctly tracked.
- Add Input Variable
Ajoute une nouvelle variable de pilote.
- Copy/Paste Variables
Copies the current variable list so it can be pasted into another driver’s variable list.
- Name
Nom à utiliser pour les expressions de script. Le nom doit commencer par une lettre, et ne contenir que des lettres, des chiffres ou des tirets bas.
- Variable Type
Le type de variable à utiliser.
- Single Property
Retrieves the value of a RNA property, specified by a data-block reference and a path string.
In case of transform properties, this will return the exact value of the UI property, while Transform Channel will take parenting and/or constraints into account as needed.
See also Propriétés personnalisées.
- ID Type
Le type d’ID-Block. Par exemple : Key, Image, Object, Material.
- ID
L’ID du type de l’ID-Block. Par exemple : « Material.001 ».
- RNA Path
The RNA name of the property, based on a subset of Python attribute access syntax. For example:
location.x
orlocation[0]
for the raw X location value, or["prop_name"]
for a custom property.
Astuce
The easiest way to create a variable of this type is to use the Copy As New Driver context menu option of the input property, and paste the result into the driver via Paste Driver Variables.
- Transform Channel
Récupère la valeur d’un canal Transform d’un objet ou os.
- ID
ID de l’objet. Par exemple : Cube, Armature, Camera.
- Bone
ID de l’os de l’armature. Par exemple : « Bone », « Bone.002 », « Arm.r ». Cette option concerne les armatures.
- Type
Par exemple : Position X, Rotation X, Échelle X.
The Average Scale option retrieves the combined scale value, computed as the cubic root of the total change in volume. Unlike X/Y/Z Scale, this value can be negative if the object is flipped by negative scaling.
- Mode (Rotation)
For rotation channels, specifies the type of rotation data to use, including different explicit Euler orders. Defaults to using the Euler order of the target. See Rotation Channel Modes.
- Space
World Space, Transform Space, Local Space.
- Rotational Difference
Fournit la valeur de la différence rotationnelle entre deux objets ou os, en radians.
- Distance
Fournit la valeur de la distance entre deux objets ou os.
- Value
Affiche la valeur de la variable.
Rotation Channel Modes¶
Rotation Transform Channels support a number of operation modes, including:
- Auto Euler
Uses the Euler order of the target to decompose rotation into channels.
- XYZ Euler, …
Explicitly specifies the Euler rotation order to use.
- Quaternion
Provides the Quaternion representation of the rotation.
- Swing and X/Y/Z Twist
Decomposes the rotation into two parts: a Swing rotation that aims the specified axis in its final direction, followed by a Twist rotation around that axis. This is often necessary for driving corrective Shape Keys and bones for organic joint rotation.
This decomposition is often produced in rigs by using a helper bone with a Damped Track Constraint to extract the swing part, and its child with Copy Transforms to extract the twist component.
The channels values for Swing and Y Twist are:
- Y Rotation
True angle of the twist rotation.
- W Rotation
True angle of the swing rotation, independent of its direction.
- X Rotation, Z Rotation
Weighted angles that represent the amount of swing around the X/Z axis.
The magnitude of the angle equals W Rotation when the rotation is purely around that axis, and fades out to zero as the direction changes toward the other axis, following the falloff curves from the graph on the right.
Mathematically, the swing angles are computed from quaternion components, using \(2 \arccos(w)\) for W and \(2 \arcsin(x)\) etc. for the others. The component of the swing rotation that corresponds to the twist axis is always 0, and is replaced by the twist angle.
Expressions¶
- Expression
A text field where you can enter an arbitrary Python expression that refers to Driver Variables by their names.
The expression has access to a set of standard constants and math functions provided in the Driver Namespace. For an example of adding a custom function to the namespace, see the driver namespace example.
For performance reasons it is best to use the Simple Expressions subset as much as possible.
- Use Self
Si cette option est activée, la variable ``self``peut être utilisée pour que les pilotes référencent leurs propres données. Utile pour les objets, les os, pour éviter d’avoir à créer une variable Driver pointant vers elle-même.
Example:
self.location.x
applied to the Y rotation property of the same object will make the object tumble when moving.Note that dependencies for properties accessed via
self
may not be fully tracked.
Simple Expressions¶
Blender can evaluate a useful subset of Python driver expressions directly, which significantly improves performance, especially on multi-core systems. To take advantage of this, the driver expression must only use the following features:
- Noms de variable
Use only ASCII characters.
- Literals
Floating point and decimal integer.
- Globals
frame
- Constants
pi
,True
,False
- Operators
+
,-
,*
,/
,==
,!=
,<
,<=
,>
,>=
,and
,or
,not
, conditional operator/ ternary if- Functions
min
,max
,radians
,degrees
,abs
,fabs
,floor
,ceil
,trunc
,int
,sin
,cos
,tan
,asin
,acos
,atan
,atan2
,exp
,log
,sqrt
,pow
,fmod
Simple expressions are evaluated even when Python script execution is disabled.
When an expression outside of this subset is used, Blender displays a « Slow Python expression » warning. However, as long as the majority of drivers use simple expressions, using a complex expression in select few is OK.
Voir aussi