Motion :: MvT Swap EPs ::

ASTER::ACTION::ObjectControl::motion::MoveTowards::Swap Group.A-B Each Xy Coordinates

MoveTowards :: Swap EPs

選択済みインスタンス 「群.A」 と 「群.B」 の X y 位置を指定された「フレーム時間内」に入れ替えます。

ASTER の MoveTowards ではユーザ操作で任意インスタンスを 群.A と 群.B にグループ分けし、その選択を記録する補助機能として MvtUtil があります。

群.A と群.B を本ドキュメントでは便宜上、群.A を Target と、群.B を Pursuer と呼称します。

Once the movement is completed, the motion group is automatically deregistered. Even after the motion group is deregistered, the selection information of instances chosen as mvt.Tgt or mvt.Prs remains.


利用する前に

MvT::Swap EPs は MoveTowards ( MvT ) 動作の一種、インスタンス同士の位置を交換する命令です。

インスタンス同士がペアを作り、時間遷移の中で互いの位置を入れ替える動作を Swap と定義します。

  • Target 同士の MvT :: Swap を Swap Tgt

  • Target と Pursuer の Mvt :: Swap を Swap EPs

Definition of Pair Name Description
Target のみ Swap Tgt ターゲットを 2 つ 選択してペアを作る
Target と Pursuer Swap EPs ターゲットと追跡者で分割選択してペアを作る

Swap EPs は事前にインスタンスを TargetPursuer でそれぞれ選択し、これらインスタンスを 1 グループにまとめてグループ名を付け、グループに所属するインスタンスに MvT :: Swap EPs 動作を適用し動作コントローラへ登録します。

TargetPursuer の選択は MoveTowards 用に設計された以下 Utility が利用できます。Utility は複数インスタンスの選択と解除を補助、イベント製作簡略化に寄与します。

  1. ASTER :: Action :: ObjControl :: Motion :: MvtUtil :: Config Max Num of Slct Oi Tgt & Prs

  2. ASTER :: Action :: ObjControl :: Motion :: MvtUtil :: Select a Target or DeSelect

  3. ASTER :: Action :: ObjControl :: Motion :: MvtUtil :: Select a Pursuer or DeSelect

  4. ASTER :: Action :: ObjControl :: Motion :: MvtUtil :: Reset All Selection ( Target & Pursuer )

  5. ASTER :: Expression :: ObjControl :: MvtUtil :: Get Num of Instances selected as Target

  6. ASTER :: Expression :: ObjControl :: MvtUtil :: Get Num of Instances selected as Pursuer

JSON と連携し、Target 選択をエクスポートすることもできます。

  1. ASTER :: Action :: JSON :: MvtUtil :: Create Array with Fixed Val of Targeted Oi

  2. ASTER :: Action :: JSON :: MvtUtil :: Create 2D-Array with Xy Coords of Tgt Oi

選択されたインスタンスに関連付けしたいインスタンスを直接キャッシュさせる機能 ( 実験的 )。

  1. ASTER :: Action :: ObjControl :: Motion :: MvtUtil :: Cache as a Related Instance

  2. ASTER :: Action :: ObjControl :: Motion :: MvtUtil :: Destroy as a Related Instance

SwapEPs と SwapTgt はパラメータに互換性があります。

パラメータ.1

Enter the motion group name to register to the motion controller.

Even instances created from different objects can be grouped with the same motion group name and managed by the controller.

Instances already registered to the controller cannot be duplicately registered under a different group name.

Multibyte strings (such as Japanese) can also be used, but for practical purposes, short names in lowercase letters are recommended.

"test"

When using the name set to the active object as the motion group name for registration, send an empty string.

""

パラメータ.2

複数パラメータを文字列で一括送信します。JSON と連携することができます。

e.g.

"  60, +0, 0, 30, -1, false, 30, false "
  1. timebound (unsigned int) 符号なし整数値
  2. offset1 (int) 符号あり整数値 ( rev.0.9.39 には実装が無い予約領域 )
  3. motion-type (unsigned int) 符号なし整数値 ( 0 | 1 ) ( rev.0.9.39 には 0 以外の実装は無し )
  4. Sleep (unsigned int) 符号なし整数値
  5. Sleep Repetition (int) 符号あり整数値
  6. Sleep Begin Flag (boolean)
  7. Sleep Interval Value (unsigned int) 符号なし整数
  8. offset2 (boolean) ( rev.0.9.39 には実装が無い予約領域 )
現開発中機能なのでパラメータは今後増やす予定があります。rev.0.9.39

1. TimeBound ( unsigned int )

動作を完了させるために必要な「制限時間」を指定するパラメータ。1 以上の数値。

Timebound = 0 が指定された場合、Swap EPs 命令は未発行となります。

距離に応じた時間単位の移動量を割り出すための値、与えられた条件に応じて移動速度は速くなり遅くなります。

ASTER は全動作がアプリケーション・フレームベースなので Timebound 値はアプリケーション設定に準じます。

60 FPS 動作アプリケーションの場合、Timebound = 60 は約 1 秒で動作を完了させます。

マイナス値の入力は不正パラメータとして構文解析時にエラー扱いとなります。

2. Offset.1 ( int )

開発中。現在このパラメータは機能していません。
今後のバージョンアップで実装を予定しています。rev.0.9.39

3. Motion-Type ( unsigned int )

MoveTowards :: Swap のテンプレート動作から利用したいモーションテンプレートを数値で指定します。

Definition of Type Param Description
Linear Motion 0 直線移動、斜め含む
4-Directions 1 四方向、水平・垂直移動
開発中。現在このパラメータは 0 以外機能していません。

今後のバージョンアップで実装を予定しています。rev.0.9.39

4. Sleep ( unsigned int )

Sleep 値、移動中に一時停止するフレーム時間を符号なし整数値で指定。

e.g.

30

5. Sleep Repetition ( int )

Sleep Repetition 値、スリープ処理を繰り返し実行する場合の回数を任意の整数値で指定。

Description Param
永続的に繰り返す -1
スリープ処理をしない 0
指定回数繰り返す +1 以上

6. Sleep Begin Flag ( boolean )

Sleep Begin Flag 値、真偽値 ( true | false ) 。

動作開始時にスリープ処理を適用して開始するか、否かを決定するフラグ。

Description Param
開始時に適用 true
開始時は適用しない false

7. Sleep Interval ( unsigned int )

スリープ適用後、Sleep Repetition が 0 以外の値の時、再度スリープを実行する迄のフレーム時間を設定するパラメータ。

Sleep Interval = 0 以下の数値は設定しても意味が無い。

Sleep Repetition が 0 の場合、Sleep Interval は設定しても機能しない。

e.g.

30

8. Offset.2 ( boolean )

開発中。現在このパラメータは機能していません。
今後のバージョンアップで実装を予定しています。rev.0.9.39

注意点.1

Target 及び Pursuer は選択順が記憶されていて、選択順でペアを作ります。

Swap Eps の仕様だとペアを作りどちらかに余りが生じた場合、ペアを作れなかったインスタンスの処理はスキップされる仕様です。

Swap Tgt の仕様ではインスタンスは 2 つ選択することになっているため、選択数が 01 もしく 3 以上では機能しません。


その他、注意点

Null Motion は動作が無く、登録されただけではオブジェクトは動きません。

利用法は付属の動作サンプルで、具体的な使用例やイベントが閲覧できます。


登録可能上限、予約変数について »

Maximum Number of Registrations Allowed

The maximum number of instances that can be registered in one motion group is 255. A motion group can register up to 255 groups per motion type.

Type Max Groups Max Instances (Per Group) Total Instances (Per Motion Type)
Null 255 255 255 x 255 = 65,025
Flp | Wrp 255 255 255 x 255 = 65,025
Flp | Wrp::SineWave 255 255 255 x 255 = 65,025
Orbital 255 255 255 x 255 = 65,025
MoveTowards 255 255 255 x 255 = 65,025

The above values are theoretical and exceed the processing capability of CF25, so operation will always be conducted below the maximum values.

Practically, it is assumed that all registered motions will operate with a total number of instances below 100.


About Reserved Variables

From the object instance variables, the reserved variables are as follows:

  1. Alt Variable[0] = Spread ID

  2. Alt Variable[1] = Motion ID

The above variables are used.

Alt Variable[0]

Sequential number. The last object instance created on the frame editor is assigned 0, and then each instance is assigned a value incremented by +1 in order. It is safe to overwrite with any value.

Alt Variable[1]

Motion type. Values ranging from 0 to 4 are assigned according to the motion type at the time of registration. It is a magic number to speed up database searches. If changed, the controller will not be able to search correctly, which is dangerous.

From rev.0.9.x onward, a method of not using Alt Variable[1] has been tested, and it is not used now, but it may be reverted, so please treat Alt Variable[1] as a reserved variable.