Files
UnrealEngineUWP/Engine/Plugins/Experimental/PythonScriptPlugin/Source
patrick laflamme bb19374ec4 Fixed MakeTransform() function to take a default value for Scale parameter -> "static FTransform MakeTransform(FVector Location, FRotator Rotation, FVector Scale = FVector(1,1,1))"
- Removed the meta=(MakeStructureDefaultValue= "1,1,1") from the FTransform struct because Unreal Header Tool is already capable to deduce that from the MakeTransform() default C++ prameter.
  - Removed the meta=(Scale = "1,1,1") from MakeTransform UFUNCTION because that can be deduced by Unread Header Toold from the default C++ parameter.

Fixed Python code not invoking the a 'Make' function (declared with meta HasNativeMake on a USTRUCT) if no parameters were supplied to Python (ex. unreal.Transform() would not call the MakeTransform(...)).
  - In most case, not calling the Make function worked as expected, but the Make function could implement side effects, so always honor it.

Resaved BP macro assets using MakeTransform() with the default values. The default values saved as string with the asset changed from "1,1,1" to "1.000000,1.000000,1.000000" and this triggered a BP Compiler warning.

The following tests were performed:
  - In the Blueprint Editor, added a Make Transform node and ensured the default values for scale were (1, 1, 1)
  - In the Blueprint Editor, created a User Defined Struct, added as a member a Transform, ensured the default values for the transform scale were (1, 1, 1)
  - Added a Python regression unit tests to ensure unreal.Transform() takes the default scale value as (1, 1, 1) if the scale parameter is not provided.
  - Created a Blueprint Macro Libraries with a Macro calling MakeTransform() with default parameters, saved it, applied the fix, got the warning, refreshed the node, resaved the macro and ensured the macro used the correct default scale.

#jira UE-133741 - MakeStructureDefaultValue is not used in Python
#rb Jamie.Dale

#ROBOMERGE-OWNER: patrick.laflamme
#ROBOMERGE-AUTHOR: patrick.laflamme
#ROBOMERGE-SOURCE: CL 18337929 via CL 18338143 via CL 18338146 via CL 18338492 via CL 18338517
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18338531 by patrick laflamme in ue5-release-engine-test branch]
2021-12-01 09:27:11 -05:00
..