moved FBXBaker::abort() to ModelBaker::abort()

This commit is contained in:
utkarshgautamnyu 2017-10-25 19:04:12 -07:00
parent 10eb258d3b
commit 6c553e5923
5 changed files with 23 additions and 12 deletions

View file

@ -51,15 +51,15 @@ FBXBaker::~FBXBaker() {
}
}
void FBXBaker::abort() {
Baker::abort();
// tell our underlying TextureBaker instances to abort
// the FBXBaker will wait until all are aborted before emitting its own abort signal
for (auto& textureBaker : bakingTextures) {
textureBaker->abort();
}
}
//void FBXBaker::abort() {
// Baker::abort();
//
// // tell our underlying TextureBaker instances to abort
// // the FBXBaker will wait until all are aborted before emitting its own abort signal
// for (auto& textureBaker : bakingTextures) {
// textureBaker->abort();
// }
//}
void FBXBaker::bake() {
qDebug() << "FBXBaker" << modelURL << "bake starting";

View file

@ -42,7 +42,7 @@ public:
public slots:
virtual void bake() override;
virtual void abort() override;
//virtual void abort() override;
signals:
void sourceCopyReadyToLoad();

View file

@ -41,6 +41,16 @@ ModelBaker::ModelBaker(const QUrl& modelURL, TextureBakerThreadGetter textureThr
void ModelBaker::bake() {}
void ModelBaker::abort() {
Baker::abort();
// tell our underlying TextureBaker instances to abort
// the FBXBaker will wait until all are aborted before emitting its own abort signal
for (auto& textureBaker : bakingTextures) {
textureBaker->abort();
}
}
bool ModelBaker::compressMesh(FBXMesh& mesh, bool hasDeformers,FBXNode& dracoMeshNode, getMaterialIDCallback materialIDCallback) {
if (mesh.wasCompressed) {
handleError("Cannot re-bake a file that contains compressed mesh");

View file

@ -55,6 +55,7 @@ protected:
public slots:
virtual void bake() override;
virtual void abort() override;
private slots:
void handleBakedTexture();

View file

@ -257,7 +257,6 @@ void OBJBaker::createFBXNodeTree(FBXNode& rootNode, FBXGeometry& geometry) {
}
// Generating Texture Node
int count = 0;
// iterate through mesh parts and process the associated textures
for (int i = 0;i < meshParts.size();i++) {
QString material = meshParts[i].materialID;
@ -333,7 +332,8 @@ void OBJBaker::createFBXNodeTree(FBXNode& rootNode, FBXGeometry& geometry) {
}
// Connect textures to materials
for (int i = 0;i < _mapTextureMaterial.size();i++) {
int mapSize = _mapTextureMaterial.size();
for (int i = 0;i < mapSize;i++) {
FBXNode cNode2;
cNode2.name = C_NODE_NAME;
propertyString = CONNECTIONS_NODE_PROPERTY_1;