驱动器面板

    参考

    参考

    这个面板在 右侧工具栏可见,或者给属性添加驱动器时弹出。

    It shows the property that is being driven, followed by a series of settingsthat determine how the driver works.

    有两类驱动程序:

    • 内置函数 (平均, 求和, 最小值 and 最大值)
    • 自定义 (脚本表达式).

    An arbitrary Python expression that can refer to the Driver Variables by name. See Expressions.

    驱动器值

    当前驱动器的计算结果。

    见 。

    更新相关性

    Opens the fully featured Drivers Editor.This button only appears in the popover version of the Drivers panel.

    变量可以是物体单个属性、变换通道(位置缩放等信息)、两个物体的旋转角度差值、两个物体的距离。

    Drivers should access object data via Driver Variables, rather than direct references in the Pythonexpression, in order for dependencies to be correctly tracked.

    Add, Copy, Paste buttons.

    • 添加变量
    • 添加新的驱动变量。
    • Copy/Paste Variables
    • Copies the current variable list so it can be pasted into another driver's variable list.
    • 名称
    • Name for use in scripted expressions.The name must start with a letter, and only contain letters, digits, or .
    • 变量类型

    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.

    另见 .

    Tip

    The easiest way to create a variable of this type is to use theCopy As New Drivercontext menu option of the input property, and paste the resultinto the driver via .

    • 形变通道
      • ID
      • 物体的ID。如: Cube, Armature, Camera。
      • 骨骼
      • 骨架中的骨骼ID。如 "Bone", "Bone.002", "Arm.r"。该选项仅适用于骨架。
      • 类型
      • 如, X 位移, X 旋转, 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.

    1. - 空间
    2. - 世界空间、变换空间、自身空间。
    • 旋转差值
    • 使用两个物体或骨骼的旋转差值。
    • 距离
    • 使用两个物体或骨骼之间的距离。
      • 显示变量数值。
    • A text field where you can enter an arbitrary Python expression that refers toDriver Variables by their names.

    The expression has access to a set of standard constants and math functions providedin 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 subset as much as possible.

    • Use Self
    • 使用 self 变量引用自身数据。用于物体、骨骼,避免创建指向自身属性的变量。

    举例: self.location.x 可用于同一对象的Y旋转属性,使对象在移动时旋转。

    Note that dependencies for properties accessed via self may not be fully tracked.

    简单表达式

    Blender可以直接使用Python的函数表达方法,显著提高性能,尤其是在多个系统中。要利用此功能,驱动程序的表达式必须且仅使用以下功能:

    • 变量名称
    • 仅使用ASCII字符。
    • 常量
    • 浮点和十进制整数。
    • 全局变量
    • frame
    • 常量
    • pi, True, False
    • 运算符号
    • +, -, *, /,==, , <, <=, >, >=,and, or, not, conditional operator/ ternary if
    • 函数
    • min, max, radians, degrees,abs, fabs, floor, , trunc, int,sin, cos, tan, asin, acos, atan, atan2,exp, log, sqrt, pow, fmod

    即使禁用Python脚本执行,也会计算简单表达式。

    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 complexexpression in select few is OK.

    See also