| On this page |
APEX Autorig Component SOPは、リグコンポーネントスクリプトの使用、APEX Scriptスニペットを受け入れる組み込みのコードインターフェース、グラフから既存のリグへとリグ機能を統合する機能など、独自のカスタムツールを作成するための様々な方法を提供します。
APEX Scriptを使用してカスタム機能を作成する ¶
APEX Autorig Component SOPには、APEX Scriptコードを記述するためのインターフェースが用意されています。APEX Autorig Component SOPで、 Component Source を Snippet に設定します。 Snippet パラメータにAPEX Scriptコードを入力するか、スクリプト機能を独自のリグコンポーネントとして保存します。
グラフ機能を既存のリグに結合する ¶
APEX Autorig Component SOPでFuseグラフオペレーションを使用すると、(Fuseグラフと呼ばれる)グラフを既存のリグに結合することができます。 この方法では、キャラクタリグから開始し、更新したいリグの部分を抽出して、APEXネットワークビューでその機能を編集してから、その更新内容をリグに結合して戻すことが可能です。モジュール方式のワークフローを使用して、リグに変更を加えることができます。
Fuseグラフオペレーションは、APEX Graph SOPで導入された新しいノードを追加、接続します。ノードを接続し直したり、削除することはありません。
Note
Fuseグラフ(APEX Graph SOP)内のサブネットに、新しいノードを配置することは推奨されていません。 後でそのサブネットの名前を変更した場合、グラフが機能しなくなります。 また、Fuseグラフオペレーションでは、Fuseグラフ内の既存のノードを新しいサブネットに追加することはできません。 ただし、既存のリグに対して、完全に新しいサブネットを挿入することは可能です。
このページでは、以下のFuseグラフオペレーションの使い方を説明しています:
-
コントロールシェイプをリグに追加する。
-
カスタムのIK機能をリグに追加する。
コントロールシェイプを追加する ¶
この例では、キャラクタの背骨のジョイントにコントロールシェイプを追加します:
-
まずキャラクタのスケルトンを、
APEX Pack Character SOPを使用してキャラクタフォルダ構造に追加します。
-
FKリググラフを作成します。
APEX Autorig Component SOP(
fk)で、 Component Source を FK Transform に設定します。FKトランスフォームコンポーネントについての詳細は、単純なジオメトリのリギングとキャラクタリギングを参照してください。FKリググラフは、APEXネットワークビューで確認できます。緑色のノードは、スケルトンのジョイントを表す
TransformObjectノードです:
FKリググラフ -
APEX Graph SOP内でFuseグラフを構築します。 そのAPEX Graph SOPは、キャラクタフォルダ構造を受け取り、そのキャラクタフォルダ構造内のリググラフを自動的に検索することができます。また、 Graph Path パラメータを設定することで、キャラクタフォルダ構造にある特定のリグを検索するようにAPEX Graph SOPに指示することも可能です。APEX Graph SOPに開始点となるグラフが入力されると、APEXネットワークビューでそのグラフを手動で編集できるようになります。
この例では、APEX Graph SOPに、FKリググラフ全体のコピーが開始点として含まれています。この状態から、APEXネットワークビューでの作業が容易になるように、グラフを簡素化することも可能です。
-
APEX Graph SOPを選択し、APEXネットワークビューに移動して手動でグラフを更新します。新しい
rig::ControlShapeノードを背骨のTransformObjectノードの1つに接続することで、コントロールシェイプを背骨ジョイントに追加します:
背骨のコントロールシェイプを追加 -
rig::ControlShapeノードを選択し、APEXネットワークビューでPを押してノードパラメータウィンドウを開きます。 color を
(1,0,0)、 shapetype をbox_wiresに設定します。 -
Animateステートでは、APEXネットワークビューでグラフを更新するとき、ビューポート上でリグの視覚的な表現を確認できます。Animateステートに入るには、APEX Graph SOPを選択し、そのDisplayフラグをオンにして、左側のツールバーにある
Animateをクリックします:
元のリグ(左)、背骨のコントロールシェイプを追加(右) -
APEX Graph SOPからのグラフを元のFKリググラフに結合します。2つ目のAPEX Autorig Component SOPの
merge_graphで、 Component Source を Fuse Graph に設定します。Fuseグラフオペレーションが新しいノードを検索し、それを元のグラフに接続します。APEX Autorig Component SOPの
merge_graphのAPEXネットワークビューで、1つ目のAPEX Autorig Component SOPのfkからのFKリググラフに、rig::ControlShapeノードが追加されます。新しいノードは緑色です:
新しいノードで更新されたFKリググラフ
グラフを簡素化する ¶
変更がリグの特定の部分にのみ影響する場合は、変更に関係のないTransformObjectノードを削除することで、グラフを簡素化することができます:
-
開始点として、APEX Graph SOPには前の例からのFKリググラフが含まれています。
spine_01ノードを除くすべてのTransformObjectノードを削除します:
skel::SetPointTransformsノードに関する詳細は、ジオメトリ変形のためのグラフを参照してください。
-
このプロセスでは
spine_01の親を削除してしまっているため、スケルトン上の適切な位置にジョイントを配置し直す必要があります:-
APEX Graph SOPの Rigging Scripts セクションで、 Update Rest Transforms From Skeleton をクリックします。
-
APEX Graph SOPでAnimateステートに入り、背骨ジョイント上のTransformObjectノードを確認します:
-
-
新しいrig::ControlShapeノードを背骨のTransformObjectノードに接続することで、背骨ジョイントにコントロールシェイプを追加します。
-
rig::ControlShapeノードを選択します。
-
ノードパラメータウィンドウで、 color を
(1,0,0)、 shapetype をbox_wiresに設定します。
追加したコントロールシェイプはAnimateステートで確認できます:
-
-
APEX Autorig Component SOPの
merge_graphにおけるFuseグラフオペレーションは、新しいノードのrig::ControlShapeを検索し、それを元のFKリググラフのspine_01TransformObjectノードに接続します。
カスタムのIK機能を追加する ¶
Fuseグラフオペレーションでは、キャラクタのリグの様々な部分に適用可能な、柔軟性の高いツールを作成することができます。 この例では、キャラクタの脚にIK機能を追加するFuseグラフを手動で構築します。その後、そのIK機能をキャラクタの両腕にミラーおよび転送します:
-
APEX Graph SOPで、キャラクタの脚のIK機能を含んだFuseグラフを手動で構築します。
Note
Fuseグラフ内のTransformObjectノードの名前は、入力スケルトンのジョイント名に合わせてください。
APEX Graph SOPを選択して、そのDisplayフラグを有効にして、Animateステートに入ります:
-
APEX Autorig Component SOPの
merge_graphで、 Component Source を Fuse Graph に設定します。Fuseグラフオペレーションにより、新しいIK機能が元のFKリググラフに追加されます。 -
APEX Autorig Component SOPの
merge_graphを選択し、そのDisplayフラグをオンにして、Animateステートに入ります。 -
IK機能をリグの両側にミラーされるように設定します。リグで、ジョイントには
<joint>_lや<joint>_rという名前が付けられているので、 From と To パラメータを*_lと*_rに変更します。 Mirror パラメータは既にオンになっているので、正確なジョイント名のマッピングが設定されると、デフォルトでミラーリングが実行されます:
両脚にミラーリングされたIK機能 -
これで、IK機能を腕などの他のジョイントチェーンへ転送することができます。 Mapping の横にある
をクリックし、IKチェーンのルート、中間、先端の各ジョイントに対して1つずつ、計3つのマッピングを追加します。マッピングは、スケルトンジョイントを表すTransformObjectノード間で行なわれます。
-
マッピングする各ジョイントについて:
-
From パラメータの横にある
アイコンをクリックします。これは、既存の機能が設定されているジョイントです。
-
ビューポートでジョイントを選択してEnterを押します。これにより、 From パラメータにそのジョイント名が入力されます。
Note
ジョイントを選択します。ジョイント上のコントロールではありません。
-
To パラメータの横にある
アイコンをクリックします。これは、機能を適用したいジョイントです。
-
ビューポートでジョイントを選択してEnterを押します。これにより、 To パラメータにそのジョイント名が入力されます。
この例の場合、3つのマッピングは以下の通りです:
-
From =
thigh_l、 To =upperarm_l -
From =
calf_l、 To =lowerarm_l -
From =
foot_l、 To =hand_l
-
-
IK機能が両腕に配置されています:
リグ機能を保存して再利用する ¶
カスタムのリグ機能を独自のリグコンポーネントとして保存したら、事前構築済みコンポーネントと同じように再利用することができます:
-
APEX Autorig Component SOPで、 Save タブに移動します。 Save タブは、 Component Source が Use Second Input 、 Snippet 、 Fuse Graph に設定されている時に利用可能です。
-
Component Name パラメータでコンポーネントの名前を指定します。例えば、ネームスペースフィールドを
testに、名前フィールドをhello、バージョンを2.0に設定した場合、コンポーネント名はtest::hello::2.0になります。 -
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.
-
In the Component Output File, set the path to save the component to. Save the file under
$HOUDINI_PATH/apexcomponent/<component_name>.bgeo. -
Save to Disk をクリックします。
-
Component Source パラメータの横にある
をクリックし、コンポーネントのライブラリを更新します。新しいコンポーネントが Component Source ドロップダウンメニューに表示され、他のコンポーネントと同じように使用することができます。
-
Component Source ドロップダウンメニューで新しいコンポーネントを選択すると、そのソースをAPEX Scriptスニペットとして編集できるようになります。 Component Source の横にある
をクリックすると、コンポーネントが Snippet パラメータに逆コンパイルされ、コンポーネントにさらに変更を加えることができます。
Note
Fuse Graph オペレーションを使用して作成されたコンポーネントの場合は、 Settings ▸ Header セクションに移動し、 Template を Fuse 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:
-
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.
-
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 thebutton 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()). -
-
Set Drag Drop Interaction to Skeleton.
-
Set the Skeleton Source.
-
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.
-
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.
-
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:
-
On the APEX Autorig Component SOP, Save tab, turn on Use with Rig Builder.
-
Set Drag Drop Interaction to Skeleton.
-
Set Skeleton Source to From Guide Skeleton. This uses the skeleton specified in Guide Skeleton.
-
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, andfoot_l. -
Click Accept.
The Joint Group parameter is populated with the selected joints.
-
-
Set Remove Side Indicator to
*_l. This removes*_lfrom the joint names so that the component can be used on both sides of the character. -
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.