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

 
 
 

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

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

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

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

    カーブ カラーの変更オプション(Change Curve Color Options)ウィンドウが表示されます(編集(Edit)メニューで、カーブ カラーの変更(Change Curve Color) > 参照)

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

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

カーブ カラーをアトリビュート名と関連付ける

カーブ カラーをアトリビュート名と関連付けるには

  1. カーブ カラーに割り当てるアトリビュートのアニメーション カーブを持つオブジェクトを選択します。
  2. グラフ エディタ(Graph Editor) (ウィンドウ > アニメーション エディタ > グラフ エディタ(Window > Animation Editor > Graph Editor))で、カラーに関連付けるアトリビュートを選択します。
  3. グラフ エディタメニュー バーから、編集 > カーブ カラーの設定(Edit > Set Curve Colors)を選択します。

    カーブ カラー(Curve Colors)ウィンドウが表示され、左側のパネルに選択したアトリビュートの一覧が表示されます。

    ヒント:

    グラフ エディタ(Graph Editor)のアウトライナで選択してカーブ カラー(Curve Colors)ウィンドウの追加(Add)をクリックすれば、いつでもアトリビュートをロードできます。

  4. アトリビュートに独自のカラーを割り当てる場合は、次の操作を実行します。
    • カーブ カラー(Curve Colors)ウィンドウでアトリビュートを選択します。
    • カラー サンプルをクリックしてカラー ヒストリ(Color History)設定を開きます。
    • カーブ カラー ウィンドウで、必要なカラーを選択します。

    これでアトリビュートを制御するアニメーション カーブが、割り当てたカラーに設定されます。

カーブ カラーをリセットするには

  1. グラフ エディタのアウトライナでアトリビュートを選択し、編集 > カーブ カラーの設定(Edit > Set Curve Colors)を選択します。
  2. 表示されるカーブ カラー(Curve Colors)ウィンドウでアトリビュート名を選択します。
  3. 除去(Remove)をクリックします。

    アニメーション カーブが既定のカラーにリセットされます。

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

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

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

注:

カスタム カラーを設定したカーブは、最大で一度に 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 History)設定を起動します。
  7. カラー ヒストリ設定で、カーブのカスタム カラーを選択します。

選択したカラーがカーブ カラー(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 );