ValueMap.Remove
 
 
 

ValueMap.Remove operator

Introduced

v9.0 (2011)

Description

Removes the value that matches the specified name. If no item matches that name, nothing happens.

C# Syntax

ValueMap.Remove( String in_name );

Scripting Syntax

ValueMap.Remove( in_name );

Parameters

Parameter Type Description
in_name String The name of the value to remove.

Examples

Python Example

# 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 :

See Also

ValueMap.Names ValueMap.Values