アニメーション カーブのカラーを変更する
 
 
 

グラフ エディタ(Graph Editor)に表示されるアニメーション カーブにカスタム カラーを指定できます。

グラフ エディタからアニメーション カーブのカラーを変更する

アニメーション カーブのカラーを変更するには

  1. グラフ エディタ(Graph Editor)で、カラーを変更するカーブを選択します。
  2. 編集 > カーブ カラーの変更(Edit > Change Curve Color) を選択します。

    カーブ カラーの変更オプション(Change Curve Color Options)ウィンドウが表示されます。詳細については、 編集(Edit)メニューの「カーブ カラーの変更(Change Curve Color)」を参照してください。

  3. 選択したアニメーション カーブの新しいカラーを設定し、以下のいずれかを実行します。
    • カラー(Color)をクリックしてカレント カラーを適用し、カーブ カラーの変更オプション(Change Curve Color options)ウィンドウを閉じます。
    • 適用(Apply)をクリックしてカレント カラーをカーブに適用します。カーブ カラーの変更オプション(Change Curve Color Options)ウィンドウは開いたままにして続けて編集します。

    選択したカーブのカラーがカーブ カラーの変更オプション(Change Curve Color options)ウィンドウで指定したカラーに変更されます。

アトリビュート エディタ(Attribute Editor)または MEL を使用してアニメーション カーブのカラーを変更する

カーブ カラーの使用(Use Curve Color)カーブ カラー(Curve Color)アトリビュートを使用すれば、カーブのカラーを個別に設定する以外に、よりグローバルな操作を使用してカーブのグループに一度にカラーを設定することもできます。たとえば、これらのアトリビュートが適用されているキャラクタに基づいて特定のカーブにカラーを設定する、などのグローバル操作を行うことができます。このようなグローバル操作は、MEL スクリプトを使って行います。MEL スクリプトの例については、このセクションの「複数のアニメーション カーブのカラーをカスタマイズする MEL プロシージャの例」を参照してください。

アニメーション カーブにユーザが定義したカラー設定は、すべてグラフ エディタ(Graph Editor)のアウトライナとカーブ ビューに表示されます。カーブ カラーの使用(Use Curve Color)チェックボックスとカーブ カラー(Curve Color)サンプルは、各アニメーション カーブ ノード(animCurven など)のアニメーション カーブ アトリビュート(Anim Curve Attributes)セクションにあります。

注:カスタム カラーを設定したカーブは、最大で一度に 20 個表示できます。この数を超えると、カーブはそのデフォルトカラーで表示されます。

カーブのカスタム カラーとデフォルトカラーを切り替えるには

  1. カーブ カラーの使用(Use Curve Color)アトリビュートをオンまたはオフにします。

    カーブ カラーの使用は、各アニメーション カーブ ノード(animCurven など)のアニメーション カーブ アトリビュート(Anim Curve Attributes)セクションにあります。次の手順を参照してください。

アニメーション カーブにカスタム カラーを設定するには

  1. アニメートされたオブジェクトを選択します。
  2. グラフ エディタ(Graph Editor)を開きます。
  3. グラフ ビューでアニメーション カーブを選択します。
  4. カーブ > スプレッドシート(Curves > Spreadsheet)を選択します。

    アトリビュート エディタ(Attribute Editor)が開きます。

  5. animCurven タブのアニメーション カーブ アトリビュート(Anim Curve Attributes)セクションで、カーブ カラーの使用(Use Curve Color)をオンにします。
  6. カラー サンプル を ダブル クリックしてカラー チューザ(Color Chooser)を起動します。
  7. カラー チューザで、カーブのカスタム カラーを選択し、適用(Accept)をクリックします。

カラー チューザで選択したカラーがカーブ カラー(Curve Color)サンプルに表示されます。グラフ エディタ(Graph Editor)カーブ ビュー(Curve View)で、アニメーション カーブのカラーがカーブ カラー サンプルのカラーになります。

複数のアニメーション カーブのカラーをカスタマイズする MEL プロシージャの例

//+
//************************************************************************
//
// Synopsis:
// global proc int colourSelectedCurves( int $how, float $r,
// float $g, float $b )
//
// Description:
// This MEL procedure assigns a curve display color to all
// selected curves and curves connected to selected nodes. The curve display
// color is used for drawing curves in the Graph Editor and for labelling
// curves in the Dope Sheet.
// The following example creates a cube, torus, and sphere, animates them by
// creating translation curves for each, then selects the cube and sphere and
// sets their curve colors as magenta. 
// If you then select all three objects and open the Graph Editor, the curves
// associated with the cube and sphere appear magenta and the curves
// associated with the torus appear their default colours.

// Parameters:
// int $how : (in) Specifies how the "useCurveColour"
// attribute is set for each curve.
// If 1, curves will display with the
// newly assigned colour; if 0, curves
// will display in default colour.
// float $r : (in) Red component of colour to assign.
// float $g : (in) Green component of colour to assign.
// float $b : (in) Blue component of colour to assign.
//
// Returns:
// int numCurves : Returns the number of curves a colour
// was assigned to.
//
//************************************************************************
//-
global proc int colourSelectedCurves( int $how, float $r, float $g,
 float $b )
{
 int $count;
 int $i;
 int $j;
 // Get the list of selected nodes.
 //
 string $selectionList[] = `ls -sl`;
 // Assign colours based on the selected set of nodes.
 //
 $count = 0;
 for ( $i = 0; $i < size( $selectionList ); $i++ ) {
 string $s = $selectionList[$i];
 string $isCurve[] = `ls -type "animCurve" $s`;
 if ( size( $isCurve ) != 0 ) {
 // A curve is selected: assign it the specified colour.
 //
 setAttr ($s + ".useCurveColor") $how;
 setAttr ($s + ".curveColorR") $r;
 setAttr ($s + ".curveColorG") $g;
 setAttr ($s + ".curveColorB") $b;
 $count++;
 } else {
 // A non-curve node is selected: assign all curves which
 // are directly connected to it the specified colour.
 //
 string $connectedNodes[] = `listConnections $s`;
 for ( $j = 0; $j < size( $connectedNodes ); $j++ ) {
 string $c = $connectedNodes[$j];
 string $isCurve[] = `ls -type "animCurve" $c`;
 if ( size( $isCurve ) != 0 ) {
 // We are connected to a curve; assign it the
 // specified curve colour.
 //
 setAttr ($c + ".useCurveColor") $how;
 setAttr ($c + ".curveColorR") $r;
 setAttr ($c + ".curveColorG") $g;
 setAttr ($c + ".curveColorB") $b;
 $count++;
 // Return the number of curves we set the colour on.
 //
 return( $count );
Here is an example of how to test the above procedure:
// Create three animated objects
//
string $c[] = `polyCube`;
move 10 2 3;
setKeyframe ($c[0]+".t");
currentTime 16;
move 10 -2 3;
setKeyframe ($c[0]+".t");
string $t[] = `torus`;
currentTime 1;
move -10 -2 -3;
setKeyframe ($t[0]+".t");
currentTime 16;
move 10 -2 -3;
setKeyframe ($t[0]+".t");
string $s[] = `sphere`;
currentTime 1;
move -10 -2 3;
setKeyframe ($s[0]+".t");
currentTime 16;
move 10 -2 -3;
setKeyframe ($s[0]+".t");
// Set the colour of the cube and sphere to magenta,
//
select $c[0] $s[0];
colourSelectedCurves( 1, 1.0, 0.0, 1.0 );