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

TensorToMesh: Node to convert a position and vertexIds tensors into a mesh. #6224

Open
wants to merge 1 commit into
base: 1.5_maintenance
Choose a base branch
from

Conversation

lucienfostier
Copy link
Collaborator

@lucienfostier lucienfostier commented Jan 21, 2025

  • GafferML: Add support for converting tensors into a mesh

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Gaffer project's prevailing coding style and conventions.

@lucienfostier lucienfostier changed the base branch from main to 1.5_maintenance January 21, 2025 05:14
@lucienfostier lucienfostier force-pushed the tensorToMeshPR branch 2 times, most recently from b7a00b5 to 6767964 Compare January 21, 2025 05:29
@lucienfostier lucienfostier marked this pull request as draft January 21, 2025 06:14
Copy link
Member

@johnhaddon johnhaddon left a comment

Choose a reason for hiding this comment

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

Nice one, thanks Lucien! I've made a few comments inline but it's all pretty minor.

One thing I'm wondering is if different mesh-generating models in the wild all use this same format for defining the mesh data, or if there is lots of variation as there is for image data? Does this node just handle data from one specific model, or does it stand a good chance of being general purpose?

Cheers...
John

include/GafferML/TensorToMesh.h Outdated Show resolved Hide resolved
include/GafferML/TensorToMesh.h Outdated Show resolved Hide resolved
include/GafferML/TensorToMesh.h Outdated Show resolved Hide resolved
python/GafferMLUI/TensorToMeshUI.py Outdated Show resolved Hide resolved
Comment on lines +40 to +44
Gaffer.Metadata.registerNode(

GafferML.TensorToMesh,
Copy link
Member

Choose a reason for hiding this comment

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

We need documentation for this node and the plugs - the lack is causing a test failure at present.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

addressed here 9550acb

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the plug docs - we just need a description for the node itself now.

python/GafferMLUI/__init__.py Outdated Show resolved Hide resolved
src/GafferML/TensorToMesh.cpp Outdated Show resolved Hide resolved
@lucienfostier
Copy link
Collaborator Author

Nice one, thanks Lucien! I've made a few comments inline but it's all pretty minor.

One thing I'm wondering is if different mesh-generating models in the wild all use this same format for defining the mesh data, or if there is lots of variation as there is for image data? Does this node just handle data from one specific model, or does it stand a good chance of being general purpose?

Cheers... John

Honestly, I don't know...SMPL is the only mesh generation model I've been experimenting with and the one we plan to use soon at IE.

To avoid any bad surprise I added extra validation of the input tensors but the node might need some change in the future depending on further experiment with other models.

That being said, I'd like to think that it's a fairly reasonable assumption to make that a mesh should be a collection of 3d point coordinates and a list of vertexIds.

Do you have any suggestion to make this more generic or should we wait until we use different ML model generating or processing mesh to make adjustment?

After all I think GafferML is still in "experimental" so that's the time we can gather knowledge and break stuff...

@boberfly
Copy link
Collaborator

I've not tried this one yet but I was going to give this one a go eventually with GafferML - it might add some more insight to what kind of data it outputs:
https://github.com/microsoft/TRELLIS

@johnhaddon
Copy link
Member

Honestly, I don't know...That being said, I'd like to think that it's a fairly reasonable assumption to make that a mesh should be a collection of 3d point coordinates and a list of vertexIds.

Do you have any suggestion to make this more generic or should we wait until we use different ML model generating or processing mesh to make adjustment?

I don't have any alternative ideas, and in the absence of other use cases I think this is fine - I was just wondering if you might know about other potential representations. I did take a brief look at TRELLIS and found some evidence that it's using the same layout.

Here is an optional commit that renames everything to match Gaffer's convention:

I think I do have a mild personal preference for the updated names, but will leave the choice to you.

Could you address the documentation for the node itself and squash everything down ready for merging please?

@lucienfostier lucienfostier changed the title TensorToMesh: Node to convert a vertices and faces tensor into a mesh. TensorToMesh: Node to convert a position and vertexIds tensors into a mesh. Jan 24, 2025
@lucienfostier lucienfostier marked this pull request as ready for review January 24, 2025 03:20
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.

3 participants