Check if Blueprint is being run within the editor (i.e if WITH_EDITOR in C++)

Not fond of the “hack” way you are using with UEDPIE. It’s not for packing, it is for detecting whether it is running in animation/particle editor or other editor window other than PIE.