Put base name into texture image name as prefix

master
Jeremy Hu 2018-11-28 11:19:22 +09:30
parent b60b9d8691
commit 0bee294c7f
2 changed files with 6 additions and 3 deletions

View File

@ -4,6 +4,7 @@
#include <QtMath> #include <QtMath>
#include <QBuffer> #include <QBuffer>
#include <QByteArray> #include <QByteArray>
#include <QFileInfo>
#include "fbxfile.h" #include "fbxfile.h"
#include "version.h" #include "version.h"
#include "jointnodetree.h" #include "jointnodetree.h"
@ -2207,7 +2208,8 @@ FbxFileWriter::FbxFileWriter(Outcome &outcome,
QImage *normalImage, QImage *normalImage,
QImage *ormImage, QImage *ormImage,
const std::vector<std::pair<QString, std::vector<std::pair<float, JointNodeTree>>>> *motions) : const std::vector<std::pair<QString, std::vector<std::pair<float, JointNodeTree>>>> *motions) :
m_filename(filename) m_filename(filename),
m_baseName(QFileInfo(m_filename).baseName())
{ {
createFbxHeader(); createFbxHeader();
createFileId(); createFileId();
@ -3565,14 +3567,14 @@ FbxFileWriter::FbxFileWriter(Outcome &outcome,
addTexture(textureImage, addTexture(textureImage,
std::vector<uint8_t>({'V','i','d','e','o',0,1,'B','a','s','e','C','o','l','o','r'}), std::vector<uint8_t>({'V','i','d','e','o',0,1,'B','a','s','e','C','o','l','o','r'}),
std::vector<uint8_t>({'T','e','x','t','u','r','e',0,1,'B','a','s','e','C','o','l','o','r'}), std::vector<uint8_t>({'T','e','x','t','u','r','e',0,1,'B','a','s','e','C','o','l','o','r'}),
"BaseColor.png", m_baseName + "_color.png",
"Maya|TEX_color_map"); "Maya|TEX_color_map");
} }
if (nullptr != normalImage) { if (nullptr != normalImage) {
addTexture(normalImage, addTexture(normalImage,
std::vector<uint8_t>({'V','i','d','e','o',0,1,'N','o','r','m','a','l'}), std::vector<uint8_t>({'V','i','d','e','o',0,1,'N','o','r','m','a','l'}),
std::vector<uint8_t>({'T','e','x','t','u','r','e',0,1,'N','o','r','m','a','l'}), std::vector<uint8_t>({'T','e','x','t','u','r','e',0,1,'N','o','r','m','a','l'}),
"Normal.png", m_baseName + "_normal.png",
"Maya|TEX_normal_map"); "Maya|TEX_normal_map");
} }
/* /*

View File

@ -47,6 +47,7 @@ private:
int64_t to64Id(const QUuid &uuid); int64_t to64Id(const QUuid &uuid);
int64_t m_next64Id = 612150000; int64_t m_next64Id = 612150000;
QString m_filename; QString m_filename;
QString m_baseName;
fbx::FBXDocument m_fbxDocument; fbx::FBXDocument m_fbxDocument;
std::map<QString, int64_t> m_uuidTo64Map; std::map<QString, int64_t> m_uuidTo64Map;
static std::vector<double> m_identityMatrix; static std::vector<double> m_identityMatrix;