What's the use of the "export" keyword ?

Hello,

I was having a look at some engine code and came accross that export keyword used as a parameter for UPROPERTY. As an example you can check the BoxExtent field from the UBoxComponent class (line 17).

UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category=Shape)
FVector BoxExtent;

Of course I checked the wiki and found out it’s meant for this:

Export[edit]
Object property can be exported with it’s owner.

(see wiki page here)

Could anyone please just clarify what this concretely means ?

Thanks in advance :slight_smile:

Quastions is if they mean ownervarable in all actors or class that property is in

I’m sorry but I don’t understand what you mean.

This is used with UExporter classes (for example, for exporting objects as text). Object properties marked as ‘export’ will be fully exported (full object definition, including its properties) with the owning object instead of being exported as just the object name and path as the property value.

Ok thanks for the clarification.

I feel like this is only half of the answer. Is there a purpose to this function or it just exists to exist?

If you right-click and copy an EditInlineNew object property(Adding the “Instanced” keyword will automatically have the functionality of the “Export” keyword, so there is no need to add the Export keyword separately) in the property panel, and the property does not have the Export keyword, the reference to the object will be copied when copying the object property, which means that multiple properties point to the same EditInlineNew instantiated object. When pasting, it will be an object reference, not a new instance. If the property uses the Export keyword, when copying the object property, the reference will also be copied (similar to the previous case, in the form of a text object path), but when pasting, it will be a complete new object instance (re-instantiated), not a reference.