C++ struct is not showed in the Content Browser

I’ve a class and a struct made with C++, the class appears in the Content Browser, but I don’t know why the struct is not being showed. I can use it as a variable type, but I would like to be able to see it in the Content Browser.

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "StTest.generated.h"

USTRUCT(BlueprintType)
struct TEST_API FStTest
{
	GENERATED_BODY();

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "St")
	FString name;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "St")
	FDateTime date;
};

hello there. C++ created Data types don’t show up as “things” in the content browser. But you can sure use them as variable types inside a blueprint or similar editor as long as they are BlueprintType (like you did)

Only data types created in the editor show in the content browser, but those can’t be used in C++.

Only UObject-based types show up in the Content Browser. Not structs or enums.

As I said, editor created data types appear in the Content Browser.

262636-captura.png

Do you mean that C++ classes are showed but C++ structures aren’t? Because C++ classes show up there and it is a bit weird that C++ structures are excluded.

Do you mean that C++ classes are showed but C++ structures aren’t?

That’s exactly what he means

They aren’t editable or placeable in the editor so is makes sense they’d hide them to avoid confusion.

Ehm… C++ classes aren’t editable in the editor and appear there…

yeah, UObjects created in C++ show in the browser, but in this sort of hidden away list of things. They’re not quite “assets” as much as they’re classes available.

I read somewhere the Editor’s C++ folder is there as to not completely confuse Blueprint people.

Just so you know what UObject classes are available.

But Data Types are created inside those classes, so UE4 has no way of knowing it should display them.

You can’t ever use the Struct or Enum directly, you always use the type for variables inside other assets.

I guess is just something you have to deal with and let go.

This person was asking about C++ though.

That’s a User Defined Struct (UUserDefinedStruct) which is different from a C++ defined USTRUCT (UScriptStruct). The same is also true for a User Defined Enum (UUserDefinedEnum) versus a C++ UENUM (UEnum).

The “User Defined” variants are assets and appear in the content section of the Content Browser, whereas the C++ versions don’t.

C++ defined UCLASS types (which are also different from Blueprints) do appear in the Content Browser under the C++ classes section.

I was the one who added the C++ classes to the Content Browser, but that was back in 2014 and I can no longer remember what the exact reasoning was. I think it was so that our BP and C++ samples appeared somewhat consistent if you were browsing them in the Content Browser.

That’s why I said placeable, if you can drag it into the viewport it shows up too