diff --git a/components/nif/controller.cpp b/components/nif/controller.cpp index d4ba54b840..82116378de 100644 --- a/components/nif/controller.cpp +++ b/components/nif/controller.cpp @@ -180,6 +180,23 @@ namespace Nif interpolator.post(nif); } + void NiMultiTargetTransformController::read(NIFStream *nif) + { + Controller::read(nif); + size_t numTargets = nif->getUShort(); + std::vector targets; + targets.resize(numTargets); + for (size_t i = 0; i < targets.size(); i++) + targets[i].read(nif); + mExtraTargets = targets; + } + + void NiMultiTargetTransformController::post(NIFFile *nif) + { + Controller::post(nif); + mExtraTargets.post(nif); + } + void NiFloatInterpController::read(NIFStream *nif) { Controller::read(nif); diff --git a/components/nif/controller.hpp b/components/nif/controller.hpp index e14aba46ad..06de446a0d 100644 --- a/components/nif/controller.hpp +++ b/components/nif/controller.hpp @@ -148,6 +148,14 @@ struct NiKeyframeController : public Controller void post(NIFFile *nif) override; }; +struct NiMultiTargetTransformController : public Controller +{ + NodeList mExtraTargets; + + void read(NIFStream *nif) override; + void post(NIFFile *nif) override; +}; + struct NiFloatInterpController : public Controller { NiFloatDataPtr data; diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index b0a389699b..95a433f789 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -137,6 +137,7 @@ static std::map makeFactory() {"NiBoolInterpolator" , &construct }, {"NiPoint3Interpolator" , &construct }, {"NiTransformController" , &construct }, + {"NiMultiTargetTransformController" , &construct }, {"NiTransformInterpolator" , &construct }, {"NiColorInterpolator" , &construct }, {"BSShaderTextureSet" , &construct }, diff --git a/components/nif/record.hpp b/components/nif/record.hpp index 37084af44e..205273ad96 100644 --- a/components/nif/record.hpp +++ b/components/nif/record.hpp @@ -144,7 +144,8 @@ enum RecordType RC_BSLightingShaderProperty, RC_NiClusterAccumulator, RC_NiAlphaAccumulator, - RC_NiSortAdjustNode + RC_NiSortAdjustNode, + RC_NiMultiTargetTransformController }; /// Base class for all records