Skip to content

CURA-12544 saving and loading painted files in cura #7

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

wawanbreton
Copy link
Contributor

Save and load painted models textures in 3MF files

CURA-12544

CURA-12544
void setUVCoordinatesPerVertexAsBytes(const bytearray& data, const std::string& texture_path, Scene* scene);

std::string getTexturePath(const Scene* scene) const;

Choose a reason for hiding this comment

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

there is no way to set a texture path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You actually set it by using setUVCoordinatesPerVertexAsBytes, and I didn't need a direct setter so didn't create it

Choose a reason for hiding this comment

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

I don't understand, you set the texture path by calling the setUVCoordinatesPerVertexAsBytes function? I would expect to have to function, something akin to setUV and setTextureImage. You're saying setUVCoordinatesPerVertexAsBytes does both?

Copy link
Contributor Author

@wawanbreton wawanbreton Jun 10, 2025

Choose a reason for hiding this comment

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

Yes indeed... The UV coordinates are actually stored in two places:

  • The coordinates themselves are stored in the global resources
  • The mesh stores indices of the coordinates for each of its faces

Then the texture is also stored in a separate resource, linked from the coordinates. So in order to simplify the management and avoid mistakes, I decided to add it all to a single call. But maybe I should rename the function then, because it does more than advertised.

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