fix loading textures

This commit is contained in:
alemuntoni 2021-06-30 12:34:24 +02:00
parent 3135c85a95
commit 4178eaf019
2 changed files with 13 additions and 3 deletions

View File

@ -58,8 +58,18 @@ FilterLayerPlugin::FilterLayerPlugin()
FP_IMPORT_CAMERAS
};
for(ActionIDType tt: types())
actionList.push_back(new QAction(filterName(tt), this));
QCoreApplication* app = QCoreApplication::instance();
for(ActionIDType tt: types()) {
QAction* act = new QAction(filterName(tt), this);
actionList.push_back(act);
if (app != nullptr) {
if(tt==FP_DELETE_MESH){
act->setShortcut(Qt::CTRL + Qt::Key_D);
}
}
}
}
QString FilterLayerPlugin::pluginName() const

View File

@ -240,7 +240,7 @@ void loadMeshPrimitive(
}
if (textureImg != -1) { //if we found a texture
//add the path of the texture to the mesh
std::string uri = model.images[textureImg].uri;
std::string uri = model.images[model.textures[textureImg].source].uri;
uri = std::regex_replace(uri, std::regex("\\%20"), " ");
m.cm.textures.push_back(uri);
//set the id of the texture: we need it when set uv coords