com.unity.formats.alembic
com.unity.formats.alembic copied to clipboard
[ABC-464] Read and transfer Polymesh custom attributes
Purpose of this PR
Ticket/Jira #: ABC-464 and ABC-465
In this PR we handle the following :
- C++ side :
- Reading the custom attribute :
- template function to read the attributes :
aiMeshSchema<T,U>::ReadAttribute. - struct to store all the data needed for the process of the attribute :
AttributeData
- template function to read the attributes :
- Process the custom attributes
- Add support of custom attributes in :
-
aiMeshSchema<T, U>::updateSummary()-aiMeshSchema<T, U>::readSampleBody()-aiMeshSchema<T, U>::cookSampleBody - Handle the different scopes :
aiMeshSchema<T, U>::onTopologyChange
- Add support of custom attributes in :
-
- Transfer the attributes to C# :
- Structure to transfer :
struct AttributeDataToTransfer copy_or_clear_vector(AttributeDataToTransfer dst[], const std::vector<AttributeData*>& src)
- Structure to transfer :
- Reading the custom attribute :
- C# side :
- Define
AttributeDatastucture that corresponds toAttributeDatatoTransferdefined in C++ - Allocate enough space for the custom attributes in
AlembicMesh.AbcSyncDataBegin - For testing, we are processing the colors custom attributes and applying them to the meshes :
AlembicMesh.ProcessData
- Define
This PR also contains also the code for ABC-486 - Get the number of custom attribute before filling the data . It made more sense to make this in the same PR as the way it was done before did not allow for testing the core feature (reading attribute and transferring them) without changing the hardcoded value in the code. There were also an error in the type we used to pass in the struct.
Testing
Functional Testing status:
Manual testing :
- import assets and inspect the data in C# once the vertex buffer is filled.
- import asset with color attributes (ex: attributeScopeCubes.zip), allow you to see the color applied to the meshes directly in the scene.
Performance Testing status:
N/A
Overall Product Risks
Complexity: Medium
Halo Effect:
Documentation & UX Writing
| User facing text to review | Details | |
|---|---|---|
| User interface | Y | |
| Public API docs | Y | |
| Changelog | Y |
| Documentation halo effect | Jira link | |
|---|---|---|
| User manual | ||
| Other docs |
Additional information
Note to reviewers:
Reminder:
- [ ] Add entry in CHANGELOG.md