Hi all,
It seems that directly accessing UText3DComponent::Text access has been revoked in 5.6. This property is no longer a blueprint exposed value. It looks like it’s expected that we now invoke the SetText UFUNCTION directly in 5.6.
This has caused some issues with our blueprints as any blueprint that has modified the Text property is now failing to compile. I see that there’s “Setter” and “Getter” added as property attributes for the UPROPERTY(), but this doesn’t automatically fix up older assets still referencing the property. I’ve just modified the API so it uses BlueprintGetter=GetText and BlueprintSetter=SetText instead which automatically fixes up the old assets, and still has the benefit of invoking the UFUNCTION instead. Is there any reason why this wasn’t done this way?
`class UText3DComponent
{
public:
UFUNCTION(BlueprintGetter)
const FText&GetText() const { return Text; }
UFUNCTION(BlueprintSetter)
TEXT3D_API void SetText(const FText& Value);
protected:
UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintGetter=GetText, BlueprintSetter=SetText, Category = “Text”, meta = (MultiLine = true, AllowPrivateAccess = “true”))
FText Text;
}`Without this change, all our blueprint assets in 5.6 referencing “Text” fail to compile with “Text3DComponent.Text is not blueprint writable. Set Text”.
It looks like this has changed a few times, from what I can tell:
- In 5.0 this used to be a public UPROPERTY() with a BlueprintGetter / BlueprintSetter, like I’m proposing above.
- This was then changed in CL 25942929 (12th June 2023) where the UPROPERTY() were moved to protected but still marked as BlueprintReadWrite with “Getter” and "Setter"attributes, and then public UFUNCTION()s were added but marked as deprecated with a message to call the property directly.
- A large refactor was done in CL 40963239 where the Deprecated message for SetText() was removed, and BlueprintReadWrite attribute was removed from the UPROPERTY(). This is the change which now breaks assets that were fixed after point 2 where the deprecated UFUNCTION was replaced in lieu of direct property access.
What is the correct fix here? I can fix our assets to call the UFUNCTION again, but I suspect we simply want to go back to how it was originally with the BlueprintGetter / BlueprintSetter attribute to automatically invoke the UFUNCTION so client assets do not have to be fixed up manually.
Also, this post is specifically for the “text” property but I believe all the publicly exposed properties in this component have the same issue.
Cheers!
-Steven