Skip to content

Conversation

@einarf
Copy link
Member

@einarf einarf commented Jun 16, 2018

We should allow users to override the material parser. They can simply make a subclass of the obj parser.

class CustomObjParser(ObjParser): material_parser_cls = CustomMaterialParser class CustomWavefront(Wafefront): parser_cls = CustomObjParser scene = CustomWavefront(...)

This is a lot less hassle than overriding methods possibly breaking forward compatibility.

@greenmoss
Copy link
Collaborator

greenmoss commented Jun 16, 2018

Is this related to #53?

Seems like a test case would be useful here.

I like the sub-classing approach. Pretty clean.

@einarf
Copy link
Member Author

einarf commented Jun 16, 2018

Not sure how to actually test this as it's the users responsibility to write a working parser. If you have any specific idea, don't hesitate to share it.

Seems I need to rebase this before merge anyway.

@einarf
Copy link
Member Author

einarf commented Jun 16, 2018

All done. Still not sure what test would cover this other than all existing parser tests.

@einarf
Copy link
Member Author

einarf commented Jun 17, 2018

This is not related to #53. It's just to allow people to override the material parser.

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

Labels

None yet

2 participants