ValueMap.Remove

ValueMap.Remove operator

導入

v9.0 (2011)

詳細

指定された名前に一致する値を削除します。その名前に一致する項目がない場合は、何も起こりません。

C#構文

ValueMap.Remove( String in_name );

スクリプト構文

ValueMap.Remove( in_name );

パラメータ

パラメータ タイプ 説明
in_name String 削除する値の名前。

Python の例

# Convenience printing

def BrowseValueMap( in_map ) :

	aNames = in_map.Names

	aValues = in_map.Values

	if (len(aNames) < 1) :

		return

	Application.LogMessage("------------")

	i = 0

	while i < len(aNames) :

		Application.LogMessage(aNames[i] + ", " + str(aValues[i]))

		i = i + 1

	Application.LogMessage(" ")

# 

# This example demonstrates how to set, modify, and remove

# values on a RendererOptions ValueMap (defined on the fly)

#

app = Application

oShaderDef = XSIFactory.CreateShaderDef("baddog", "mr_piddles", 1, 0)

oRendererDef = oShaderDef.AddRendererDef("kitchensink")

# Add new values and print the list

oRendererDef.RendererOptions.Set("bowl", 1)

oRendererDef.RendererOptions.Set("cherries", 200)

oRendererDef.RendererOptions.Set("pits", 1)

Application.LogMessage("After initially adding entries...")

BrowseValueMap(oRendererDef.RendererOptions)

# Remove one value and reprint

oRendererDef.RendererOptions.Remove("cherries")

Application.LogMessage("After removing cherries...")

BrowseValueMap(oRendererDef.RendererOptions)

# Add a new value and modify an existing one and reprint again

oRendererDef.RendererOptions.Set("plums", 10)

oRendererDef.RendererOptions.Set("pits", 0)

Application.LogMessage("After setting more values...")

BrowseValueMap(oRendererDef.RendererOptions)

# INFO : After initially adding entries...

# INFO : ------------

# INFO : bowl, 1

# INFO : cherries, 200

# INFO : pits, 1

# INFO :  

# INFO : After removing cherries...

# INFO : ------------

# INFO : bowl, 1

# INFO : pits, 1

# INFO :  

# INFO : After setting more values...

# INFO : ------------

# INFO : bowl, 1

# INFO : pits, 0

# INFO : plums, 10

# INFO :

関連項目

ValueMap.Names ValueMap.Values