#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 { DECL_DNA DNAMP1::MaterialSet::MaterialSetHead head; struct Material : BigDNA { DECL_DNA DNAMP1::MaterialSet::Material::Flags flags; Value textureCount; Vector texureIdxs; using VAFlags = DNAMP1::MaterialSet::Material::VAFlags; DNAMP1::MaterialSet::Material::VAFlags vaFlags; inline const VAFlags& getVAFlags() const {return vaFlags;} Value unk0; /* MP2 only */ Value unk1; /* MP2 only */ Value groupIdx; Vector konstCount; Vector konstColors; Value _blendDstFac; using BlendFactor = DNAMP1::MaterialSet::Material::BlendFactor; inline BlendFactor blendDestFactor() const {return BlendFactor(_blendDstFac);} inline void setBlendDestFactor(BlendFactor fac) {_blendDstFac = fac;} Value _blendSrcFac; inline BlendFactor blendSrcFactor() const {return BlendFactor(_blendSrcFac);} inline void setBlendSrcFactor(BlendFactor fac) {_blendSrcFac = fac;} 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 inline 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); inline void readToBlender(HECL::BlenderConnection::PyOutStream& os, const PAKRouter& pakRouter, const typename PAKRouter::EntryType& entry, std::vector& attributesOut, unsigned setIdx) { DNACMDL::ReadMaterialSetToBlender_1_2(os, *this, pakRouter, entry, attributesOut, setIdx); } }; } } #endif // _DNAMP2_CMDL_MATERIALS_HPP_