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"

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;
 };
Product Version: UE 4.21
Tags:
more ▼

asked Dec 17 '18 at 04:53 PM in C++ Programming

avatar image

Cucharón
25 2 6 11

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

2 answers: sort voted first

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

more ▼

answered Dec 17 '18 at 07:08 PM

avatar image

Jamie Dale STAFF
7.4k 176 66 304

avatar image Evigmae Dec 17 '18 at 07:23 PM

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

alt text

captura.png (23.7 kB)
avatar image Jamie Dale STAFF Dec 18 '18 at 03:16 PM

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.

avatar image Cucharón Dec 18 '18 at 08:59 AM

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

avatar image HarryHighDef Dec 18 '18 at 09:41 AM

That's exactly what he means

avatar image HarryHighDef Dec 18 '18 at 09:42 AM

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

avatar image Cucharón Dec 18 '18 at 11:36 AM

Ehm... C++ classes aren't editable in the editor and appear there...

avatar image Evigmae Dec 18 '18 at 03:03 PM

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.

avatar image HarryHighDef Dec 19 '18 at 10:29 AM

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

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

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

more ▼

answered Dec 17 '18 at 05:28 PM

avatar image

Evigmae
1.6k 7 3 8

avatar image Cucharón Dec 18 '18 at 08:53 AM

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.

avatar image Evigmae Dec 18 '18 at 02:59 PM

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.

(comments are locked)
10|2000 characters needed characters left
Your answer
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