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.
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.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-215456 in the post.
2 |
Component | UE - LD & Modeling - Modeling Tools |
---|---|
Affects Versions | 5.2.1, 5.3.2, 5.4.1 |
Target Fix | 5.6 |
Created | May 21, 2024 |
---|---|
Updated | Sep 28, 2024 |