[Solved]Blank detail panel for UStaticMeshComopnent in child blueprint class of a C++ class

This issue has be solved by re-create related blueprints.
[HR][/HR]

Hey guys, I’ve met a issue that I can’t solve it out. That thing is, I created a custom class inherited from ACharacter, and inserted the following code in order to add a simple static mesh component to it:
.h


 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Mesh, meta = (AllowPrivateAccess = "true"))
    class UStaticMeshComponent* SMWeapon;

.cpp


SMWeapon = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("SMWeapon"));

Then i created two blueprint class which derived from the custom c++ character class, and yes i do find the derved static mesh component but there’s nothing in detail panel



the same component added with blueprint type doesn’t have this issue

I’ve tried:

  1. changing VisibleAnyWhere to EditAnyWhere
    2.changing BlueprintReadOnly to BlueprintReadWrite
    3.adding a bunch of other property for it
    4.tring to attach it to the skeleton mesh component which is inherited from ACharacter
    5.Deleting all folders like .vs \ Binary\ Saved\Interrmediate and .sln file ,then regenerate them

but none of them works…

Any solution would be appreciated!

Hello,
I did a quick test just now to double check, the ‘EditAnywhere’ and ‘EditDefaultsOnly’ specifiers should definitely give you access to the Details panel in Blueprints.

Have you tried changing the properties and rebuilding the project with the Editor being closed?

[COLOR=#fff]↵[/COLOR]

Thx for reply.

Yes, i’ve double checked ‘EditAnywhere’ but it ain’t work… I’m going to create a new project in order to check it agian.

Actually, the issue is, the detail panal still doesn’t show an. of the inherited UStaticMeshComponent’s property.

Just like the following pics show:
1.The USkeletonMeshComponent declared in ACharacter class can be shown correctly:


private:
    /** The main skeletal mesh associated with this Character (optional sub-object). */
    UPROPERTY(Category=Character, VisibleAnywhere, BlueprintReadOnly, meta=(AllowPrivateAccess = "true"))
    USkeletalMeshComponent* Mesh;

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“medium”,“data-tempid”:“temp_188478_1586750369082_664”}[/ATTACH]
https://forums.unrealengine.com/core/image/gif;base64

2.The properties of a inherited blueprint static mesh component can be shown correctly:
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“medium”,“data-tempid”:“temp_188479_1586750464321_533”}[/ATTACH]
https://forums.unrealengine.com/core/image/gif;base64

3.Yet my C++ UStaticMeshComponents shows nothing:(Tried change VisibleAnyWhere to EditDefaultsOnly or something else)


    UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = Mesh, meta = (AllowPrivateAccess = "true"))
    class UStaticMeshComponent* SMWeapon;


a4729d9f2cd1fb535f613ec57da98333da40f282.jpeg

It seems to be a bug.

Those properties sometimes shown and sometimes not.

I tried to:
1.Change category
2.Modify display name
3.Remove comments
4.Add misc static mesh components

None of them seems to be relative to this issue. Even theres a time one of the static mesh component’s properties were shown but the others weren’t.

I’ve gave up as for now. Anybody who have solved this pls post your solution, many thanks.

You need to re-create the Blueprint.

Anytime you remove/change components or UPROPERTY meta of a default object, you will have to regenerate the Blueprint. Sometimes reparenting helps, but either way you are likely to lose data. You can add new components without issues usually, but removing or changing existing once will break the BP.

The reason is that the UPROPERTY meta has already been serialized into the Blueprint.

Never use EditDefaultsOnly or BlueprintReadWrite on a component - only use VisibleDefaultsOnly and BlueprintReadOnly.

11 Likes

Thanks, it works fine now!

1 Like

Hello and sorry for re-opening the thread. I did the same thing, but the Location and Rotation of the Child Component is not showing. It is only Showing the Scale for one reason… Any ideas why? In the UPROPERTY i use what you have typed.

Have you assigned a root component for your actor? I think that should work if you create a scene component as root component, then make this child actor component attach to that root.

You can use SetupAttachment method in constructor, or AttachToComponent method after begin play.

Instead of recreating the blueprint, renaming the component (and the display name), compile in code and opening can fix it. If you reference that comp in the blueprint itself you will probably need to relink those.

4 Likes

To add on some details to the fix:
Do not add core redirect (esp if you are using Riders), seems like you must break the existing data so that it can regenerate.

Honestly, this is a big problem, it greatly discourages the proposed BP & C++ workflow.

1 Like

Yeap, that’s a big issue
One of the solutions with keeping your data is to use git
Steps:

  1. Compile
  2. Reparent to (actor
  3. Revert the change with git
  4. Should be working now

Hello, For me its just the following steps to solve

-Update Code and Compile CPP

-Reparent to Actor
-Reparent to CPP Base Class

Be happy :smiley:

5 Likes
  1. Comment the declaration of all components in the header file

  2. Comment the initialization of all components inside the constructor in the cpp file

  3. Compile

  4. Uncomment all

  5. Compile

3 Likes

Thanks for the info anyhow, this solved it for me.

This worked for me too, thank you so much! :smile:

Coming back to this post, there now a plugin for this :

2 Likes

The plugin give an error "The following modules are missing or built with a different engine version:

BPCorruptionFix

Engine modules cannot be compiled at runtime. Please build through your IDE." I use UE5.3