mirror of
https://github.com/redstrate/Novus.git
synced 2025-05-03 16:37:46 +00:00
Add visible textures to the material editor along with constants
This commit is contained in:
parent
e9c857a649
commit
5c31965691
5 changed files with 36 additions and 2 deletions
2
extern/libphysis
vendored
2
extern/libphysis
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 63051e0056a521d9165445fe6f6f1a2221dcea37
|
Subproject commit bccb0503fadb1cd69f27e9aa62ff4d446de76226
|
|
@ -19,6 +19,7 @@ target_link_libraries(novus-mateditor
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Novus::Common
|
Novus::Common
|
||||||
Novus::MdlPart
|
Novus::MdlPart
|
||||||
|
Novus::TexPart
|
||||||
Physis::Physis
|
Physis::Physis
|
||||||
Physis::Logger
|
Physis::Logger
|
||||||
Qt6::Core
|
Qt6::Core
|
||||||
|
|
|
@ -29,6 +29,7 @@ private:
|
||||||
QTabWidget *m_tabWidget = nullptr;
|
QTabWidget *m_tabWidget = nullptr;
|
||||||
QVBoxLayout *m_propertiesLayout = nullptr;
|
QVBoxLayout *m_propertiesLayout = nullptr;
|
||||||
QVBoxLayout *m_texturesLayout = nullptr;
|
QVBoxLayout *m_texturesLayout = nullptr;
|
||||||
|
QVBoxLayout *m_constantsLayout = nullptr;
|
||||||
|
|
||||||
physis_Material m_material = {};
|
physis_Material m_material = {};
|
||||||
physis_SHPK m_shpk = {};
|
physis_SHPK m_shpk = {};
|
||||||
|
|
|
@ -20,7 +20,7 @@ MainWindow::MainWindow(GameData *data)
|
||||||
setMinimumSize(1280, 720);
|
setMinimumSize(1280, 720);
|
||||||
setupMenubar();
|
setupMenubar();
|
||||||
|
|
||||||
auto matFile = physis_gamedata_extract_file(data, "chara/equipment/e0028/material/v0020/mt_c0101e0028_top_a.mtrl");
|
auto matFile = physis_gamedata_extract_file(data, "chara/equipment/e0028/material/v0001/mt_c0101e0028_top_a.mtrl");
|
||||||
m_material = physis_material_parse(matFile);
|
m_material = physis_material_parse(matFile);
|
||||||
|
|
||||||
auto dummyWidget = new QSplitter();
|
auto dummyWidget = new QSplitter();
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#include "materialpropertyedit.h"
|
#include "materialpropertyedit.h"
|
||||||
|
#include "texpart.h"
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
|
@ -355,8 +356,13 @@ MaterialPropertyEdit::MaterialPropertyEdit(GameData *data, QWidget *parent)
|
||||||
m_texturesLayout = new QVBoxLayout();
|
m_texturesLayout = new QVBoxLayout();
|
||||||
texturesTab->setLayout(m_texturesLayout);
|
texturesTab->setLayout(m_texturesLayout);
|
||||||
|
|
||||||
|
auto constantsTab = new QWidget();
|
||||||
|
m_constantsLayout = new QVBoxLayout();
|
||||||
|
constantsTab->setLayout(m_constantsLayout);
|
||||||
|
|
||||||
m_tabWidget->addTab(propertiesTab, i18n("Parameters"));
|
m_tabWidget->addTab(propertiesTab, i18n("Parameters"));
|
||||||
m_tabWidget->addTab(texturesTab, i18n("Textures"));
|
m_tabWidget->addTab(texturesTab, i18n("Textures"));
|
||||||
|
m_tabWidget->addTab(constantsTab, i18n("Constants"));
|
||||||
|
|
||||||
setLayout(m_itemsLayout);
|
setLayout(m_itemsLayout);
|
||||||
|
|
||||||
|
@ -502,6 +508,32 @@ void MaterialPropertyEdit::rebuild()
|
||||||
|
|
||||||
auto groupBox = new QGroupBox(name);
|
auto groupBox = new QGroupBox(name);
|
||||||
m_texturesLayout->addWidget(groupBox);
|
m_texturesLayout->addWidget(groupBox);
|
||||||
|
|
||||||
|
auto layout = new QFormLayout();
|
||||||
|
groupBox->setLayout(layout);
|
||||||
|
|
||||||
|
auto texWidget = new TexPart(m_data);
|
||||||
|
texWidget->load(physis_gamedata_extract_file(m_data, m_material.textures[i]));
|
||||||
|
layout->addRow(i18n("Value:"), texWidget);
|
||||||
|
}
|
||||||
|
|
||||||
|
child = nullptr;
|
||||||
|
while ((child = m_constantsLayout->takeAt(0)) != nullptr) {
|
||||||
|
child->widget()->setParent(nullptr);
|
||||||
|
child->widget()->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < m_material.num_constants; i++) {
|
||||||
|
const auto constant = m_material.constants[i];
|
||||||
|
|
||||||
|
auto groupBox = new QGroupBox(QString::number(constant.id));
|
||||||
|
m_constantsLayout->addWidget(groupBox);
|
||||||
|
|
||||||
|
auto layout = new QFormLayout();
|
||||||
|
groupBox->setLayout(layout);
|
||||||
|
|
||||||
|
auto label = new QLabel(QString::number(constant.value));
|
||||||
|
layout->addRow(i18n("Value:"), label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue