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

Major error handling bugs #442

Open
ivalylo opened this issue Jun 9, 2016 · 3 comments
Open

Major error handling bugs #442

ivalylo opened this issue Jun 9, 2016 · 3 comments

Comments

@ivalylo
Copy link

ivalylo commented Jun 9, 2016

There is a function called handleFWLError() which returns true if the parsing should stop (either because of the IErrorHandler or a critical error). On most places, it's used like this though:

success = handleFWLError ( )

I.e. it does exactly the opposite.
There are also palaces like this one where the result is not handled at all:

if ( positionInput == 0 )
handleFWLError ( SaxFWLError::ERROR_DATA_NOT_VALID, "No positions, can't import!", IError::SEVERITY_CRITICAL );
mPositionsOffset = positionInput->getOffset ();

The code directly crashes of course. Tested also with the Maya importer.

@ivalylo ivalylo changed the title Major error handlig bugs Major error handling bugs Jun 9, 2016
@RemiArnaud
Copy link
Contributor

Thanks for this report.
Any chance you could create a PR ?

@ivalylo
Copy link
Author

ivalylo commented Jun 11, 2016

I work with forked version of OpenCOLLADA and can't contribute a patch since I can't test it with the official version. I can upload the fork itself on github if it will be of any interest when I've tested it. Here is what I'm changing from the official version:

  • new hybrid parsing - IWriter methods should be able to return new code that means - don't delete the item, add it to the loader (similar to the items added for the post-processor). Then the loader itself provides a DOM fashion interface with the requested items. The idea is to simplify the loading and SAX parse just the meshes or any other items you can process out of order and it's worth the trouble.
  • consistent use of FW_NEW/FW_DELETE. Or even converting them to more flexible custom allocator functions (like in the FBX SDK)
    • custom file IO interface.
  • fix the Texture and Light object report in the IExtraDataCallbackHandler::parseElement. The getObject() methods didn't implement this
  • the color/uv sets have some weird initial index which offsets the indices reported for additional sets. There is also a comment in the COLLADA to glTF converter about this weirdness. I removed it,
    • I would want to fix the index data duplication in the mesh loader, so it can be reused, but I don't know if I will have time since it's more involved. For example normals/tangents/binormals would likely use the same indices, but currently (if I understand the code properly), the same indices will be loaded 3 times.

@RemiArnaud
Copy link
Contributor

if you forked from this repo, you should be able to create a branch matching the common ancestry and do the patch. you can merge the updated openCOLLADA changes too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants