mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 15:42:57 +02:00
Add passthrough config to PrepareJointsTask
This commit is contained in:
parent
9c9dc553a2
commit
aef696efe6
2 changed files with 47 additions and 25 deletions
|
@ -50,10 +50,18 @@ QMap<QString, glm::quat> getJointRotationOffsets(const QVariantHash& mapping) {
|
|||
return jointRotationOffsets;
|
||||
}
|
||||
|
||||
void PrepareJointsTask::configure(const Config& config) {
|
||||
_passthrough = config.passthrough;
|
||||
}
|
||||
|
||||
void PrepareJointsTask::run(const baker::BakeContextPointer& context, const Input& input, Output& output) {
|
||||
const auto& jointsIn = input.get0();
|
||||
const auto& mapping = input.get1();
|
||||
auto& jointsOut = output.edit0();
|
||||
|
||||
if (_passthrough) {
|
||||
jointsOut = jointsIn;
|
||||
} else {
|
||||
const auto& mapping = input.get1();
|
||||
auto& jointRotationOffsets = output.edit1();
|
||||
auto& jointIndices = output.edit2();
|
||||
|
||||
|
@ -84,3 +92,4 @@ void PrepareJointsTask::run(const baker::BakeContextPointer& context, const Inpu
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,13 +18,26 @@
|
|||
|
||||
#include "Engine.h"
|
||||
|
||||
// The property "passthrough", when enabled, will let the input joints flow to the output unmodified, unlike the disabled property, which discards the data
|
||||
class PrepareJointsTaskConfig : public baker::JobConfig {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool passthrough MEMBER passthrough)
|
||||
public:
|
||||
bool passthrough { false };
|
||||
};
|
||||
|
||||
class PrepareJointsTask {
|
||||
public:
|
||||
using Config = PrepareJointsTaskConfig;
|
||||
using Input = baker::VaryingSet2<std::vector<hfm::Joint>, QVariantHash /*mapping*/>;
|
||||
using Output = baker::VaryingSet3<std::vector<hfm::Joint>, QMap<int, glm::quat> /*jointRotationOffsets*/, QHash<QString, int> /*jointIndices*/>;
|
||||
using JobModel = baker::Job::ModelIO<PrepareJointsTask, Input, Output>;
|
||||
using JobModel = baker::Job::ModelIO<PrepareJointsTask, Input, Output, Config>;
|
||||
|
||||
void configure(const Config& config);
|
||||
void run(const baker::BakeContextPointer& context, const Input& input, Output& output);
|
||||
|
||||
protected:
|
||||
bool _passthrough { false };
|
||||
};
|
||||
|
||||
#endif // hifi_PrepareJointsTask_h
|
Loading…
Reference in a new issue