mirror of
https://github.com/aimrebirth/tools.git
synced 2026-04-14 17:33:25 +00:00
[mod_converter] Allow to process and print loaded .mod files from Viewer.exe from AIM2 SDK.
This commit is contained in:
parent
27b175238a
commit
0f06403862
3 changed files with 14 additions and 2 deletions
|
|
@ -86,9 +86,10 @@ auto read_model(const path &fn)
|
|||
model m;
|
||||
if (fn.extension() == ".mod") // single block file from m2 sdk viewer
|
||||
{
|
||||
block bl;
|
||||
block bl = {};
|
||||
bl.printable = true; // allow to output
|
||||
bl.h.name = to_printable_string(fn.stem());
|
||||
bl.loadPayload(b);
|
||||
bl.loadPayloadAndProcess(b);
|
||||
m.blocks.push_back(bl);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -482,6 +482,12 @@ void block::load(const buffer &b)
|
|||
pmd = process_block(md);
|
||||
}
|
||||
|
||||
void block::loadPayloadAndProcess(const buffer &b)
|
||||
{
|
||||
loadPayload(b);
|
||||
pmd = process_block(md);
|
||||
}
|
||||
|
||||
void block::loadPayload(const buffer &data)
|
||||
{
|
||||
// anims
|
||||
|
|
@ -692,6 +698,9 @@ bool block::isEngineFx() const
|
|||
|
||||
bool block::canPrint() const
|
||||
{
|
||||
if (printable)
|
||||
return true;
|
||||
|
||||
// block all lods except 0
|
||||
if (!(h.all_lods == 15 || h.LODs.lod1))
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -343,6 +343,7 @@ struct block
|
|||
|
||||
void load(const buffer &b);
|
||||
void loadPayload(const buffer &b);
|
||||
void loadPayloadAndProcess(const buffer &b);
|
||||
void linkFaces();
|
||||
|
||||
std::string printMtl() const;
|
||||
|
|
@ -354,6 +355,7 @@ struct block
|
|||
|
||||
//
|
||||
processed_model_data pmd;
|
||||
bool printable = false;
|
||||
};
|
||||
|
||||
struct model
|
||||
|
|
|
|||
Loading…
Reference in a new issue