2004-06-01 11:31 AM - last edited on 2023-08-07 12:22 PM by Doreena Deng
material = component.pgon.iumat; API_Attribute attrib; BNZeroMemory (&attrib, sizeof (API_Attribute)); attrib.header.typeID = API_MaterialID; attrib.header.index = material; err = ACAPI_Attribute_Get (&attrib); if (err == NoError) { sprintf(matBuffer, "%s", attrib.header.name); }
2004-06-01 11:36 AM
API_Attribute attrib; BNZeroMemory (&attrib, sizeof (API_Attribute)); err = ACAPI_Attribute_GetNum (API_MaterialID, &nAttr); for (short i = 1; i <= nAttr && err == NoError; i++) { attrib.header.typeID = API_MaterialID; attrib.header.index = i; err = ACAPI_Attribute_Get (&attrib); if (err == NoError) { char nameBuffer[64]; sprintf(nameBuffer, "'%s'", attrib.header.name); } }
2004-06-01 12:51 PM
stefan wrote:I did not try, but I think iumat isnot material attribute index, it is API_UmatType components index of API_Component3D.
When I step through all the materials, one at a time, I can get all info from them. However, when I step through the geometry from the 3D-Window, I get some "iumat" short that should be an index into the materials.
2004-06-01 02:07 PM
char matBuffer[64]; material = component.pgon.iumat; API_Component3D component3D; component3D.header.typeID = API_UmatID; component3D.header.index = material; err = ACAPI_3D_GetComponent(&component3D); if (err == NoError) { API_UmatType umatType = component3D.umat; sprintf(matBuffer, "%s", umatType.mater.head.name); }Now I get the correct material from a 3D Polygon...
2004-06-01 03:01 PM
stefan wrote:I can only assume about the reason. Materials for polugons can be defined inside GDL script or binary section of object. They will not have the appropriate material attributes. Probably therefore there is this umat components.
It seems the the "Attribute" Material and the "3DComponent" Material are reached in a complete different way!