Houdini 21.0 キャラクタ KineFX

カスタムリグ機能を作成する

On this page

APEX Autorig Component SOPは、リグコンポーネントスクリプトの使用、APEX Scriptスニペットを受け入れる組み込みのコードインターフェース、グラフから既存のリグへとリグ機能を統合する機能など、独自のカスタムツールを作成するための様々な方法を提供します。

APEX Scriptを使用してカスタム機能を作成する

APEX Autorig Component SOPには、APEX Scriptコードを記述するためのインターフェースが用意されています。APEX Autorig Component SOPで、 Component SourceSnippet に設定します。 Snippet パラメータにAPEX Scriptコードを入力するか、スクリプト機能を独自のリグコンポーネントとして保存します。

グラフ機能を既存のリグに結合する

APEX Autorig Component SOPでFuseグラフオペレーションを使用すると、(Fuseグラフと呼ばれる)グラフを既存のリグに結合することができます。 この方法では、キャラクタリグから開始し、更新したいリグの部分を抽出して、APEXネットワークビューでその機能を編集してから、その更新内容をリグに結合して戻すことが可能です。モジュール方式のワークフローを使用して、リグに変更を加えることができます。

グラフを既存のリグに結合するためのワークフロー

Fuseグラフオペレーションは、APEX Graph SOPで導入された新しいノードを追加、接続します。ノードを接続し直したり、削除することはありません。

Note

Fuseグラフ(APEX Graph SOP)内のサブネットに、新しいノードを配置することは推奨されていません。 後でそのサブネットの名前を変更した場合、グラフが機能しなくなります。 また、Fuseグラフオペレーションでは、Fuseグラフ内の既存のノードを新しいサブネットに追加することはできません。 ただし、既存のリグに対して、完全に新しいサブネットを挿入することは可能です。

このページでは、以下のFuseグラフオペレーションの使い方を説明しています:

  • コントロールシェイプをリグに追加する。

  • カスタムのIK機能をリグに追加する。

コントロールシェイプを追加する

この例では、キャラクタの背骨のジョイントにコントロールシェイプを追加します:

  1. まずキャラクタのスケルトンを、APEX Pack Character SOPを使用してキャラクタフォルダ構造に追加します。

  2. FKリググラフを作成します。APEX Autorig Component SOP(fk)で、 Component SourceFK Transform に設定します。FKトランスフォームコンポーネントについての詳細は、単純なジオメトリのリギングキャラクタリギングを参照してください。

    FKリググラフは、APEXネットワークビューで確認できます。緑色のノードは、スケルトンのジョイントを表すTransformObjectノードです:

    FKリググラフ
  3. APEX Graph SOP内でFuseグラフを構築します。 そのAPEX Graph SOPは、キャラクタフォルダ構造を受け取り、そのキャラクタフォルダ構造内のリググラフを自動的に検索することができます。また、 Graph Path パラメータを設定することで、キャラクタフォルダ構造にある特定のリグを検索するようにAPEX Graph SOPに指示することも可能です。APEX Graph SOPに開始点となるグラフが入力されると、APEXネットワークビューでそのグラフを手動で編集できるようになります。

    この例では、APEX Graph SOPに、FKリググラフ全体のコピーが開始点として含まれています。この状態から、APEXネットワークビューでの作業が容易になるように、グラフを簡素化することも可能です。

  4. APEX Graph SOPを選択し、APEXネットワークビューに移動して手動でグラフを更新します。新しいrig::ControlShapeノードを背骨のTransformObjectノードの1つに接続することで、コントロールシェイプを背骨ジョイントに追加します:

    背骨のコントロールシェイプを追加
  5. rig::ControlShapeノードを選択し、APEXネットワークビューでPを押してノードパラメータウィンドウを開きます。 color(1,0,0)shapetypebox_wiresに設定します。

  6. Animateステートでは、APEXネットワークビューでグラフを更新するとき、ビューポート上でリグの視覚的な表現を確認できます。Animateステートに入るには、APEX Graph SOPを選択し、そのDisplayフラグをオンにして、左側のツールバーにある Animateをクリックします:

    元のリグ(左)、背骨のコントロールシェイプを追加(右)
  7. APEX Graph SOPからのグラフを元のFKリググラフに結合します。2つ目のAPEX Autorig Component SOPのmerge_graphで、 Component SourceFuse Graph に設定します。Fuseグラフオペレーションが新しいノードを検索し、それを元のグラフに接続します。

    APEX Autorig Component SOPのmerge_graphのAPEXネットワークビューで、1つ目のAPEX Autorig Component SOPのfkからのFKリググラフに、rig::ControlShapeノードが追加されます。新しいノードは緑色です:

    新しいノードで更新されたFKリググラフ

グラフを簡素化する

変更がリグの特定の部分にのみ影響する場合は、変更に関係のないTransformObjectノードを削除することで、グラフを簡素化することができます:

  1. 開始点として、APEX Graph SOPには前の例からのFKリググラフが含まれています。spine_01ノードを除くすべてのTransformObjectノードを削除します:

    skel::SetPointTransformsノードに関する詳細は、ジオメトリ変形のためのグラフを参照してください。

  2. このプロセスではspine_01の親を削除してしまっているため、スケルトン上の適切な位置にジョイントを配置し直す必要があります:

    • APEX Graph SOPの Rigging Scripts セクションで、 Update Rest Transforms From Skeleton をクリックします。

    • APEX Graph SOPでAnimateステートに入り、背骨ジョイント上のTransformObjectノードを確認します:

  3. 新しいrig::ControlShapeノードを背骨のTransformObjectノードに接続することで、背骨ジョイントにコントロールシェイプを追加します。

    • rig::ControlShapeノードを選択します。

    • ノードパラメータウィンドウで、 color(1,0,0)shapetypebox_wiresに設定します。

    追加したコントロールシェイプはAnimateステートで確認できます:

  4. APEX Autorig Component SOPのmerge_graphにおけるFuseグラフオペレーションは、新しいノードのrig::ControlShapeを検索し、それを元のFKリググラフのspine_01 TransformObjectノードに接続します。

カスタムのIK機能を追加する

Fuseグラフオペレーションでは、キャラクタのリグの様々な部分に適用可能な、柔軟性の高いツールを作成することができます。 この例では、キャラクタの脚にIK機能を追加するFuseグラフを手動で構築します。その後、そのIK機能をキャラクタの両腕にミラーおよび転送します:

  1. APEX Graph SOPで、キャラクタの脚のIK機能を含んだFuseグラフを手動で構築します。

    Note

    Fuseグラフ内のTransformObjectノードの名前は、入力スケルトンのジョイント名に合わせてください。

    APEX Graph SOPを選択して、そのDisplayフラグを有効にして、Animateステートに入ります:

  2. APEX Autorig Component SOPのmerge_graphで、 Component SourceFuse Graph に設定します。Fuseグラフオペレーションにより、新しいIK機能が元のFKリググラフに追加されます。

  3. APEX Autorig Component SOPのmerge_graphを選択し、そのDisplayフラグをオンにして、Animateステートに入ります。

  4. IK機能をリグの両側にミラーされるように設定します。リグで、ジョイントには<joint>_l<joint>_rという名前が付けられているので、 FromTo パラメータを*_l*_rに変更します。 Mirror パラメータは既にオンになっているので、正確なジョイント名のマッピングが設定されると、デフォルトでミラーリングが実行されます:

    両脚にミラーリングされたIK機能
  5. これで、IK機能を腕などの他のジョイントチェーンへ転送することができます。 Mapping の横にあるをクリックし、IKチェーンのルート、中間、先端の各ジョイントに対して1つずつ、計3つのマッピングを追加します。マッピングは、スケルトンジョイントを表すTransformObjectノード間で行なわれます。

  6. マッピングする各ジョイントについて:

    • From パラメータの横にあるアイコンをクリックします。これは、既存の機能が設定されているジョイントです。

    • ビューポートでジョイントを選択してEnterを押します。これにより、 From パラメータにそのジョイント名が入力されます。

      Note

      ジョイントを選択します。ジョイント上のコントロールではありません。

    • To パラメータの横にあるアイコンをクリックします。これは、機能を適用したいジョイントです。

    • ビューポートでジョイントを選択してEnterを押します。これにより、 To パラメータにそのジョイント名が入力されます。

    この例の場合、3つのマッピングは以下の通りです:

    • From = thigh_lTo = upperarm_l

    • From = calf_lTo = lowerarm_l

    • From = foot_lTo = hand_l

  7. IK機能が両腕に配置されています:

リグ機能を保存して再利用する

カスタムのリグ機能を独自のリグコンポーネントとして保存したら、事前構築済みコンポーネントと同じように再利用することができます:

  1. APEX Autorig Component SOPで、 Save タブに移動します。 Save タブは、 Component SourceUse Second InputSnippetFuse Graph に設定されている時に利用可能です。

  2. Component Name パラメータでコンポーネントの名前を指定します。例えば、ネームスペースフィールドをtestに、名前フィールドをhello、バージョンを2.0に設定した場合、コンポーネント名はtest::hello::2.0になります。

  3. You can also specify a label (Component Label) for your component as well as a .png file (Component Icon) to use as an icon for the component in the Autorig Builder’s component catalog HUD.

  4. In the Component Output File, set the path to save the component to. Save the file under $HOUDINI_PATH/apexcomponent/<component_name>.bgeo.

  5. Save to Disk をクリックします。

  6. Component Source パラメータの横にあるをクリックし、コンポーネントのライブラリを更新します。新しいコンポーネントが Component Source ドロップダウンメニューに表示され、他のコンポーネントと同じように使用することができます。

  7. Component Source ドロップダウンメニューで新しいコンポーネントを選択すると、そのソースをAPEX Scriptスニペットとして編集できるようになります。 Component Source の横にあるをクリックすると、コンポーネントが Snippet パラメータに逆コンパイルされ、コンポーネントにさらに変更を加えることができます。

    Note

    Fuse Graph オペレーションを使用して作成されたコンポーネントの場合は、 Settings ▸ Header セクションに移動し、 TemplateFuse Graph に設定します。

Preparing components for the Autorig Builder

On the APEX Autorig Component SOP, you can make a custom component available as an interactive tool for the Autorig Builder using the parameters in the Rig Builder tab. The Rig Builder tab is available when Use with Rig Builder is turned on in the Save tab.

To prepare a custom component for use in the Autorig Builder:

  1. If applicable, define a “segments” parameter that specifies where to apply the component. The Autorig Builder picks up on the “segments” keyword and allows the user to apply the component to different parts of the character in the drag-and-drop interaction. In APEX Script, you could define the “segments” parameter with something like:

    segments: String = BindInput('', preset='tags')
    

    If you create the component using an APEX graph, you would have “segments” as an input parameter.

  2. In the Rig Builder tab, specify the component’s input parameters that you want to appear in the Autorig Builder’s gear menu:

    • Click Generate from Component Parms to automatically populate the Config Control Parms multiparm with the component’s parameters that are in the parameter interface. For APEX Script, define the input parameters with BindInput(), then click the button to have the parameters appear in the parameter editor. See creating graph interfaces for more information.

      or

    • Manually add the parameters to the Config Control Parms multiparm.

    For the component parameters that are not specified in Config Control Parms, the Autorig Builder uses the default values that are set on the parameter (for example, when defining the parameter using BindInput()).

  3. Set Drag Drop Interaction to Skeleton.

  4. Set the Skeleton Source.

  5. In the Joint Group parameter, select the joints in the Skeleton Source that are relevent to the component. For example, if you build a component that adds functonality to the arm, only the arm joints of the left side of the character should be included in this parameter. These joints are used as a reference skeleton when performing the drag-and-drop interaction in the Autorig Builder.

  6. Set the Remove Side Indicator. This pattern is removed from the joint names so that the component can be used on both sides of the character.

  7. Save the component.

  8. On the APEX Autorig Builder SOP, click the icon to update your library of rig components. Your new component will appear in the component catalog HUD, and you can drag and drop it onto your guide character like any other component.

Component created using fuse graph

In this example, we prepare the previous IK leg functionality for use in the Autorig Builder:

  1. On the APEX Autorig Component SOP, Save tab, turn on Use with Rig Builder.

  2. Set Drag Drop Interaction to Skeleton.

  3. Set Skeleton Source to From Guide Skeleton. This uses the skeleton specified in Guide Skeleton.

  4. In the Joint Group parameter, select the joints that the component applies to. These joints provide default positions for the fuse graph’s TransformObject nodes. The TransformObject node names in the fuse graph should match the joint names of the input skeleton:

    • Click the button beside Joint Group.

    • In the rig tree view, select the joints, in our case, thigh_l, calf_l, and foot_l.

    • Click Accept.

    The Joint Group parameter is populated with the selected joints.

  5. Set Remove Side Indicator to *_l. This removes *_l from the joint names so that the component can be used on both sides of the character.

  6. Save the component.

  7. On the APEX Autorig Builder SOP, click the icon to update your library of rig components. Your new component will appear in the component catalog HUD, and you can drag and drop it onto your guide character.

KineFX

概要

キャラクタ要素の準備

APEXグラフを使用したリギング

APEXスクリプトを使用したリググラフの構築

リグコンポーネントを使用したリギング

ビューポート内でアニメーションを付ける

SOPベースのアニメーション

変形

アニメーションのリターゲット

H20以前

ペイン

別表