Skip to content

Cancelling changing the texture in Ember removes path and ember crashes if texture cannot be found when loaded#1132

Merged
AristurtleDev merged 1 commit into
MonoGame-Extended:developfrom
ericlothspeich:fix/preserve-texture-path
Apr 10, 2026
Merged

Cancelling changing the texture in Ember removes path and ember crashes if texture cannot be found when loaded#1132
AristurtleDev merged 1 commit into
MonoGame-Extended:developfrom
ericlothspeich:fix/preserve-texture-path

Conversation

@ericlothspeich

Copy link
Copy Markdown
Contributor

Description

Choosing the texture slot in Ember when a texture is already loaded wipes the path. If the user chooses cancel, the texture only shows name and extension. If the ember project is saved, the path is removed from the ember file. Opening the file later, crashes the program

Related Issues/Tickets

closes #1131

Changes Made

One-line change in ParticleEffectSerializer.ReadTexture2DRegion: use name (the original relative path read from the XML attribute) instead of Path.GetFileName(path) when setting texture.Name.

Checklist

Please read and check the following items. Pull requests will not be reviewed if all items are not checked.

  • I have verified that there are no existing pull requests that would overlap with this pull request.
  • I have verified that I am following the guidelines as outlined in this project's contribution policy
  • I have verified that this pull request adheres to this project's code of conduct.
  • I have written a descriptive title for this pull request.
  • I have provided appropriate test coverage were applicable.

When deserializing a .ember file, texture.Name was set to
Path.GetFileName(path) which stripped the relative directory.
On re-save, the full relative path was lost, causing the texture
to not be found when reopening the file.

Preserve the original relative path from the .ember file instead.
@ericlothspeich
ericlothspeich marked this pull request as ready for review March 30, 2026 06:13
@AristurtleDev

Copy link
Copy Markdown
Collaborator

Thanks @ericlothspeich i'll have to review this a little later this afternoon

@AristurtleDev AristurtleDev self-assigned this Mar 31, 2026
@AristurtleDev AristurtleDev added bug Something is broken, crashes, regresses, or behaves unexpectedly scope: particles Particle effects system: emitters, modifiers, profiles, and .pe pipeline integration status: needs-review PR is ready for review (prefer on PRs, not issues) labels Mar 31, 2026
@ericlothspeich

Copy link
Copy Markdown
Contributor Author

Thanks @ericlothspeich i'll have to review this a little later this afternoon

Yup! Thanks for all the work!

@AristurtleDev

Copy link
Copy Markdown
Collaborator

Sorry again for the delay. I wanted to check if there was anywhere else, maybe on the ember side, that something should be checked as well, but this looks like the best fix for it

@AristurtleDev
AristurtleDev merged commit 301fef8 into MonoGame-Extended:develop Apr 10, 2026
1 check passed
@ericlothspeich

Copy link
Copy Markdown
Contributor Author

Glad I could help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken, crashes, regresses, or behaves unexpectedly scope: particles Particle effects system: emitters, modifiers, profiles, and .pe pipeline integration status: needs-review PR is ready for review (prefer on PRs, not issues)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ember editor crash after path of texture is lost

2 participants