MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getMaterial

Method getMaterial

src/Mod/Material/App/ExternalManager.cpp:965–990  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

963}
964
965std::shared_ptr<Material> ExternalManager::getMaterial(const QString& uuid)
966{
967 connect();
968
969 Base::PyGILStateLocker lock;
970 try {
971 if (_managerObject.hasAttr("getMaterial")) {
972 Py::Callable libraries(_managerObject.getAttr("getMaterial"));
973 Py::Tuple args(1);
974 args.setItem(0, Py::String(uuid.toStdString()));
975 Py::Object result(libraries.apply(args));
976
977 auto shared = materialFromObject(result, uuid);
978
979 return shared;
980 }
981 else {
982 Base::Console().log("\tgetMaterial() not found\n");
983 throw ConnectionError();
984 }
985 }
986 catch (Py::Exception& e) {
987 Base::PyException e1; // extract the Python error text
988 throw MaterialNotFound(e1.what());
989 }
990}
991
992void ExternalManager::addMaterial(const QString& libraryName,
993 const QString& path,

Callers 15

set_materialMethod · 0.45
set_reinforcementMethod · 0.45
set_from_editorMethod · 0.45
myPreactionCB_PrintNameFunction · 0.45
modelIncludedMethod · 0.45
RestoreMethod · 0.45
getMaterialTreeMethod · 0.45
saveInheritsMethod · 0.45
saveModelsMethod · 0.45
saveAppearanceModelsMethod · 0.45
testCalculiXSteelMethod · 0.45
testListsMethod · 0.45

Calls 8

ConnectionErrorClass · 0.85
MaterialNotFoundClass · 0.85
toStdStringMethod · 0.80
connectFunction · 0.50
StringClass · 0.50
applyMethod · 0.45
logMethod · 0.45
whatMethod · 0.45

Tested by 9

testCalculiXSteelMethod · 0.36
testListsMethod · 0.36
test2DArrayMethod · 0.36
test3DArrayMethod · 0.36
testFilterMethod · 0.36
testCreateMaterialMethod · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36