From 2de7d91fe78bdfd55bf237fd9383f5694319f0d3 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sat, 19 Sep 2015 14:14:31 -1000 Subject: [PATCH] Added UV Animation 8 --- DataSpec/Blender/RetroMasterShader.py | 30 ++++++++++++++++++++++++++- DataSpec/DNACommon/CMDL.hpp | 9 +++++--- DataSpec/DNAMP1/CMDLMaterials.cpp | 24 +++++++++++++++++++++ DataSpec/DNAMP1/CMDLMaterials.hpp | 27 ++++++++++++++++++++++-- 4 files changed, 84 insertions(+), 6 deletions(-) diff --git a/DataSpec/Blender/RetroMasterShader.py b/DataSpec/Blender/RetroMasterShader.py index ce2a52613..e1a9aeab9 100644 --- a/DataSpec/Blender/RetroMasterShader.py +++ b/DataSpec/Blender/RetroMasterShader.py @@ -402,6 +402,33 @@ def make_uva7(): new_grp.links.new(mult5.outputs[0], add2.inputs[1]) new_grp.links.new(add2.outputs[0], grp_out.inputs[0]) +# 8 - Mode 8 +def make_uva8(): + new_grp = bpy.data.node_groups.new('RetroUVMode8Node', 'ShaderNodeTree') + new_grp.inputs.new('NodeSocketVector', 'UV In') + new_grp.inputs.new('NodeSocketFloat', 'Param1') + new_grp.inputs.new('NodeSocketFloat', 'Param2') + new_grp.inputs.new('NodeSocketFloat', 'Param3') + new_grp.inputs.new('NodeSocketFloat', 'Param4') + new_grp.inputs.new('NodeSocketFloat', 'Param5') + new_grp.inputs.new('NodeSocketFloat', 'Param6') + new_grp.inputs.new('NodeSocketFloat', 'Param7') + new_grp.inputs.new('NodeSocketFloat', 'Param8') + new_grp.inputs.new('NodeSocketFloat', 'Param9') + new_grp.outputs.new('NodeSocketVector', 'UV Out') + new_grp.use_fake_user = True + + # Group inputs + grp_in = new_grp.nodes.new('NodeGroupInput') + grp_in.location = (-800, 0) + + # Group outputs + grp_out = new_grp.nodes.new('NodeGroupOutput') + grp_out.location = (0, 0) + + # Links + new_grp.links.new(grp_in.outputs[0], grp_out.inputs[0]) + UV_ANIMATION_GROUPS = ( make_uva0, make_uva1, @@ -410,7 +437,8 @@ UV_ANIMATION_GROUPS = ( make_uva4, make_uva5, make_uva6, - make_uva7 + make_uva7, + make_uva8 ) # MP3 / DKCR Material Passes: diff --git a/DataSpec/DNACommon/CMDL.hpp b/DataSpec/DNACommon/CMDL.hpp index c1d787905..75abcfb49 100644 --- a/DataSpec/DNACommon/CMDL.hpp +++ b/DataSpec/DNACommon/CMDL.hpp @@ -215,6 +215,12 @@ public: { return GX::Primitive(*m_cur++ & 0xf8); } + GX::Primitive readPrimitiveAndVat(unsigned& vatOut) + { + atUint8 val = *m_cur++; + vatOut = val & 0x7; + return GX::Primitive(val & 0xf8); + } atUint16 readVertCount() { atUint16 retval = HECL::SBig(*(atUint16*)m_cur); @@ -549,7 +555,6 @@ atUint32 ReadGeomSectionsToBlender(HECL::BlenderConnection::PyOutStream& os, while (dl) { - GX::Primitive ptype = dl.readPrimitive(); atUint16 vertCount = dl.readVertCount(); @@ -570,7 +575,6 @@ atUint32 ReadGeomSectionsToBlender(HECL::BlenderConnection::PyOutStream& os, atUint8 flip = 0; for (int v=0 ; v