Download

[Request] EditFixedSize Specifier Should Allow Resetting to C++ Class Defaults

This didn’t get any traction over in the C++ forum and it seems like this is the proper place to request specific engine features.

[hr][/hr]

As a bit of a preamble, I am primarily working on the Unreal Tournament project, so I do not have full control over source code even though I am developing in C++.

Some of the properties of a given class are using the EditFixedSize specifier. For example, the UTWeapon class has a property called FiringState like so:


	/** firing state for mode, contains core firing sequence and directs to appropriate global firing functions */
	UPROPERTY(Instanced, EditAnywhere, EditFixedSize, BlueprintReadWrite, Category = "Weapon")
	TArray<class UUTWeaponStateFiring*> FiringState;

In this situation, I have created a C++ subclass of UTWeapon. I created the basic structure of my C++ subclass, then created my blueprint (which I am treating essentially as an archetype).

Problem: After initially creating my C++ subclass, I realized that I wanted to add additional entries into the FiringState array that my class is inheriting from UTWeapon. UTWeapon defines a FiringState array of size 2, whereas I wanted to add a third entry into this array. This cannot be done in the Blueprint due to the EditFixedSize specifier, however even if I edit my CPP constructor the additional entries into the FiringState array will not appear in my existing Blueprint, since my Blueprint has already been created and thus the FiringState array size has been set already within the BP.

There is one obvious solution, but to me it is a bad one: Recreate my blueprint from scratch after editing my CPP. In this particular instance that is not too problematic, but I can very easily see this becoming hugely problematic if someone builds a larger set of blueprints then later decides they want to add some new functionality within C++ and are faced with the prospect of recreating all of their blueprints.

**Suggested Solution: ** Reset to defaults should always be available as an option from within the editor.

Restricting access to reset to defaults makes sense for a blueprint that is directly based on a C++ class, but does not make sense for blueprints based on children of that C++ class. This actually has big and frustrating implications for for how you must design and iterate on content, and the problematic consequences are literally unforeseeable until they arise.

Looking at PropertyEditor.cpp, I see that FPropertyEditor::IsResetToDefaultAvailable() determines whether Reset to defaults appears as an option. Editing this would be fairly simple and straightforward.

Can anyone suggest any strong reasoning why this property should work in a way other than what I’ve suggested?