mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
gltf, doc: warn that nodes using matrix transforms mustn't be animated (this is in the spec)
This commit is contained in:
parent
4dacb66693
commit
704821c41e
2 changed files with 8 additions and 1 deletions
|
@ -312,6 +312,9 @@ due to their space savings.
|
||||||
|
|
||||||
Bone weights should be normalized, e.g. using ["normalize all" in Blender](https://docs.blender.org/manual/en/4.2/grease_pencil/modes/weight_paint/weights_menu.html#normalize-all).
|
Bone weights should be normalized, e.g. using ["normalize all" in Blender](https://docs.blender.org/manual/en/4.2/grease_pencil/modes/weight_paint/weights_menu.html#normalize-all).
|
||||||
|
|
||||||
|
Note that nodes using matrix transforms must not be animated.
|
||||||
|
This also extends to bone overrides, which must not be applied to them.
|
||||||
|
|
||||||
You can use the [Khronos glTF validator](https://github.com/KhronosGroup/glTF-Validator)
|
You can use the [Khronos glTF validator](https://github.com/KhronosGroup/glTF-Validator)
|
||||||
to check whether a model is a valid glTF file.
|
to check whether a model is a valid glTF file.
|
||||||
|
|
||||||
|
|
|
@ -632,7 +632,6 @@ void SelfType::MeshExtractor::loadAnimation(const std::size_t animIdx)
|
||||||
{
|
{
|
||||||
const auto &anim = m_gltf_model.animations->at(animIdx);
|
const auto &anim = m_gltf_model.animations->at(animIdx);
|
||||||
for (const auto &channel : anim.channels) {
|
for (const auto &channel : anim.channels) {
|
||||||
|
|
||||||
const auto &sampler = anim.samplers.at(channel.sampler);
|
const auto &sampler = anim.samplers.at(channel.sampler);
|
||||||
|
|
||||||
bool interpolate = ([&]() {
|
bool interpolate = ([&]() {
|
||||||
|
@ -653,6 +652,11 @@ void SelfType::MeshExtractor::loadAnimation(const std::size_t animIdx)
|
||||||
throw std::runtime_error("no animated node");
|
throw std::runtime_error("no animated node");
|
||||||
|
|
||||||
auto *joint = m_loaded_nodes.at(*channel.target.node);
|
auto *joint = m_loaded_nodes.at(*channel.target.node);
|
||||||
|
if (std::holds_alternative<core::matrix4>(joint->transform)) {
|
||||||
|
warn("nodes using matrix transforms must not be animated");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
switch (channel.target.path) {
|
switch (channel.target.path) {
|
||||||
case tiniergltf::AnimationChannelTarget::Path::TRANSLATION: {
|
case tiniergltf::AnimationChannelTarget::Path::TRANSLATION: {
|
||||||
const auto outputAccessor = Accessor<core::vector3df>::make(m_gltf_model, sampler.output);
|
const auto outputAccessor = Accessor<core::vector3df>::make(m_gltf_model, sampler.output);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue