tl;dr: I’ve got a model that doesn’t render when it’s loaded, I don’t get any errors, and I’m trying to figure out how to debug it.
I’ve got code that converts from a CAD model format directly to an egg format string, and loads that into a NodePath. This is a snippet that approximates what I’m doing (there’s more support code that would bloat the post):
result = Builder.build_model(script_path=self.model_file_path) egg = EggData() success = egg.read(StringStream(str.encode(result["model"]))) pn = loadEggData(egg) self.model_container.append(NodePath(loadEggData(egg))) self.model_container[-1].reparentTo(render) self.model_container[-1].setColor(1, 0.5, 0, 1)
The Builder.build_model code tesselates the CAD model and gives back edges, indexes, and normals. It does not currently do UVs. It works fine with a box and a cylinder, but I’ve got a swept shape that has a taper that does not render in the view. Success is True from egg.read, and I don’t get any errors that I can see in the console. Here’s what the shape is supposed to look like:
There are multiple places things could have gone wrong in the conversion process. My code that does the CAD tessellation/conversion is still pretty naive at this point.
So I guess I have two questions:
- How should I got about debugging the egg model?
- Is the lack of inclusion of the UV data causing the problem?