NaughtyAttributes icon indicating copy to clipboard operation
NaughtyAttributes copied to clipboard

[Issue] ShowAssetPreview - how can I increase preview size more?

Open TheEmbracedOne opened this issue 3 years ago • 7 comments

No matter what number I enter, it will always be the same size: image

[ShowAssetPreview(64, 64)] or [ShowAssetPreview(500, 500)], makes no difference, the preview always seems to be 110x64

I've looked through the ShowAssetPreviewPropertyDrawer and ShowAssetPreviewAttribute scripts and tried to play around with them to see if I can figure it out but I couldnt. Even changing the defaults : public const int DefaultWidth = 392; public const int DefaultHeight = 308;

only resulted in a minor size increase (seems to not go over 124 pixels in width still): image

If anyone could tell me what I could do to achieve a bigger preview size, I'd be very grateful.

TheEmbracedOne avatar Apr 12 '21 20:04 TheEmbracedOne

Hmm, that's really strange. What Unity version are you using?

dbrizov avatar Apr 13 '21 08:04 dbrizov

My version is 2019.4.9f1 I double checked the asset store page and I see "Supported Unity versions: 2020.2.1 or higher" - I will now try to upgrade to the 2020.3.3f1 LTS version and report back whether it's solved the issue! Sorry for the oversight, I think the version is the issue

TheEmbracedOne avatar Apr 13 '21 12:04 TheEmbracedOne

I've updated to 2020.3.3f1 and it has not fixed the issue. In fact, now there are no previews at all... this is what it looks like in the sample scene (I have reimported the package, so all scripts are unchanged from default): image

TheEmbracedOne avatar Apr 13 '21 19:04 TheEmbracedOne

Works well on my end, maybe some other custom property drawer is interfering with NA?

dbrizov avatar Apr 24 '21 10:04 dbrizov

@dbrizov I managed to get it to work and sorry for commenting on a closed issue this but no matter what amount I put in, the max size of the preview only goes up to a max of 124x70 Is this intended behaviour or am I supposed to be able to make it as big as I want? I tried to make it 384x216 but it still will just be 124x70

TheEmbracedOne avatar Apr 24 '21 13:04 TheEmbracedOne

@TheEmbracedOne Ok, I found what is happening. I was only testing with square resolutions 64x64, 100x100. It's working fine this way. When I try to use non-square resolutions as you do, 124x70 for example, the result is an image 124x124. But this is different from your case.

I also tried 256x256, and it seems that the largest preview is 128x128, and it can't get any larger than that. I am gonna reopen this issue and see what I can do.

I don't have any issues with invisible previews, however image

dbrizov avatar Apr 25 '21 19:04 dbrizov

Thank you @dbrizov The invisible preview has been solved, I'm not exactly sure how, I think after the first few restarts of Unity after the upgrade to 2020.3.3f1 it went away on its own. Thank you for your time and efforts, I love your work.

TheEmbracedOne avatar Apr 26 '21 01:04 TheEmbracedOne