When using a created tool of the ScriptableTool plugin, and setting an InstanceEditable variable, the tool might get close.

For this to happen, we need to have a ToolPropertySet attached to the tool, and expose a variable as InstanceEditable. Once it appears in the ScriptableTools Pannel, if we keep setting different objects in the exposed variable, the ScriptableTools plugin will deactivate the current tool, and close the tool window. The variable we set before the window closes will also not be set correctly. If we try to set again the object, it will now successfully update the exposed object, and the tool will not be deactivated.

I've debugged the issue, and it looks like that if you select an asset that has not been compiled yet by the engine, the tool closes. The code that closes the tool are mainly two functions, UScriptableToolsEditorMode::OnBlueprintPreCompile and UScriptableToolsEditorMode::OnBlueprintCompiled.
OnBlueprintPreCompile closes the tool when the selected blueprint gets compiled, and OnBlueprintCompiled does not refresh the tool correctly.


Steps to Reproduce

1- Enable the ScriptableTool plugin
2- Create an EditorScriptableClickDragTool, and also a ScriptableInteractiveToolPropertySet. Add a name to the Scriptable Tool, so it appears later as a tool.
3- Create an object variable inside the ToolPropertySet and expose the variable as InstanceEditable.
4- Inside the ClickAndDrag tool, inside OnScriptSetup, add the created ToolPropertySet by calling AddPropertySetOfType.
5- After AddPropertySetOfType, call RestorePropertySetSettings, and as an input parameter add the output ToolPropertySet property from AddPropertySetOfType. Set a SaveKey value and promote to variable the output ToolPropertySet.
6- OnScriptShutdown, call SavePropertySettings. As Input parameter, the created PropertySet and the same SaveKey as RestorePropertySetSettings.
7- Go back to the Unreal Editor, and open the ScriptableToolsMode window.
8- Select the created tool, and in the object exposed variable add different objects that appear in the selection list. Keep selecting different objects until you see that the tool closes. In my case, selecting ABP_Manny_PostProcess, Blueprint_CeilingLight or Blueprint_Effect_Smoke closses the tool.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-215456 in the post.

Login to Vote

ComponentUE - LD & Modeling - Modeling Tools
Affects Versions5.
Target Fix5.5
CreatedMay 21, 2024
UpdatedMay 27, 2024
View Jira Issue