I am facing a problem for two days and can’t figure how to sort it :
I’m using C++ SDK skp2xml sample as a basis of an skp Importer for our software.
Everything works fine except one case, when texture is handled by component and not by geometry itself
My SU model is :
- A single square face converted as a component
- The face has no material
- The component has one texture (see incorpored image)
Because Face has default material like explained by @tt_su here, UV coords are default one and are useless when using SUUVHelperGetFrontUVQ/SUUVHelperGetBackUVQ.
I have also tried to use these calls with no success :
SUTextureWriterLoadFace
SUTextureWriterLoadEntity
SUFaceGetUVHelperWithTextureHandle
From SDK sample, the order of skp2xml algorithm is
WriteComponentDefinitions();
which then calls
WriteEntities()
But material is available in “component instance” not in “component definition” when I need material
So I am a little bit lost, I do not know where and when I get the right info and where I can set it.
void CXmlExporter::WriteEntities(SUEntitiesRef entities, XmlEntitiesInfo &entities_info)
{
WriteComponentInstances(entities, entities_info);
WriteGroups(entities, entities_info);
WriteGeometries(entities, entities_info);
}
This problem has been talked in previous post, but I am unsure what user did is correct by using SUFaceSetFrontMaterial
with material from component on each individual face.