DelayedRefresh

導入

v5.0

詳細

スクリプトの実行が完了し、アプリケーションを使用できる状態になったときに、3D ビューポートを再描画します。 このコマンドを複数回呼び出す場合は、スクリプトの実行後に 1 度だけ再描画します。

注: このコマンドは、コマンドの実行後に直ちにシーンを再描画する Refresh とは異なります。

スクリプト構文

DelayedRefresh( [Time] );

パラメータ

パラメータ タイプ 説明
Time Double シーンを更新するフレーム

デフォルト値: 現在のフレーム

VBScript の例

'

' This example demonstrates the effect of the DelayedRefresh command by creating a few objects and 

' then translating them with delayed refresh calls after each step.

'

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.

' (Only the end result will be displayed)

move3Steps oSmarmy

sub move3Steps( in_collection )

	' 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

		DelayedRefresh

	Next

end sub

関連項目

Refresh