markschum
12-27-2007, 12:16 PM
Hi all,
I am trying to do a script to automate the adding of a uvmap to all surfaces so the uv info will be exported when saving an obj file.
I am starting with getting the current settings .
The script I am using does not seem to get the name of the uvmap from the texture though. It returns (nil) :thumbsdow
Here is the code :
@version 2.2
@warnings
@script modeler
// global values go here
main
{
meshobj = Mesh(0);
surfnames = Surface(meshobj);
foreach(s,surfnames)
{
t = Surface(s).getTexture(SURFCOLR);
if (t)
{
l=t.firstLayer();
p = l.getValue(TXLRPROJECT);
q = l.getValue(TXLRVMAP);
info(s,p,q);
}
else
{
info(s, "No texture");
}
}
info(msg);
vmap = VMap(VMTEXTURE);
if (vmap)
{
info("vmap:", vmap.name);
}
}
when run I get surface name, 5,(nil) in the info message if a texture exists
and I get the uv map name at the end .
I was thinking that getValue(TXLRVMAP) should return the map name or
a vmap obj but I get (nil)
Any suggestion ?
thanks
I am trying to do a script to automate the adding of a uvmap to all surfaces so the uv info will be exported when saving an obj file.
I am starting with getting the current settings .
The script I am using does not seem to get the name of the uvmap from the texture though. It returns (nil) :thumbsdow
Here is the code :
@version 2.2
@warnings
@script modeler
// global values go here
main
{
meshobj = Mesh(0);
surfnames = Surface(meshobj);
foreach(s,surfnames)
{
t = Surface(s).getTexture(SURFCOLR);
if (t)
{
l=t.firstLayer();
p = l.getValue(TXLRPROJECT);
q = l.getValue(TXLRVMAP);
info(s,p,q);
}
else
{
info(s, "No texture");
}
}
info(msg);
vmap = VMap(VMTEXTURE);
if (vmap)
{
info("vmap:", vmap.name);
}
}
when run I get surface name, 5,(nil) in the info message if a texture exists
and I get the uv map name at the end .
I was thinking that getValue(TXLRVMAP) should return the map name or
a vmap obj but I get (nil)
Any suggestion ?
thanks