KhronosGroup / OpenCOLLADA

652 stars 252 forks source link

Add Support for Batch IDs #585

Closed KermMartian closed 6 years ago

KermMartian commented 6 years ago

Modern use of COLLADA files with AnalyticalGraphicsInc/cesium requires having Batch ID information, which allows multiple distinct geometries to be combined into a single geometry instance while retaining information about what geometry to which the individual vertices and faces belong. AnalyticalGraphicsInc/3d-tiles/tree/master/TileFormats/Batched3DModel explains the batch system in more detail.

This PR adds support for Batch IDs, most notably. Its biggest change from the existing codebase is expanding the FloatOrDouble type to support integers as well, which feels like it would be useful for other integer/indexed data in the future as well.

KermMartian commented 6 years ago

Tagging @pjcozzi and @lilleyse for their thoughts. There will be a corresponding PR to the COLLADA2GLTF tool that uses this PR if/when it is accepted, allowing COLLADA files with Batch IDs to be properly converted all the way to GLB and beyond.

RemiArnaud commented 6 years ago

There must be some mis-understanding about what openCOLLADA is. This is an implementation of the COLLADA specification and schema. This addition is not in the spec and cannot be implemented as-is.

Khronos WG could work on the COLLADA spec and make additions of course, but before this happen this change cannot be considered.

However COLLADA is extensible, and you can propose an extension here: https://www.khronos.org/collada/wiki/Portal:Extensions_directory

you should be able to use COLLADA built in extension mechanism to implement it with the openCOLLADA library with no change in the code. However there may be bugs or issues that would require a PR.

Note also that changing this library would have no impact on exported files, you should implement extension in the Max, Maya and motion builder import/export code if you want content to be crated with the information you need. See for example the work that was done to support PhysX attributes directly in Maya and exported through a published extension.