Go to: Synopsis. Flags. Return value. MEL examples.
blendTwoAttr [-attribute string] [-attribute0 selectionItem] [-attribute1 selectionItem] [-blender selectionItem] [-controlPoints boolean] [-driver int] [-name string] [-shape boolean] [-time timeRange]
[objects]
blendTwoAttr is undoable, queryable, and editable.
A blendTwoAttr nodes takes two inputs, and blends the values of the inputs
from one to the other, into an output value. The blending of the two
inputs uses a blending function, and the following formula:
(1 - blendFunction) * input[0] + blendFunction * input[1]
The blendTwoAttr command can be used to blend the animation of an
object to transition smoothly between the animation of two other
objects.
When the blendTwoAttr command is issued, it creates a blendTwoAttr
node on the specified attributes, and reconnects whatever was previously
connected to the attributes to the new blend nodes. You may also
specify which two attributes should be used to blend together.
The driver is used when you want to keyframe an object after it is
being animated by a blend node. The current driver index specifies
which of the two blended attributes should be keyframed.
attribute, attribute0, attribute1, blender, controlPoints, driver, name, shape, time
| Long name (short name) |
[argument types] |
Properties |
-attribute(-at)
|
string
|

|
|
A list of attributes for the selected nodes for which a
blendTwoAttr node will be created.
|
|
-attribute0(-at0)
|
selectionItem
|
 
|
|
The attribute that should be connected to the first input
of the new blendTwoAttr node.
When queried, it returns a string.
In query mode, this flag needs a value.
|
|
-attribute1(-at1)
|
selectionItem
|
 
|
|
The attribute that should be connected to the second input
of the new blendTwoAttr node.
When queried, it returns a string.
In query mode, this flag needs a value.
|
|
-driver(-d)
|
int
|
 
|
|
The index of the driver attribute for this blend node (0 or 1)
When queried, it returns an integer.
In query mode, this flag needs a value.
|
|
-blender(-bl)
|
selectionItem
|
 
|
|
The blender attribute. This is the attribute that will be
connected to the newly created blendTwoAttr node(s) blender attribute.
This attribute controls how much of each of the two attributes
to use in the blend. If this flag is not specified, a new
animation curve is created whose value goes from 1 to 0
throughout the time range specified by the -t flag. If -t is not
specified, an abrupt change from the value of the first to the
value of the second attribute will occur at the current time
when this command is issued.
In query mode, this flag needs a value.
|
|
-time(-t)
|
timeRange
|
|
|
The time range between which the blending between the 2 attributes
should occur. If a single time is specified, then the blend will
cause an abrupt change from the first to the second attribute at
that time. If a range is specified, a smooth blending will occur
over that time range. The default is to make a sudden transition
at the current time.
|
|
-name(-n)
|
string
|

|
|
name for the new blend node(s)
In query mode, this flag needs a value.
|
|
-shape(-s)
|
boolean
|
|
|
Consider all attributes of shapes below transforms as well,
except "controlPoints". Default: true
|
|
-controlPoints(-cp)
|
boolean
|
|
|
Explicitly specify whether or not to include the
control points of a shape (see "-s" flag) in the list of attributes.
Default: false.
|
|
Flag can appear in Create mode of command
|
Flag can appear in Edit mode of command
|
Flag can appear in Query mode of command
|
Flag can be used more than once in a command
|
[string string ..]
The names of the blendTwoAttr dependency nodes that were created.
// Assume we have animated a bouncing sphere, sphere1, and we would like
// the sphere to smoothly transition into following a second sphere's,
// sphere2, animation between time 15 and 20.
//
select sphere1;
blendTwoAttr -at tx -at1 sphere2.tx -t "15:20";
blendTwoAttr -at ty -at1 sphere2.ty -t "15:20";
blendTwoAttr -at tz -at1 sphere2.tz -t "15:20";
// You can use the "-at" flag to narrow the query. For example, if
// you wanted to know the names of the newly created blender curves
// for only the tx and tz attributes of sphere1, you could say:
//
blendTwoAttr -at tx -at tz -query -blender;
// You can now keyframe the sphere2's animation by changing the
// driver on sphere1.
//
blendTwoAttr -at tx -edit -driver 1;
// setKeyframe ...
// If you already had two objects, sphere1 and sphere2 animated, and
// you wanted to blend between their animation abruptly at time 15,
// you could do:
//
blendTwoAttr -t 15 -at0 sphere1.tx -at1 sphere2.tx newObject.tx;
Return to Autodesk Index