View Full Version : Create new texture for a surface?

12-10-2009, 09:29 PM
I'm trying to create a new surface and assign a color texture map to it in a Modeler LScript. Is it possible to create a new texture for a surface that doesn't have a one for a particular channel (like color)?

For example, here's what I want to do:

@version 2.8
@script modeler

var surface = Surface("Test Surface");
var texture = surface.getTexture(SURFCOLR);
if(texture == nil)
// create a new SURFCOLR texture here, and get a Texture Agent for it

As far as I can figure from the docs and release notes, there are no methods on the Surface Object Agent (or anywhere else) that can do this.

Please tell me I'm wrong and I'm missing something!


12-11-2009, 12:30 AM
As I know there's only a trick to do this,
by simulating the click on the T button,
CommandInput("Surf_SetInt BaseColor 2");


12-11-2009, 07:55 AM
That'll do it. Kind of clunky, but better than nothing.

Thanks Denis!