RegenerateMaps
 
 
 

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], [TileSize] );

Parameters

Parameter Type Description
Properties String List of RenderMaps to regenerate. RenderMaps are properties, for example, "sphere.RenderMap".

Default Value: Current selection

TileSize Integer Increase or decrease the likelihood that satellite machines will be used in the render (see the Softimage user guide for more information about tiles).

Suggested values are 8, 16, 32, and 64.

Accepted values are in the range of 8 to 512 inclusive.

Default Value: 32

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 with a tile size of 16
RegenerateMaps oRMap, 16

See Also

AddProp