I exported the attached skp file as obj format, I found there is a texture file named Ekran_Resmi_2016_07_28_20_51_46.png. but when I write code to get this texture, I got nothing about texture. The code is just like,
SUUVHelperRef uv_helper = SU_INVALID;
SUMaterialRef materialRef = SU_INVALID;
SUTextureRef textureRef = SU_INVALID;
bool hasFrontTexture = false, hasBackTexture = false;
if (SU_ERROR_NONE == SUFaceGetFrontMaterial (pFace, &materialRef) && materialRef.ptr)
hasFrontTexture = SUMaterialGetTexture(materialRef, &textureRef) == SU_ERROR_NONE;
if (SU_ERROR_NONE == SUFaceGetBackMaterial (pFace, &materialRef) && materialRef.ptr)
hasBackTexture = SUMaterialGetTexture(materialRef, &textureRef) == SU_ERROR_NONE;
bool isTexture = (hasFrontTexture | hasBackTexture) | (0 != textureHandle);
if (isTexture)
SUFaceGetUVHelper (pFace, hasFrontTexture, hasBackTexture, m_pTextureWriter, &uv_helper);
There is neither front nor back texture. How could I get the texture with SketchUp API?
simple.skp (3.0 MB)