#ifndef _DNAMP2_CMDL_MATERIALS_HPP_ #define _DNAMP2_CMDL_MATERIALS_HPP_ #include "../DNACommon/DNACommon.hpp" #include "../DNACommon/GX.hpp" #include "../DNAMP1/CMDLMaterials.hpp" #include "DNAMP2.hpp" namespace Retro { namespace DNAMP2 { /* Structurally identical to DNAMP1::MaterialSet except unk0 and unk1 fields */ struct MaterialSet : BigDNA { static constexpr bool OneSection() {return false;} DECL_DNA DNAMP1::MaterialSet::MaterialSetHead head; struct Material : BigDNA { DECL_DNA using Flags = DNAMP1::MaterialSet::Material::Flags; Flags flags; const Flags& getFlags() const {return flags;} Value textureCount; Vector texureIdxs; using VAFlags = DNAMP1::MaterialSet::Material::VAFlags; DNAMP1::MaterialSet::Material::VAFlags vaFlags; const VAFlags& getVAFlags() const {return vaFlags;} Value unk0; /* MP2 only */ Value unk1; /* MP2 only */ Value groupIdx; Vector konstCount; Vector konstColors; using BlendFactor = DNAMP1::MaterialSet::Material::BlendFactor; Value blendDstFac; Value blendSrcFac; Vector indTexSlot; Value colorChannelCount; Vector colorChannels; Value tevStageCount; Vector tevStages; Vector tevStageTexInfo; Value tcgCount; Vector tcgs; Value uvAnimsSize; Value uvAnimsCount; Vector uvAnims; }; Vector materials; static void RegisterMaterialProps(HECL::BlenderConnection::PyOutStream& out) { DNAMP1::MaterialSet::RegisterMaterialProps(out); } static void ConstructMaterial(HECL::BlenderConnection::PyOutStream& out, const MaterialSet::Material& material, unsigned groupIdx, unsigned matIdx); void readToBlender(HECL::BlenderConnection::PyOutStream& os, const PAKRouter& pakRouter, const PAKRouter::EntryType& entry, unsigned setIdx) { DNACMDL::ReadMaterialSetToBlender_1_2(os, *this, pakRouter, entry, setIdx); } }; } } #endif // _DNAMP2_CMDL_MATERIALS_HPP_