DeleteMappingRule

DeleteMappingRule

導入

v1.0

詳細

接続マッピング テンプレートまたはバリュー マッピング テンプレートからルールを削除します。

スクリプト構文

DeleteMappingRule( MappingTemplate, Index );

パラメータ

パラメータ タイプ 説明
MappingTemplate 文字列 ルールを削除するマッピング テンプレート
Index Integer 削除するルールを指定します。

デフォルト値: 0

VBScript の例

' This example illustrates various mapping template commands, in

' particular how to add and remove rules and examine the contents.

NewScene , False

' Create a connection mapping template.

CreateEmptyConnectionMap "Scene_Root", oCnxMap

theRules = Array( Array( "from", "to" ), _

			Array( "me", "you" ), _

			Array( "HERE", "THERE" ) )

i = 1

for each rule in theRules

	AddMappingRule oCnxMap, rule(0), rule(1), i

	i = i + 1

next

' Let's take a look at the connection templates at the start.

DumpTemplateInfo oCnxMap

' Delete a couple of rules.

DeleteMappingRule oCnxMap, 0

DeleteMappingRule oCnxMap, 0

' Let's take another look, now that it's been edited.

DumpTemplateInfo oCnxMap

'==================================================

' Helper method to dump some mapping template info.

'==================================================

sub DumpTemplateInfo( in_Templ )

	' Get the actual object referenced by name in the argument.

	set oTempl = GetValue( in_Templ )

	msg = "Template: " & oTempl.fullname & Chr(10)

	numRules = GetNumMappingRules( in_Templ )

	if oTempl.type = "actionclip" then

		msg = msg & "(Clip acting as value map)" & Chr(10)

		bSupportsActive = true

	else

		bSupportsActive = false

	end if

	for i = 1 to numRules

		GetMappingRule in_Templ, i, param, expr, active

		msg = msg & Chr(9) & "Rule " & i & ": "

		if bSupportsActive then

			if active then

				msg = msg & "( active ) "

			else

				msg = msg & "(inactive) "

			end if

		end if

		msg = msg & param & " -> " & expr & Chr(10)

	next

	LogMessage msg 

end sub

' Running this script should log the following:

' ---------------------------------------------

'INFO : "Template: Mixer.MappingTemplate

'	Rule 1: from -> to

'	Rule 2: me -> you

'	Rule 3: HERE -> THERE

'"

'INFO : "Template: Mixer.MappingTemplate

'	Rule 1: HERE -> THERE

'"

関連項目

AddMappingRule CreateConnectionMap CreateValueMap GetNumMappingRules GetMappingRule SetMappingRule