update to work with refactor
This commit is contained in:
parent
9d6f42aba4
commit
1af1d7f016
|
@ -27,11 +27,12 @@ FbxAnimCurve *FbxBlendShapesAccess::BlendChannel::ExtractAnimation(unsigned int
|
||||||
|
|
||||||
FbxBlendShapesAccess::BlendChannel::BlendChannel(
|
FbxBlendShapesAccess::BlendChannel::BlendChannel(
|
||||||
FbxMesh *mesh, const unsigned int blendShapeIx, const unsigned int channelIx, const FbxDouble deformPercent,
|
FbxMesh *mesh, const unsigned int blendShapeIx, const unsigned int channelIx, const FbxDouble deformPercent,
|
||||||
const std::vector<FbxBlendShapesAccess::TargetShape> &targetShapes) : mesh(mesh),
|
const std::vector<FbxBlendShapesAccess::TargetShape> &targetShapes, std::string name) : mesh(mesh),
|
||||||
blendShapeIx(blendShapeIx),
|
blendShapeIx(blendShapeIx),
|
||||||
channelIx(channelIx),
|
channelIx(channelIx),
|
||||||
deformPercent(deformPercent),
|
deformPercent(deformPercent),
|
||||||
targetShapes(targetShapes)
|
targetShapes(targetShapes),
|
||||||
|
name(name)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
std::vector<FbxBlendShapesAccess::BlendChannel> FbxBlendShapesAccess::extractChannels(FbxMesh *mesh) const
|
std::vector<FbxBlendShapesAccess::BlendChannel> FbxBlendShapesAccess::extractChannels(FbxMesh *mesh) const
|
||||||
|
@ -46,11 +47,17 @@ std::vector<FbxBlendShapesAccess::BlendChannel> FbxBlendShapesAccess::extractCha
|
||||||
if (fbxChannel->GetTargetShapeCount() > 0) {
|
if (fbxChannel->GetTargetShapeCount() > 0) {
|
||||||
std::vector<TargetShape> targetShapes;
|
std::vector<TargetShape> targetShapes;
|
||||||
const double *fullWeights = fbxChannel->GetTargetShapeFullWeights();
|
const double *fullWeights = fbxChannel->GetTargetShapeFullWeights();
|
||||||
|
std::string name = std::string(fbxChannel->GetName());
|
||||||
|
|
||||||
|
if (verboseOutput) {
|
||||||
|
fmt::printf("\rblendshape channel: %s\n", name);
|
||||||
|
}
|
||||||
|
|
||||||
for (int targetIx = 0; targetIx < fbxChannel->GetTargetShapeCount(); targetIx ++) {
|
for (int targetIx = 0; targetIx < fbxChannel->GetTargetShapeCount(); targetIx ++) {
|
||||||
FbxShape *fbxShape = fbxChannel->GetTargetShape(targetIx);
|
FbxShape *fbxShape = fbxChannel->GetTargetShape(targetIx);
|
||||||
targetShapes.emplace_back(fbxShape, fullWeights[targetIx]);
|
targetShapes.emplace_back(fbxShape, fullWeights[targetIx]);
|
||||||
}
|
}
|
||||||
channels.emplace_back(mesh, shapeIx, channelIx, fbxChannel->DeformPercent * 0.01, targetShapes);
|
channels.emplace_back(mesh, shapeIx, channelIx, fbxChannel->DeformPercent * 0.01, targetShapes, name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,8 @@ public:
|
||||||
const unsigned int blendShapeIx,
|
const unsigned int blendShapeIx,
|
||||||
const unsigned int channelIx,
|
const unsigned int channelIx,
|
||||||
const FbxDouble deformPercent,
|
const FbxDouble deformPercent,
|
||||||
const std::vector<TargetShape> &targetShapes
|
const std::vector<TargetShape> &targetShapes,
|
||||||
|
const std::string name
|
||||||
);
|
);
|
||||||
|
|
||||||
FbxAnimCurve *ExtractAnimation(unsigned int animIx) const;
|
FbxAnimCurve *ExtractAnimation(unsigned int animIx) const;
|
||||||
|
@ -74,6 +75,7 @@ public:
|
||||||
const unsigned int blendShapeIx;
|
const unsigned int blendShapeIx;
|
||||||
const unsigned int channelIx;
|
const unsigned int channelIx;
|
||||||
const std::vector<TargetShape> targetShapes;
|
const std::vector<TargetShape> targetShapes;
|
||||||
|
const std::string name;
|
||||||
|
|
||||||
const FbxDouble deformPercent;
|
const FbxDouble deformPercent;
|
||||||
};
|
};
|
||||||
|
|
|
@ -97,7 +97,7 @@ struct GltfModel
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
std::shared_ptr<AccessorData> AddAccessorWithView(
|
std::shared_ptr<AccessorData> AddAccessorWithView(
|
||||||
BufferViewData &bufferView, const GLType &type, const std::vector<T> &source)
|
BufferViewData &bufferView, const GLType &type, const std::vector<T> &source, std::string name)
|
||||||
{
|
{
|
||||||
auto accessor = accessors.hold(new AccessorData(bufferView, type));
|
auto accessor = accessors.hold(new AccessorData(bufferView, type));
|
||||||
accessor->appendAsBinaryArray(source, *binary);
|
accessor->appendAsBinaryArray(source, *binary);
|
||||||
|
@ -110,7 +110,15 @@ struct GltfModel
|
||||||
BufferData &buffer, const GLType &type, const std::vector<T> &source)
|
BufferData &buffer, const GLType &type, const std::vector<T> &source)
|
||||||
{
|
{
|
||||||
auto bufferView = GetAlignedBufferView(buffer, BufferViewData::GL_ARRAY_NONE);
|
auto bufferView = GetAlignedBufferView(buffer, BufferViewData::GL_ARRAY_NONE);
|
||||||
return AddAccessorWithView(*bufferView, type, source);
|
return AddAccessorWithView(*bufferView, type, source, std::string(""));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
std::shared_ptr<AccessorData> AddAccessorAndView(
|
||||||
|
BufferData &buffer, const GLType &type, const std::vector<T> &source, std::string name)
|
||||||
|
{
|
||||||
|
auto bufferView = GetAlignedBufferView(buffer, BufferViewData::GL_ARRAY_NONE);
|
||||||
|
return AddAccessorWithView(*bufferView, type, source, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
|
|
Loading…
Reference in New Issue