Go into the Irrlicht source folder and open CSceneNodeAnimatorTexture.cpp and CSceneNodeAnimatorTexture.h.
Under the existing member variables in the header file add one called matIndex. Then add the parameter MatIndex to the argument list of the constructor, placing matIndex(MatIndex) in the initializer.
Under the function that swaps out the textures (can't remember exactly what it's called and I don't have access to the file here) there will be a line that says
Code: Select all
node->setMaterialTexture(0, textures[Idx]);Code: Select all
node->getMaterial(matIndex)->Texture1 = textures[idx];Do a find and replace (ctrl+H in Visual Studio 6, don't know about other IDEs) in both files and replace "CSceneNodeAnimatorTexture" with "CMyAnimatorName" (I renamed it CSceneNodeAnimatorSkyBox because I originally had it in mind for animated skybox textures), and then save both of these files into your project's folder as <CClassName>.cpp and <CClassName>.h.
For actual useage consult the custom scene node tutorial, or you could build it into a custom library (consult with someone more experienced, as I either end up with a crapload of build errors or a dll that crashes everything when it does build).
This has only been tested with the skybox scene node, but it should be able to work with any multi-material node, and it could possibly be expanded to allow you to specify a texture layer.