Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessor validation message #67

Closed
torokze opened this issue Jan 26, 2020 · 4 comments
Closed

Accessor validation message #67

torokze opened this issue Jan 26, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@torokze
Copy link

torokze commented Jan 26, 2020

Hi,

If the accessor's component type not float the gltf validation shows a lot of INTEGER_WRITTEN_AS_FLOAT message. The min/max vector element type always float.

Zolee

@jessey-git
Copy link
Owner

Hi torokze, can you provide more details on how you received the validation error? Were you crafting the file manually using the fx-gltf api?

@jessey-git jessey-git added the question Further information is requested label May 19, 2020
@torokze
Copy link
Author

torokze commented May 20, 2020

Hi,
When I'm creating meshes using "indices" the index buffer min/max property written as a float value instead integer. Yes, I'm using fx-gltf to export a model from a CAD software.

The indexIV based on uint.
The localCreateGltfAccessor just a simple function to emplace a new accessor instance into an std::vector.

const auto gltfAccessorIdx = localCreateGltfAccessor();
auto& gltfAccessor = gltfAccessors[gltfAccessorIdx];
gltfAccessor.bufferView = 2;
gltfAccessor.componentType = gltf::Accessor::ComponentType::UnsignedInt;
gltfAccessor.byteOffset = indexStart * sizeof(indices.front());
gltfAccessor.type = gltf::Accessor::Type::Scalar;
gltfAccessor.count = polyIndices.size();
gltfAccessor.min.push_back(indexIV.min);
gltfAccessor.max.push_back(indexIV.max);
gltfPrimitive.indices = gltfAccessorIdx;

These accessors produces the warnings because the min/max values postfixed with '.0'.

Zolee

@jessey-git jessey-git added bug Something isn't working and removed question Further information is requested labels May 20, 2020
@jessey-git
Copy link
Owner

Ah, now I see, yes you are correct. I will attempt a fix when I can. In the meantime, if your applications support it, I believe the min/max values for Indices are optional and need not be specified.

jessey-git added a commit that referenced this issue May 22, 2020
@jessey-git jessey-git mentioned this issue Nov 8, 2020
jessey-git added a commit that referenced this issue Nov 8, 2020
* Fix issue #67

* Update copyright dates

* Commonize further
@jessey-git
Copy link
Owner

Give master a try if you can. This should now be fixed, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants