YulioTech / SketchUp-glTF-Exporter-Ruby

Ruby based SketchUp glTF Exporter
MIT License
48 stars 17 forks source link

Sketchup glTF exporter doesn't use components #1

Open jakakordez opened 5 years ago

jakakordez commented 5 years ago

I have already filed this issue on the official glTF repository, but they told me I should file it somewhere else. So now I am trying my luck here.

I have a Sketchup file that has meshes arranged in a hierarchy of components. Each component represents a logical part of my model and has its own coordinate origin set properly (not aligned with the origin of the whole model).

I would expect that exporting the model would result in a glTF file where nodes would represent component instances (re-using the nodes isn't possible according to the glTF 2.0 specification because one node can't have multiple parents) and each node would have a transformation matrix set to represent the origin of its component. Nodes that represent same components should probably also reference same meshes. And finally since a node represents a component instance it should contain the name of the instance ('Instance' string instead of 'Definition' in 'Entity Info' window).

Instead component hierarchy is represented with nodes but doesn't bring any added value since all meshes are duplicated, all matrices are identities and all coordinates are set to global coordinates of the model. The model renders correctly but I would like to dynamically change transformations of components in my application to move some of its parts.

promontis commented 4 years ago

@jakakordez this is exactly what I need as well! To make sure, you are asking that the exporter should export using this feature: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#instantiation

If so, I'm looking into changing the exporter so that it uses that feature.