mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:37:20 +02:00
Indentation Fixes
This commit is contained in:
parent
5d5e62d002
commit
98ec464106
4 changed files with 16 additions and 12 deletions
|
@ -148,7 +148,7 @@ void FBXBaker::loadSourceFBX() {
|
||||||
// check if the FBX is local or first needs to be downloaded
|
// check if the FBX is local or first needs to be downloaded
|
||||||
if (_fbxURL.isLocalFile()) {
|
if (_fbxURL.isLocalFile()) {
|
||||||
// load up the local file
|
// load up the local file
|
||||||
QFile localFBX{ _fbxURL.toLocalFile() };
|
QFile localFBX { _fbxURL.toLocalFile() };
|
||||||
|
|
||||||
qDebug() << "Local file url: " << _fbxURL << _fbxURL.toString() << _fbxURL.toLocalFile() << ", copying to: " << _originalFBXFilePath;
|
qDebug() << "Local file url: " << _fbxURL << _fbxURL.toString() << _fbxURL.toLocalFile() << ", copying to: " << _originalFBXFilePath;
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ void FBXBaker::importScene() {
|
||||||
|
|
||||||
void FBXBaker::rewriteAndBakeSceneModels() {
|
void FBXBaker::rewriteAndBakeSceneModels() {
|
||||||
unsigned int meshIndex = 0;
|
unsigned int meshIndex = 0;
|
||||||
bool hasDeformers{ false };
|
bool hasDeformers { false };
|
||||||
for (FBXNode& rootChild : _rootNode.children) {
|
for (FBXNode& rootChild : _rootNode.children) {
|
||||||
if (rootChild.name == "Objects") {
|
if (rootChild.name == "Objects") {
|
||||||
for (FBXNode& objectChild : rootChild.children) {
|
for (FBXNode& objectChild : rootChild.children) {
|
||||||
|
@ -283,7 +283,7 @@ void FBXBaker::rewriteAndBakeSceneModels() {
|
||||||
|
|
||||||
objectChild.children.push_back(dracoMeshNode);
|
objectChild.children.push_back(dracoMeshNode);
|
||||||
|
|
||||||
static const std::vector<QString> nodeNamesToDelete{
|
static const std::vector<QString> nodeNamesToDelete {
|
||||||
// Node data that is packed into the draco mesh
|
// Node data that is packed into the draco mesh
|
||||||
"Vertices",
|
"Vertices",
|
||||||
"PolygonVertexIndex",
|
"PolygonVertexIndex",
|
||||||
|
@ -357,17 +357,20 @@ void FBXBaker::rewriteAndBakeSceneTextures() {
|
||||||
for (FBXNode& textureChild : object->children) {
|
for (FBXNode& textureChild : object->children) {
|
||||||
|
|
||||||
if (textureChild.name == "RelativeFilename") {
|
if (textureChild.name == "RelativeFilename") {
|
||||||
QString fbxTextureFileName{ textureChild.properties.at(0).toByteArray() };
|
QString fbxTextureFileName { textureChild.properties.at(0).toByteArray() };
|
||||||
|
QFileInfo fbxTextureFileInfo { fbxTextureFileName.replace("\\", "/") };
|
||||||
|
|
||||||
QByteArray textureContent = "";
|
QByteArray textureContent = "";
|
||||||
QFileInfo fbxTextureFileInfo{ fbxTextureFileName.replace("\\", "/") };
|
|
||||||
// Callback to get texture content and type from FBXBaker in ModelBaker
|
|
||||||
if (!fbxTextureFileInfo.filePath().isEmpty()) {
|
if (!fbxTextureFileInfo.filePath().isEmpty()) {
|
||||||
textureContent = _textureContent.value(fbxTextureFileName.toLocal8Bit());
|
textureContent = _textureContent.value(fbxTextureFileName.toLocal8Bit());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Callback to get texture content and type
|
||||||
getTextureContentTypeCallback textureContentTypeCallback = [=]() {
|
getTextureContentTypeCallback textureContentTypeCallback = [=]() {
|
||||||
QPair<QByteArray, image::TextureUsage::Type> result;
|
QPair<QByteArray, image::TextureUsage::Type> result;
|
||||||
result.first = textureContent;// _textureContent.value(fbxTextureFileName.toLocal8Bit());
|
result.first = textureContent;
|
||||||
|
// grab the ID for this texture so we can figure out the
|
||||||
|
// texture type from the loaded materials
|
||||||
auto textureID{ object->properties[0].toByteArray() };
|
auto textureID{ object->properties[0].toByteArray() };
|
||||||
auto textureType = textureTypes[textureID];
|
auto textureType = textureTypes[textureID];
|
||||||
result.second = textureType;
|
result.second = textureType;
|
||||||
|
@ -375,7 +378,8 @@ void FBXBaker::rewriteAndBakeSceneTextures() {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Compress the texture information and return the new filename to be added into the FBX scene
|
// Compress the texture information and return the new filename to be added into the FBX scene
|
||||||
QByteArray* bakedTextureFile = this->compressTexture(fbxTextureFileName, _fbxURL, _bakedOutputDir, _textureThreadGetter, textureContentTypeCallback, _originalOutputDir);
|
QByteArray* bakedTextureFile = this->compressTexture(fbxTextureFileName, _fbxURL, _bakedOutputDir, _textureThreadGetter,
|
||||||
|
textureContentTypeCallback, _originalOutputDir);
|
||||||
|
|
||||||
// If no errors or warnings have occurred during texture compression add the filename to the FBX scene
|
// If no errors or warnings have occurred during texture compression add the filename to the FBX scene
|
||||||
if (bakedTextureFile) {
|
if (bakedTextureFile) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ public slots:
|
||||||
signals:
|
signals:
|
||||||
void sourceCopyReadyToLoad();
|
void sourceCopyReadyToLoad();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void bakeSourceCopy();
|
void bakeSourceCopy();
|
||||||
void handleFBXNetworkReply();
|
void handleFBXNetworkReply();
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ private:
|
||||||
|
|
||||||
TextureBakerThreadGetter _textureThreadGetter;
|
TextureBakerThreadGetter _textureThreadGetter;
|
||||||
|
|
||||||
bool _pendingErrorEmission{ false };
|
bool _pendingErrorEmission { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_FBXBaker_h
|
#endif // hifi_FBXBaker_h
|
||||||
|
|
|
@ -164,7 +164,7 @@ void ModelBakeWidget::bakeButtonClicked() {
|
||||||
|
|
||||||
// split the list from the model line edit to see how many models we need to bake
|
// split the list from the model line edit to see how many models we need to bake
|
||||||
auto fileURLStrings = _modelLineEdit->text().split(',');
|
auto fileURLStrings = _modelLineEdit->text().split(',');
|
||||||
foreach(QString fileURLString, fileURLStrings) {
|
foreach (QString fileURLString, fileURLStrings) {
|
||||||
// construct a URL from the path in the model file text box
|
// construct a URL from the path in the model file text box
|
||||||
QUrl modelToBakeURL(fileURLString);
|
QUrl modelToBakeURL(fileURLString);
|
||||||
|
|
||||||
|
|
|
@ -54,4 +54,4 @@ private:
|
||||||
bool _isFBX = false;
|
bool _isFBX = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_ModelBakeWidget_h
|
#endif // hifi_ModelBakeWidget_h
|
||||||
|
|
Loading…
Reference in a new issue