Support for Multi-Threaded Texture Baking

A new system to improve the performance of baking textures for display in the viewport has been added to 3ds Max 2015. The system uses multi-threading to evaluate the Texmap's EvalColor() and EvalMono() methods. Because these methods can be called from multiple threads, they must be made thread safe by the developer. For example, if the method modifies a parameter block or other global variable, it must do so in a thread safe manner. See Thread Safety in the Programmer's Guide.

To use the API, include TexmapThreadSafe.h . A typical implementation is as follows and can be added to the constructor of the plugin class:

MaxSDK::TexmapThreadSafe* pTexmapThreadSafe =
static_cast<MaxSDK::TexmapThreadSafe*>(GetInterface(ITEXMAP_THREAD_SAFE));
 DbgAssert(pTexmapThreadSafe != nullptr);
 pTexmapThreadSafe->SetFunctionFlag(MaxSDK::TexmapThreadSafe::FunctionEvalMono,
true);
 pTexmapThreadSafe->SetFunctionFlag(MaxSDK::TexmapThreadSafe::FunctionEvalColor,
true);