x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Thumbnail Renderer Issue

I found in a case thumbnails of custom types could look differently in the Content Browser from in the Details Panels if I drew a texture not filling the whole canvas.

So I created a simple asset type to test the case. It has a thumbnail renderer to draw a given texture on the canvas with given padding.

In the following picture, you can see when the given texture is drawn with a padding of 10 pixels, the thumbnail in the Content Browser looks fine but it's not true in the Details Panel. alt text If I try to increase the padding, the space surrounding the given texture will expand further like the following picture with 20 pixel padding. alt text Hence, I think it is a bug and hope someone can fix it because I am doing something like that in my plug-in.

If someone wants to reproduce the bug, they can use the following code:

My test asset type:

 UCLASS(BlueprintType, Blueprintable)
 class TESTTHUMBNAIL_API UMyAsset : public UObject
 {
     GENERATED_BODY()
     
 public:    
 
     UPROPERTY(EditAnywhere)
     class UMyAsset* TestAsset;
 
     /* Specifies the background texture of the thumbnail. */
     UPROPERTY(EditAnywhere, Category = "Thumbnail")
     class UTexture2D* ThumbnailTexture;
 
     UPROPERTY(EditAnywhere, Category = "Thumbnail", Meta = (ClampMin = 0, UIMin = 0))
     FMargin ThumbnailPadding;
     
 };

A Thumbnail renderer for the asset type:

 UCLASS()
 class TESTTHUMBNAILEDITOR_API UMyAssetThumbnailRenderer : public UThumbnailRenderer
 {
     GENERATED_BODY()
     
     // UThumbnailRenderer interface
     virtual void Draw(UObject* Object, int32 X, int32 Y, uint32 Width, uint32 Height, FRenderTarget*, FCanvas* Canvas) override;
     // End of UThumbnailRenderer interface        
 };

 void UMyAssetThumbnailRenderer::Draw(UObject* Object, int32 X, int32 Y, uint32 Width, uint32 Height, FRenderTarget*, FCanvas* Canvas)
 {
     UMyAsset* Asset = Cast<UMyAsset>(Object);
     if (Asset == nullptr || Asset->ThumbnailTexture == nullptr ) { return; }
 
     Canvas->DrawTile(
         (float)X + Asset->ThumbnailPadding.Left,
         (float)Y + Asset->ThumbnailPadding.Top,
         (float)Width - Asset->ThumbnailPadding.Left - Asset->ThumbnailPadding.Right,
         (float)Height - Asset->ThumbnailPadding.Top - Asset->ThumbnailPadding.Bottom,
         0.0f,
         0.0f,
         1.0f,
         1.0f,
         FLinearColor::White,
         Asset->ThumbnailTexture->Resource,
         true);
 }


Product Version: UE 4.16
Tags:
margin10.png (147.9 kB)
margin20.png (137.9 kB)
more ▼

asked Jul 01 '17 at 03:17 PM in Bug Reports

avatar image

Isatin
85 5 7 126

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question