Procedural UVW layout and texture baking tool for 3dsMax
Standard Installation:
Drag and drop, or maxscript>run to launch the installer to launch the script.
I have structured this script to have an API so that the tool can be used independent from the UI and its functionalities added into other tools or pipelines.
There are 2 structures that are usefull to the user that can be accessed via maxscript, to see them and their properties execute this code:
showproperties lazyUVW_Def
showproperties uvwFun
The first, the "lazyUVW_Def" is a data structure that hold the information for the current uvw operation. It stays in memory, and can be edited by the UI or by maxscript. This is essentially the instructions for the script to use.
mode:; Public{int}- the UVW operation to perform. the index corresponds with the dropdown list in the UI
textureMap1:; Public{string} - the filename of an image file, to use as the texture, in channel 1
textureMap2:; Public{string} - the filename of an image file, to use as the texture, in channel 2
textureMap1_tile_U:; Public{float} - the U tiling amount for the texture map in channel 1
textureMap1_tile_V:; Public{float} - the V tiling amount for the texture map in channel 1
textureMap2_tile_U:; Public{float} - the U tiling amount for the texture map in channel 2
textureMap2_tile_V:; Public {float} - the V tiling amount for the texture map in channel 2
blendNoise:; Public{float}- the amount of noise to add to the procedural blend map
blendMap1:; Public{string} - the filename of an image file, to use as the texture, in the blending channel
blendMode:; Public{int}- the UVW operation to perform. 1 is procedural 2 is texture based
bakeEnabled:; Public{bool}- sets weather the texure will be baked or not
bakeDestination:; Public{string} - where to save the baked image, this is a path, not a filename
bakeToMap:; Public{bool}- sets weather to create a new material applied to the object, with its baked map
bakeChannel:; Public{int}- the destination map channel of the automatic unwrap
bakeResolution:; Public{int}- the x and y resolution to the baked map
To edit any of the properties, enabling baking and its destination for example, set it like this.
lazyUVW_Def.bakeEnabled = true
lazyUVW_Def.bakeDestination = "C: est"
Once you have set any properties you want, you execute the operation by calling the "applyUVW" function from uvwFun, and it will operate on your selection.
uvwFun.applyUVW()
These operations can be done with the UI open or closed, please note that if the UI is open, any changes made via maxscript will not appear in the UI, and only will be if you call the "updateUI" function.
uvwFun.updateUI()
3dsmax 9+