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

Regenerate Assets - Bugs When Using Perforce (maybe any Source Control) #39

Closed
HomerJohnston opened this issue Jul 4, 2021 · 1 comment · Fixed by #43
Closed

Regenerate Assets - Bugs When Using Perforce (maybe any Source Control) #39

HomerJohnston opened this issue Jul 4, 2021 · 1 comment · Fixed by #43
Assignees

Comments

@HomerJohnston
Copy link

HomerJohnston commented Jul 4, 2021

When using perforce, CodeGenerator::GenerateAssets() immediately deletes all files in the Generated folder. This causes UE to mark the files for Delete in source control. After the assets are regenerated, their status cannot be altered in source control, they are stuck on being marked for delete. The files must be deleted by source control, or reverted by the user so they can't be updated, there is no way to avoid this. The user must submit the deletion to source control, and then run Regenerate a second time to recreate the assets. Then they will be marked for add and can be re-added. The cycle continues for infinity.

A possible fix is:

  • Instead of blindly deleting all existing generated uassets, just make a list of them.
  • Generate assets and populate a second list containing the (re)generated assets.
  • Compare the two lists, and only delete any assets that were not (re)generated. In other words, only delete actual stale asset files.
  • UE will naturally detect modifications to the modified files and open the check out prompt dialog (I have a very rough implementation working locally, may clean up and do a PR later if I can find time)
@brwarner
Copy link
Contributor

Hey there,

Sorry for the long delay. I'm taking over development of the Unreal plugin at Articy and working my way through our backlog of issues.

I've merged a PR into our development branch (#42) that should solve the issue, though I realize now I haven't tested it for when files actually need to be deleted, only when they weren't supposed to be deleted. I'll tackle that next to make sure it's handling everything properly.

It sounds like your fix was a lot more complex than mine. I basically just forced Unreal to mark all the packages we need as "for edit" after they're regenerated.

@brwarner brwarner linked a pull request Aug 19, 2021 that will close this issue
@brwarner brwarner linked a pull request Aug 19, 2021 that will close this issue
@brwarner brwarner self-assigned this Aug 19, 2021
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 a pull request may close this issue.

2 participants