Here is samll thing of what i'm trying to do, i got the first BRebBody from the collection in the root component
then i get the appearnce using body->appearance().
Ptr<Component> rootComp = design->rootComponent();
Ptr<BRepBodies> bodies = rootComp->bRepBodies();
if (bodies->count() == 0)
return false;
Ptr<BRepBody> body = bodies->item(0);
Ptr<Appearance> appearance = body->appearance();
std::stringstream msg;
msg << "Body: " << body->name() << " - Appearance: " << appearance->name() << "\n";
ui->messageBox(msg.str());
After testing i found out that using body->appearance() returns the wrong one if:
1) The Appearance is applied to the Component not the BRepBody.
2) The Appearance is duplicated (in this case it returns either the original one or the duplicated one).
3) Some Designs i loaded from file (*.f3d) it didn't even get the name of the appearance correctly.
The image i provided show the code above running and getting the wrong appearance when i applied it to the root compoenent
the name of the appearance applied is Aluminum - Anodized Glossy (Blue) while the name i got was Steel - Satin.