RegenerateMaps

Description

Regenerates the specified RenderMaps. This is the scripting equivalent of clicking the Regenerate Map button in the RenderMap property editor. To add a RenderMap, use the 'AddProp "RenderMap"' command.

RenderMaps allow you to 'bake' complex texturing and rendertree information into a single texture image, which you can use for previewing textures in the textured viewing modes, creating textures for games and realtime rendering, or for generally speeding up rendering.

Note: You cannot generate a rendermap for an object unless there is a texture projection attached to the image and the texture projection cannot be a spatial texture projection (use a UV projection instead).

Scripting Syntax

RegenerateMaps( [Properties] )

Parameters

Parameter

Type

Description

Properties

String

List of RenderMaps to regenerate. RenderMaps are properties, for example, "sphere.RenderMap".

Default Value: Current selection

Examples

VBScript Example

'
' This example creates a sphere with a rendermap, and then connects a rendermap 
' using a UV projection to the sphere and regenerates the map.
'
NewScene , false

' Add a sphere to the scene
Set oSphere = CreatePrim( "Sphere", "NurbsSurface" )

' Create a rendermap on the sphere; the AddProp command returns the output 
' object as an XSICollection of 1, so you can get the actual RenderMap as
' a Property object by resetting the object pointer to the first member
' of the returned collection
AddProp "RenderMap", oSphere, , , oRMap
Set oRMap = oRMap(0)

' Specify a destination directory and name for the new image file
' Note: You must specify the image filename with an extension
oRMap.Parameters( "imagefile" ).Value = InstallationPath( siUserPath ) _
          & "\temp\rendermap.pic"
'
' Tip: You can also use the SetValue command instead of accessing the 
'  parameter through the object model:
' SetValue oSphere & ".RenderMap.imagefile", InstallationPath( siUserPath ) _
'         & "\temp\rendermap.pic"
'

' Add a texture projection to the sphere and attach the rendermap to it
CreateProjection oSphere, siTxtUV, siTxtDefaultSpherical, sSupport, sProj
SetInstanceDataValue , oRMap.Parameters( "uvprop" ), sProj

'
' Tip: You can also use the SetInstanceDataValue command instead of 
'  accessing the parameter through the object model:
' SetInstanceDataValue , oSphere & ".RenderMap.uvprop", sProj
'

' Regenerate the rendermap
RegenerateMaps oRMap

See Also

AddProp



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index