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++.
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.
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.
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.