Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use templates to process custom attributes #583

Merged
merged 6 commits into from
Jan 11, 2024

Conversation

thomas-tu
Copy link
Contributor

Purpose of this PR

Ticket/Jira #:

Use templated functions to get the custom attributes.

@@ -1761,49 +1661,49 @@ void aiMeshSample<T>::fillSplitVertices(int split_index, aiPolyMeshData& data) c
copy_or_clear_3_to_4<abcC4, abcC3>((abcC4*)data.rgb, m_rgb_ref, split);
}

static inline void copy_or_clear_vector(AttributeDataToTransfer dst[], const std::vector<AttributeData*>& src)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be templated as well ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

Copy link
Contributor

@SanaJal SanaJal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@thomas-tu thomas-tu merged commit 53b3069 into ABC464-Transfer-attributes Jan 11, 2024
4 of 74 checks passed
@thomas-tu thomas-tu deleted the dev/templated-arb-properties branch January 11, 2024 19:08
SanaJal pushed a commit that referenced this pull request Jan 13, 2024
* First pass to extract redundant code and have one single template function

* Use templates in other parts of aiMeshSchema to handle custom attributes.

* Fix post-merge issues

* Add specific supports for IC3f and IN4f attributes

* Remove test code

* Remove unused includes
thomas-tu added a commit that referenced this pull request Jan 30, 2024
* First pass to extract redundant code and have one single template function

* Use templates in other parts of aiMeshSchema to handle custom attributes.

* Fix post-merge issues

* Add specific supports for IC3f and IN4f attributes

* Remove test code

* Remove unused includes
thomas-tu added a commit that referenced this pull request Feb 22, 2024
…580)

* transfer harcoded array of float

* change subD to aiPolyMesh

* draft template function

fix commit

* working hardcoded

* hardcoded transfer of data assigned to array of attributeData

* set uv using custom attribute hardcoded

* generalize using switch step1

* fix color and push isConstant to map arrays correctly

* get resize count within the summary + better memory managment

clean

* remove commented testing function

* remove commented function

* working curve support

* only read the one that we currently support

* remove unused function

* better memory managment

* clean

* Use templates to process custom attributes (#583)

* First pass to extract redundant code and have one single template function

* Use templates in other parts of aiMeshSchema to handle custom attributes.

* Fix post-merge issues

* Add specific supports for IC3f and IN4f attributes

* Remove test code

* Remove unused includes

* working curve support

* only read the one that we currently support

* remove unused function

* better memory managment

* clean

* working curve templated

* templated copy data method

* working curve support

* remove unused function

* working curve templated

* templated copy data method

* clean

* clean

* missing generalizaiton

* rename att_int

* apply formatting

* remove static from function

* revert static

* remove copied function and clean readAttributes

* remove comment

* remove comment

* Format

---------

Co-authored-by: thomas-tu <45040865+thomas-tu@users.noreply.github.com>
Co-authored-by: Thomas Tu <thomastu@unity3d.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants