From Ruben,

>Fixed: The iv loader that uses Inventor library has a little bug, if used with
>osgconv, it doesn't write the images to the converted file because it's
>not setting the osg::Image->setFilename()
This commit is contained in:
Robert Osfield 2003-11-28 22:39:15 +00:00
parent 848e21fb98
commit 532d9a38bf

View File

@ -439,7 +439,7 @@ osg::StateSet* ConvertFromInventor::getStateSet(SoCallbackAction* action)
// Get the material colors
action->getMaterial(ambient, diffuse, specular, emission,
shininess, transparency, 0);
shininess, transparency, 0);
// Set transparency
if (transparency > 0)
@ -602,6 +602,14 @@ ConvertFromInventor::convertIVTexToOSGTex(SoTexture2* soTex,
// Create the osg image
osg::Image* osgTexImage = new osg::Image;
SbString iv_string;
soTex->filename.get(iv_string);
std::string str(iv_string.getString());
std::cout << str << " -> ";
if (str[0]=='\"') str.erase(str.begin());
if (str[str.size()-1]=='\"') str.erase(str.begin()+str.size()-1);
std::cout << str << std::endl;
osgTexImage->setFileName(str);
GLenum formats[] = {GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA};
osgTexImage->setImage(soTexSize[0], soTexSize[1], 0, soTexNC,
formats[soTexNC-1], GL_UNSIGNED_BYTE, imageData,
@ -880,7 +888,7 @@ void ConvertFromInventor::addVertex(SoCallbackAction* action,
}
void ConvertFromInventor::addTriangleCB(void* data, SoCallbackAction* action,
const SoPrimitiveVertex* v0,
const SoPrimitiveVertex* v0,
const SoPrimitiveVertex* v1,
const SoPrimitiveVertex* v2)
{