ポーズの名称を「_onLButtonDown」と変更することで、そのポーズをマウスクリック・イベントとリンクさせることができます。
また、「_onLButtonDown」のパラメータを変更することで、モデル全体、あるいは一部のグループをマウスクリック・イベントの発生場所として指定することができます。
※訳注 原文では「マウスクリック・イベント」という表現ではなく「on3dLButtonDown/on3dLButtonUp」
____というarcticPigs 3D viewer APIのイベント名で書かれています。
※訳注 「ポーズ命名規則」と重複している内容は割愛しました。
_onLButtonDown( [Frames fadeIn] [Frames fadeOut] [flags] ) [groupname]
※訳注 「_onLButtonDown」の部分は、大文字小文字のどちらでも可、全角不可です。
※訳注 [...]、(...)ともに省略可能です。
※例 _onLButtonDown
____onlbuttondown
____onLButtonDown(15)
____onLButtonDown(15 10)
____onLButtonDown(15 10)hand
____onLButtonDown(15 10 t)hand
- Frames fadeIn
- 省略可能(省略時の値は0。Frames fadeOutを記述する際は省略できない。)
左クリックした際のフェードイン(ポーズスライダーが+1から+100へ等速移動する)に要する時間を「30FPS」換算で指定できる。例えば、90とした場合、3秒間を意味する。
- Frames fadeOut
- 省略可能(省略時の値は0)。
左クリックを放した際のフェードアウト(ポーズスライダーが+100から+1へ等速移動する)に要する時間を「30FPS」換算で指定できる。例えば、90とした場合、3秒間を意味する。
- flags
- 省略可能。
R
アクション・ブレンドを置き換えモード(Replace mode)に切り替える。
省略時は、加算モード(Add mode)。
加算モードの場合、シーンで進行中のアクションに対して新たなアクション(ポーズ)が単純に加えられていくが、置き換えモードの場合は、進行中のアクションが新たなアクション(ポーズ)に置き換わる。例えば、歩行アクションの途中で立ち止まったりする場合に、このモードは重宝するだろう。
T
トグルモード(Toggle mode)に切り替える。
このモードでは、1回目のクリックでフェードインしたポーズを、2回目のクリックでフェードアウトするまで継続させることができる。例えば、ON/OFFスイッチなどのギミックに使用すると面白いだろう。
- groupname
-
- 省略可能(省略時は、モデル全体がマウスイベントの対象範囲になる)。
特定のポーズと特定のグループをリンクさせる場合に、そのグループ名を記述する。
※訳注 ひとつのグループに複数のポーズをリンクすることはできませんが、同じ選択範囲のグループを別名で複数作成し、それぞれを別のポーズにリンクさせることは可能です。この方法を使用することで、ひとつの選択範囲に対して異なるポーズを複数設定することができるようになります。
参照: ポーズ命名規則(POSE naming conventions)
Defines a pose that will be executed when the model (or group) is clickedBy naming a pose _onLButtonDown you indicate to the arcticPigs viewer that you want to linking this pose to a on3dLButtonDown / on3dLButtonUp event. You can link the pose to the whole model, or if you specify a group name, you can link these effects to only part of your model.
If the mouse event occurs, the pose gets 'executed' by moving the pose slider to +100. The time the viewer takes to do this slide can be specified. As soon as you release the mous button the pose slider will be put back to +1. The time taken for this move can be given independently of the fade-in time.
We chose +1 as the 'inactive' slider value as Animation Master will not allow you to enter keyframe data at the t=0 point of your pose. By using +1 you have maximum flexibility in defining your rollover effects.
Using the flags you can also specify if the pose action should be executed as an 'add' or as a 'replace' type action. The default is 'add' which will simply add the action to whatever else is going on in your scene. The replace option will override any actions that may be playing on your model.
_onLButtonDown( [Frames fadeIn] [Frames fadeOut] [flags] ) [groupname]
- fadeIn
- Optional value. The number you enter here is taken to mean the number of frames (at 30 FPS) you want the viewer to take over the fade in. The fade in is a linear move from +1 to +100 on the pose slider value.
- fadeOut
- Optional value. The number you enter here is taken to mean the number of frames (at 30 FPS) you want the viewer to take over the fade out. The fade in is a linear move from +100 to +1 on the pose slider value
- flags
- The flags can have the following (optional) value(s)
R This puts the blend into replace mode. By default the pose action is blended as an add type blend. This will simply add the action to whatever else is going on in your scene. The replace option will override any actions that may be playing on your model with those you defined in the pose.
T Toggle mode. In this mode the blend is always executed till the final value over the time you specified for the fadeIn value. The pose then stays at this value, even if the mouse has moved out of this group or model in the meantime. A second 'touch' will start the fade out.
- groupname
- Optional value. If specified, the pose will only execute if the mouse is over the specified group. Else the rollover effect starts if the mouse is anywhere over the model.