ogxd / project-curator

A convenient tool to help cleaning and maintaining Unity Projects 🧹✨
Do What The F*ck You Want To Public License
152 stars 26 forks source link

ArgumentException: GUID required #20

Open rhys-vdw opened 1 year ago

rhys-vdw commented 1 year ago

I got a few of these:

ArgumentException: GUID required
Parameter name: guid
Ogxd.ProjectCurator.ProjectCurator.AssertGuidValid (System.String guid) (at ./Library/PackageCache/com.ogxd.project-curator@adc4b63683/Editor/ProjectCurator.cs:181)
Ogxd.ProjectCurator.ProjectCurator.RemoveAssetFromDatabase (System.String guid) (at ./Library/PackageCache/com.ogxd.project-curator@adc4b63683/Editor/ProjectCurator.cs:67)
Ogxd.ProjectCurator.AssetProcessor+<>c__DisplayClass3_0.<OnWillSaveAssets>b__0 () (at ./Library/PackageCache/com.ogxd.project-curator@adc4b63683/Editor/AssetProcessor.cs:39)
Ogxd.ProjectCurator.AssetProcessor.OnUpdate () (at ./Library/PackageCache/com.ogxd.project-curator@adc4b63683/Editor/AssetProcessor.cs:25)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <88872b21b1e746a7ad699974a2be8304>:0)

https://github.com/ogxd/project-curator/blob/6a70b7c196d4c99c1a6c5ad183abba1c3664ebe2/Editor/AssetProcessor.cs#L38

My guess is the path exists on save, but no longer exists when the action is dequeued in OnUpdate. Not sure how that could be, but the case should be handled.

If I keep seeing it I'll include more debug info here like logging out the problematic path so I can pinpoint the case.

Barina commented 1 year ago

Same here. getting this now and then. It may also affect the project window's ability to show previews (thumbnails) of assets..

rhys-vdw commented 1 year ago

Oh right, it's trivial to prevent the error! I'll open a PR. Just needs an if check from that context.

I hadn't realised it had any consequences beyond signalling that internal logic was flawed.

Barina commented 1 year ago

Lol I also didn't check if it really is the cause.. I think I'm too lazy for that 😅 Edit: Ok so I've completely remove Project Curator from the project and the thumbnails are still an issue.. so it isn't the project curator's fault (at least in my case) 😬

rhys-vdw commented 11 months ago

I've been keeping an eye out for this, but it happens so rarely.

Barina commented 11 months ago

I've been keeping an eye out for this, but it happens so rarely.

Really? lucky you.. I'm constantly getting it. I wonder why... image This is when creating a prefab from the scene

image This is when baking occlusion culling

image This from baking lighting..

They're all over the place in my case lol

rhys-vdw commented 11 months ago

Thanks for the repro cases, @Barina, I'll take a look into it. I've got a few PRs open here. I want to fix this one too.

rhys-vdw commented 10 months ago

Haven't attacked this yet, but I have discovered that a consistent repro is applying changes to an image. I suspect this is caused by sub-assets (because the Sprite asset is a child of the Image asset).

I'm not sure how dependencies are tracked with sub-assets, but the project curator is showing the correct things.

Barina commented 10 months ago

Hope this will be squashed soon :)