I’m having a lot of trouble understanding the distinction between the UPROPERTY Edit* types vs the Visible* types (eg. EditAnywhere vs VisibleAnywhere, and how they behave in the Blueprint Details panel.
Given an example component property declared like this:
UPROPERTY(VisibleAnywhere, Category = “TestProperty”) UShapeComponent* Shape;
…the details panel of this component (selected in a Blueprint based on the C++ class) looks like this:
But then when I change the property to EditAnywhere instead of VisibleAnywhere, it looks like this:
I have a few questions about this:
- Why does the ‘Test Property’ category only show up for EditAnywhere?
- Why are all the different categories contained under ‘Shape’ for EditAnywhere, but all separate (and different, eg. ComponentTick, Events) for VisibleAnywhere?
- Why do some categories, like the Physics one expanded here, have many more options for VisibleAnywhere than in EditAnywhere?
From the (sparse) documentation for UPROPERTY, I was under the impression that Visible* would just show the same data as Edit*, but without allowing it to be editable. For components this doesn’t seem to be true (everything in the component is still editable), but it also changes how the Component’s properties are presented in a confusing and non-intuitive way.
Can anyone shed light on what’s going on here?
Thank you for pointing this out, this seems like a bug to me. As such, I’ve placed a bug report into our database under the number UE-23850.
Have a nice day!
Just to make sure I understand things properly, can you give me an idea of how it should work? Should they both look the exact same, but one editable and the other not?
The available properties should be the same for both but both of these should allow these particular settings to be editable. The reason why is because components follow the rules set in the component class that it is based off of, not the VisibleAnywhere or EditAnywhere specifiers.
Are there any updates on this bug? I am using 4.11.2 and I just stumbled upon exact same issue where my property display differs between EditAnywhere and VisibleAnywhere. It is really hard to work with EditAnywhere since a user can set component to None or even change the whole component (for example, it is possible to change USceneComponent to UArrowComponent via blueprint interface with EditAnywhere property).
The bug is currently marked as “To Do” so people are taking a look at the problem. In the meantime, a workaround you could use is to use the VisibleAnywhere specifier but also add the following line to the UPROPERTY declaration:
meta = (AllowPrivateAccess = "true")
This should give you all of the properties available w/ VisibleAnywhere but also the ability to edit them.
From what you’re mentioning though, just using VisibleAnywhere alone would be best for you since it seems like you don’t want the properties to be editable.