﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3AHjaarnio%2FManual%2FAnimation%2FEditors%2FGraph%2FDrivers</id>
	<title>利用者:Hjaarnio/Manual/Animation/Editors/Graph/Drivers - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3AHjaarnio%2FManual%2FAnimation%2FEditors%2FGraph%2FDrivers"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Hjaarnio/Manual/Animation/Editors/Graph/Drivers&amp;action=history"/>
	<updated>2026-07-03T23:11:33Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Hjaarnio/Manual/Animation/Editors/Graph/Drivers&amp;diff=142513&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Hjaarnio/Manual/Animation/Editors/Graph/Drivers&amp;diff=142513&amp;oldid=prev"/>
		<updated>2018-06-28T20:56:24Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 20:56時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Hjaarnio/Manual/Animation/Editors/Graph/Drivers&amp;diff=142512&amp;oldid=prev</id>
		<title>2013年6月12日 (水) 12:47にwiki&gt;Hjaarnioによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Hjaarnio/Manual/Animation/Editors/Graph/Drivers&amp;diff=142512&amp;oldid=prev"/>
		<updated>2013-06-12T12:47:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Page/Header|2.5|Doc:2.5/Manual/Animation/FCurve Modifiers|Doc:2.5/Manual/Animation/Dope Sheet}}&lt;br /&gt;
&lt;br /&gt;
{{review|copy=X|text=partially}}&lt;br /&gt;
&lt;br /&gt;
= Drivers =&lt;br /&gt;
Drivers are used to control the animation of one property based on the value of another. This means that their animated value is not controlled by the frame number, but rather by any specified channel. Drivers can take their effects from single properties, differences in rotation, or scripted Python expressions which can be edited inside the UI controls. &lt;br /&gt;
&lt;br /&gt;
For example you could use the X location of a driver to control the colors (RGB curves) of a material, use the rotation of a driver to control the scale of an object, use the scale of a driver to control the shape (through shape keys) of a mesh/curve/etc., use a python function to control a constraint’s influence, and much much more…&lt;br /&gt;
&lt;br /&gt;
One key usage of drivers is in character animation: for example, you can add object drivers to the relative shape keys of a face. Then, you manipulate the expressions of your character just by moving these drivers objects (which are set unrenderable, of course!). A bit like using the NLA, but even more friendly! See [[Doc:2.5/Manual/Animation/Driven Shape Keys|Driven Shape Keys]].&lt;br /&gt;
&lt;br /&gt;
Although their interface and function is similar to that of an F-curve, they sit outside Actions, alongside them in the animation system hierarchy. Drivers are evaluated after Actions, so any F-Curve animation that may be in Actions on the data block will be overridden by the effects of a Driver.&lt;br /&gt;
&lt;br /&gt;
== Mapping ==&lt;br /&gt;
A driven curve is not controlled by time (yes, we insist, but it’s ''very'' important to understand this). It’s rather its driver’s property changes that control where along the X axis of the curve its value is to be taken (i.e. the curve now maps the driver’s property value to the curve’s property value).&lt;br /&gt;
&lt;br /&gt;
By default, there is a 1 to 1 mapping between the input value, and the output value, defined by a Generator F-Curve Modifier. You can create a custom mapping by deleting this modifier and entering keyframes into the graph area by pressing {{Shortcut/Keypress|ctrl}} + {{Shortcut/Mouse|lmb}}. &lt;br /&gt;
&lt;br /&gt;
= Creating Drivers =&lt;br /&gt;
To create a driver, find the desired attribute you want to drive, in the properties panel. This will be the attribute that will be '''driven''' by another attribute.&lt;br /&gt;
&lt;br /&gt;
{{Shortcut/Mouse|rmb}} on the channel and select one of the following options:&lt;br /&gt;
&lt;br /&gt;
;'''{{Literal|Add Drivers}}'''&lt;br /&gt;
:This will create drivers for channels related to the selected one. For example, it will add drivers to the X, Y, and Z translate.&lt;br /&gt;
&lt;br /&gt;
;'''{{Literal|Add Single Driver}}'''&lt;br /&gt;
:This will just add a single driver to the selected channel.&lt;br /&gt;
&lt;br /&gt;
= Editing Drivers =&lt;br /&gt;
After you have created a driver, you need to specify how that channel will be driven, and by what.&lt;br /&gt;
&lt;br /&gt;
The driver editor is located in the Graph Editor. You can switch from the F-Curve Editor view to the Driver view using the menu on the header.&lt;br /&gt;
&lt;br /&gt;
The Driver editor displays all driver in the current scene. They are listed in the Channel pane on the left side.&lt;br /&gt;
&lt;br /&gt;
If you have multiple drivers in the scene, you can toggle their visibility in the graph area. Also, you need to select the specific channel to begin editing it.&lt;br /&gt;
&lt;br /&gt;
== Driver Properties ==&lt;br /&gt;
The driver's properties are located in the Properties Panel on the right side. (This panel is hidden, by default - you can open it by hitting {{Shortcut|n}}.)&lt;br /&gt;
&lt;br /&gt;
;'''{{Literal|Update Dependencies}}'''&lt;br /&gt;
:Refreshes the drivers connections.&lt;br /&gt;
&lt;br /&gt;
== Driver Types ==&lt;br /&gt;
There are several different driver types that define how the input value of the driver is calculated:&lt;br /&gt;
&lt;br /&gt;
;'''{{Literal|Maximum Value}}'''&lt;br /&gt;
:Takes the highest value of the user variables.&lt;br /&gt;
;'''{{Literal|Minimum Value}}'''&lt;br /&gt;
:Takes the lowest value of the user variables.&lt;br /&gt;
;'''{{Literal|Sum Values}}'''&lt;br /&gt;
:Takes the sum of user variables&lt;br /&gt;
;'''{{Literal|Averaged Values}}'''&lt;br /&gt;
:Averages the values of the user variables&lt;br /&gt;
;'''{{Literal|Scripted Expression}}'''&lt;br /&gt;
:Computes a value based on a simple python expression, which can also make use of user variables. (see below)&lt;br /&gt;
&lt;br /&gt;
= Variables =&lt;br /&gt;
User Variables are what produce the input values for a driver. You need at least one variable, unless you are using a scripted expression. When using a single variable, all the driver types listed above, except scripted expression, will produce the same value.&lt;br /&gt;
&lt;br /&gt;
== Single Property ==&lt;br /&gt;
Use the Single Property type to call an arbitrary unique datablock from anything within the scene. This can be anything from the intensity of a lamp, to the color of a texture&lt;br /&gt;
&lt;br /&gt;
== Transform Channel ==&lt;br /&gt;
This type allow you to control curves through an object's transform properties – hence, one driver can control separately up to nine curves (the three components of its location, rotation and scale).&lt;br /&gt;
&lt;br /&gt;
To set up an object driver:&lt;br /&gt;
*Select the channel you want to drive.&lt;br /&gt;
*In the {{Literal|OB}} field that appears, enter the name of the chosen driver object.&lt;br /&gt;
*Unless your driver is an armature, you have only one choice in the {{Literal|Driver type}} drop-down list, {{Literal|Object}}.&lt;br /&gt;
*Select in the second drop-down list the property you want to drive your curve ({{Literal|Loc X}}, {{Literal|Scale Z}}, etc.).&lt;br /&gt;
*Choose the space in which the driver's tranform channels are evaluated&lt;br /&gt;
&lt;br /&gt;
Now, your curve is no more directly controlled by the time, but rather by the value of the property you chose. The values are in Blender Units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
In this example, we are going to control the size of the well-known monkey head (&amp;lt;code&amp;gt;Suzanne&amp;lt;/code&amp;gt;) with the Y-location of the &amp;lt;code&amp;gt;Empty&amp;lt;/code&amp;gt; driver. So, we {{Literal|Add Driver}} to the three {{Literal|ScaleX}}, {{Literal|ScaleY}} and {{Literal|ScaleZ}} channel of the &amp;lt;code&amp;gt;Suzanne&amp;lt;/code&amp;gt; object (as usual, if there is no curve yet, it is automatically created). Note that for now, '''there is no curve''', so Blender applies a one-to-one mapping, as if there was virtual unitary gradient linear curves (materialized as yellow dashed lines in the pictures below). This also illustrates that you can use the same driver property (here, the Y location) for several different drivers…&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|align=center&lt;br /&gt;
 |+'''Object drivers.'''&lt;br /&gt;
 |Note that the {{Literal|Curve Editor}} window is pinned to &amp;lt;code&amp;gt;Suzanne&amp;lt;/code&amp;gt;’s F-Curve (which allows us to select and grab the &amp;lt;code&amp;gt;Empty&amp;lt;/code&amp;gt; object while keeping under our eyes the curve it drives!).&lt;br /&gt;
 |-&lt;br /&gt;
 |[[File:ManAnimationEditorsIpoDriversExNoCurves01.png|thumb|600px|center|The empty driver at Y = '''1.0''' gives Suzanne a scale of '''1.0'''…]]&lt;br /&gt;
 |-&lt;br /&gt;
 |[[File:ManAnimationEditorsIpoDriversExNoCurves02.png|thumb|600px|center|With driver at Y = '''2.0''', driven’s scale at '''2.0'''…]]&lt;br /&gt;
 |-&lt;br /&gt;
 |[[File:ManAnimationEditorsIpoDriversExNoCurves03.png|thumb|600px|center|And driver at Y = '''-2.0''', driven’s scale at… Oh, I think you got it!]]&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Now, we can use curves on drivers to get more complex behavior than the basic one-to-one mapping. Below, we have the same scene as above, but the {{Literal|ScaleY}} channel now has a pseudo-sinusoidal curve, oscillating between '''1.0''' and '''-1.0''' values on a one-frame period, created with three control points and the {{Literal|Cyclic}} extrapolation ({{Shortcut|E}}). This means that, while the X and Z components of &amp;lt;code&amp;gt;Suzanne&amp;lt;/code&amp;gt;’s scale are still directly controlled by the Y location of &amp;lt;code&amp;gt;Empty&amp;lt;/code&amp;gt;, the Y scale component now cyclically varies between '''1.0''' and '''-1.0''', as the following pictures illustrate.&lt;br /&gt;
&lt;br /&gt;
{|align=center&lt;br /&gt;
 |+'''Object driver with curve.'''&lt;br /&gt;
 |-&lt;br /&gt;
 |[[File:ManAnimationEditorsIpoDriversExWithCurves01.png|thumb|600px|The empty driver at Y = '''1.0''' gives Suzanne a scale of ('''1.0''', '''1.0''', '''1.0''')…]]&lt;br /&gt;
 |-&lt;br /&gt;
 |[[File:ManAnimationEditorsIpoDriversExWithCurves02.png|thumb|600px|With driver at Y = '''1.25''', driven’s scale at ('''1.25''', '''0.0''', '''1.25''')…]]&lt;br /&gt;
 |-&lt;br /&gt;
 |[[File:ManAnimationEditorsIpoDriversExWithCurves03.png|thumb|600px|And driver at Y = '''-2.0''', driven’s scale at ('''-2.0''', '''1.0''', '''-2.0''')!]]&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== Rotational Difference ==&lt;br /&gt;
Rotational difference works only on bones, but are nearly the same as object ones.&lt;br /&gt;
&lt;br /&gt;
You set up a bone driver by entering in the {{Literal|OB}} field an armature’s name, and then selecting the {{Literal|Pose}} option in the {{Literal|Driver type}} drop-down list. Then enter the bone’s name in the {{Literal|BO}} field that appears, and select its property to be used.&lt;br /&gt;
&lt;br /&gt;
Note the following specificities:&lt;br /&gt;
*The transformations are evaluated in the bone’s space (i.e. parent bone’s transformations, as well as whole object’s ones, have no effects).&lt;br /&gt;
*When using the rotation as driver property, you’ll find a limitation: the evaluated bone’s rotation is always mapped into a &amp;lt;code&amp;gt;[-180°, 180°[&amp;lt;/code&amp;gt; range (which means that if you e.g. rotate your bone over the '''180°''' value, the driven object will “jump back” to its '''-180°''' X-curve-position…).&lt;br /&gt;
*You have an extra driver property: {{Literal|Rotation Difference}} takes the name of another bone, and uses as driver the angle’s value between the two bones.&lt;br /&gt;
&lt;br /&gt;
== Distance ==&lt;br /&gt;
Distance mode simply takes the distance between two objects or bones&lt;br /&gt;
&lt;br /&gt;
= Expression Drivers =&lt;br /&gt;
Python expression drivers (or “pydrivers” for short) allow you to use one-line [http://www.python.org Python] expressions as input for a channel, instead of using a property of another object, like standard drivers do. An expression in programming is any combination of symbols that can be evaluated to a definite value.&lt;br /&gt;
&lt;br /&gt;
{{Warning/Important}}You do not directly control the value of the curve with these pydrivers, but rather, as with the other driver types, you control ''where along the X axis'' the curve value should be taken.&lt;br /&gt;
&lt;br /&gt;
To set up an expression driver, change the driver type to Scripted Expression – it will display a standard text field where you can type your Python expression.&lt;br /&gt;
&lt;br /&gt;
These drivers open up many interesting possibilities: you can use mathematical functions and more general programming to drive object animations. The only restriction is that the pydriver expression ''itself'' must return a real number when evaluated, and not e.g. a string or something else.&lt;br /&gt;
&lt;br /&gt;
Examples would be using sines or cosines to make objects oscillate around a given point, or using random values at each animation frame to change some material attribute, like diffuse rgb, alpha, etc.&lt;br /&gt;
&lt;br /&gt;
Note that pydriver evaluation is equivalent to what the builtin &amp;lt;code&amp;gt;eval()&amp;lt;/code&amp;gt; function does, with the restriction that pydriver expressions must return real numbers (any type of number that can be automatically cast to a float).&lt;br /&gt;
&lt;br /&gt;
== Valid Expressions ==&lt;br /&gt;
We’ve already told the basics: there is a text field where you can type an expression in Python. Here are some examples of valid expressions:&lt;br /&gt;
&lt;br /&gt;
*Any real value: &amp;lt;source lang=python line=GESHI_NORMAL_LINE_NUMBERS&amp;gt;1.0&amp;lt;/source&amp;gt;&lt;br /&gt;
*Expressions with numbers and operators: &amp;lt;source lang=python line=GESHI_NORMAL_LINE_NUMBERS&amp;gt;4.5 + 8.9 * 7.0 - (2 / 3.0)&amp;lt;/source&amp;gt;&lt;br /&gt;
*Expressions also with variables: &amp;lt;source lang=python line=GESHI_NORMAL_LINE_NUMBERS&amp;gt;pi * 2 + 5.0&amp;lt;/source&amp;gt;&lt;br /&gt;
*Available data: &amp;lt;source lang=python line=GESHI_NORMAL_LINE_NUMBERS&amp;gt;bpy.data.scenes['Scene'].frame_start # the start frame&amp;lt;/source&amp;gt;&lt;br /&gt;
*A little math: &amp;lt;source lang=python line=GESHI_NORMAL_LINE_NUMBERS&amp;gt;sin(frame) # the sine of the current frame&amp;lt;/source&amp;gt;&lt;br /&gt;
*The variables added below the expression field, via their names set in the name field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Builtin resources and aliases ==&lt;br /&gt;
Pydrivers use their own global dictionary that is cached and only gets recreated when any expression fails. In this dictionary, a few modules are pre-imported, so that they can be used inside pydriver expressions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*All from &amp;lt;code&amp;gt;builtin&amp;lt;/code&amp;gt; (the default &amp;lt;code&amp;gt;builtin&amp;lt;/code&amp;gt; module)&lt;br /&gt;
*&amp;lt;code&amp;gt;bpy&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;bpy.mathutils.noise&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;math&amp;lt;/code&amp;gt;&lt;br /&gt;
*The current frame number (also for in-between frames, not only in integer numbers) as &amp;lt;code&amp;gt;frame&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example expression:'''&lt;br /&gt;
&amp;lt;source lang=python line=GESHI_NORMAL_LINE_NUMBERS&amp;gt;cos(pi * frame) / noise.random())&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding functions and variables to the namespace ==&lt;br /&gt;
&lt;br /&gt;
You can create your own functions and add your own variables without the restriction of the one-line Python expression. &lt;br /&gt;
&lt;br /&gt;
Acces to the namespace available to the drivers is achieved via bpy.app.driver_namespace, a read-only dictionary edited in-place. It is reset on file load and in new files, so rerunning the script that edits the namespace is necessary.&lt;br /&gt;
&lt;br /&gt;
'''Example of adding custom function in a script run from the text editor or python console:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=python line=GESHI_NORMAL_LINE_NUMBERS&amp;gt;  def driverFunc(val):&lt;br /&gt;
    return val * val&lt;br /&gt;
  bpy.app.driver_namespace['driverFunc'] = driverFunc&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All drivers can access this function from the expression directly.&lt;br /&gt;
'''Example expression:'''&lt;br /&gt;
&amp;lt;source lang=python line=GESHI_NORMAL_LINE_NUMBERS&amp;gt;driverFunc(frame) #the defined function with current frame as input value&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Let’s say we want to give our &amp;lt;code&amp;gt;Suzanne&amp;lt;/code&amp;gt; a perfect two BU radius circle movement in the (XY) plane. This is not easy to achieve with standard curves, as you have to create perfect sinusoidal ones (for those who lost their math, a perfect circle in a Cartesian plane is obtained with &amp;lt;code&amp;gt;x = sin(t)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;y = cos(t)&amp;lt;/code&amp;gt;…). So let’s use Python drivers:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;sin()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cos()&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;math&amp;lt;/code&amp;gt; functions take as input a ''radian'' value (i.e. a cycle takes &amp;lt;code&amp;gt;2π&amp;lt;/code&amp;gt; frames to complete), and output a value in range &amp;lt;code&amp;gt;[-1.0, 1.0]&amp;lt;/code&amp;gt;. So, to get a '''2BU''' radius circle fully walked in '''50''' frames, we have to use the following Python expression:&lt;br /&gt;
*For {{Literal|LocX}}: &amp;lt;source lang=python line=GESHI_NORMAL_LINE_NUMBERS&amp;gt;2.0 * sin(bpy.context.scene.frame_current*pi/25)&amp;lt;/source&amp;gt;&lt;br /&gt;
*For {{Literal|LocY}}: &amp;lt;source lang=python line=GESHI_NORMAL_LINE_NUMBERS&amp;gt;2.0 * cos(bpy.context.scene.frame_current*pi/25)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, &amp;lt;code&amp;gt;Suzanne&amp;lt;/code&amp;gt; will go in endless circles around the world’s origin (if you want to make it turn around another point, just add an offset to the above expressions, or drive {{Literal|dLoc…}} curves…).&lt;br /&gt;
&lt;br /&gt;
Note that:&lt;br /&gt;
*In the above example, we did not use F-curves.&lt;br /&gt;
*You can also get a perfect circular movement by using a [[Doc:2.4/Manual/Modeling/Curves|NURBS circle curve]] as a [[Doc:2.4/Manual/Animation/Techs/Object/Path|path]]…&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*[http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python extending Blender with python]&lt;br /&gt;
*[http://www.python.org Python] and its [http://www.python.org/doc documentation].&lt;br /&gt;
*This might be a good hunting ground for those looking for functions to try with pydrivers: http://functions.wolfram.com/ (newcomers are recommended to start with elementary ones, specially trigonometric).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Page/Footer|Doc:2.5/Manual/Animation/FCurve Modifiers|Doc:2.5/Manual/Animation/Dope Sheet}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Animation]]&lt;br /&gt;
[[Category:Editors]]&lt;br /&gt;
[[Category:FCurves]]&lt;br /&gt;
[[Category:Drivers]]&lt;br /&gt;
[[Category:Python]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Hjaarnio</name></author>
		
	</entry>
</feed>