v1.0
ビューイング
ビューポートの位置、およびビュー内のオブジェクトの表示を更新します(すなわち、UI を再描画します)。
たとえば、このコマンドを使用してスクリプトを試用し、スクリプトが適用された場合の変更内容を確認することも可能です(例:
すべての変換が実行されるまで表示が更新されないビューで、移動後の結果を確認する)。
注: 一時的な値をすべて削除するSceneRefreshの機能とは異なります(一時的な値とは、これらのパラメータに設定されたアニメーションFカーブと一貫性のない値です)。
ヒント: Refresh コマンドをヒストリ ログに記録せず UI を再描画する場合は、代わりに Desktop.RedrawUI
メソッドを使用します。
Refresh( [Time] ); |
| パラメータ | タイプ | 詳細 |
|---|---|---|
| Time | ダブル | シーンを更新するフレーム
デフォルト値: 現在のフレーム |
'
' This example demonstrates the effect of the Refresh command by creating a few objects and
' then translating them all at once without refreshing and then again while refreshing.
'
NewScene , false
' Set up some variables and constants to start
Set oSmarmy = CreateObject( "XSI.Collection" )
iDisplacement = 0
Const MAX_ARMY = 19
' This is just a utility loop that makes it easier adding a lot of elements to the scene
For i = 0 To 19
' Make a new soldier and add it to the army
Set oSoldier = ActiveSceneRoot.AddNull()
oSmarmy.Add oSoldier
' Get the array of position values for the soldier
aPos = Array( oSoldier.posx.Value, oSoldier.posy.Value, oSoldier.posz.Value )
' If we've already made half the army, position them in one direction
If i >= (MAX_ARMY/2) Then
oSoldier.posx.Value = aPos(0) + iDisplacement
oSoldier.posy.Value = aPos(1) + iDisplacement
oSoldier.posz.Value = aPos(2) + iDisplacement
Else
oSoldier.posx.Value = aPos(0) - iDisplacement
oSoldier.posy.Value = aPos(1) - iDisplacement
oSoldier.posz.Value = aPos(2) - iDisplacement
End If
' When we're half done, we need to reset the displacement counter
If iDisplacement = CInt(MAX_ARMY/2) Then
iDisplacement = 0.1
Else
iDisplacement = iDisplacement + 0.2
End If
Next
' Now that our army is built, let's move them towards us a set at a time for a few steps.
' (The display looks like a bunch of crosses marching steadily forward.)
move3Steps oSmarmy, true
' This will mark the separation between when they are advancing with/without refreshing
For iMark = 0 To 59
Application.LogMessage " ---------- the army is coming ---------- "
Next
' Do it again, this time without refreshing.
' (The display looks like a bunch of crosses jumping forward at once.)
move3Steps oSmarmy, false
sub move3Steps( in_collection, in_refresh_flag )
' Local settings
iStep = 0.25
Const STEP_LIMIT = 30
' First clear the selection (just in case we get unwanted members)
Selection.Clear
' Then set the selection according to the collection members specified
Selection.SetAsText in_collection.GetAsText
' Now we can move everything at one (using a loop to make it easier)
For j = 0 To STEP_LIMIT
Translate , , , +iStep
' If the refresh flag is set, then refresh the scene
If in_refresh_flag Then
Refresh
End If
Next
end sub
|