Ok so my plan to make a toolbar with submenus (trying to mimic the standard editor toolbar) may have backfired. Just realized that if I spawn a context menu from a button, although I can render it out of the utility widget OK, I can’t interact with it. Example below, I can’t use the checkbox because it is not within the utility widget bounds:
Is there a way around this? If no, then consider it a feature request for this thread
I downloaded your project zip from Github, and I add the starter content into that project. But when I open the project, it says Failed to load map!
…/…/…/…/…/…/Users/PC/Desktop/EdUtilExamples-master/Content/Maps/Welcome.umap appears to be an asset file.
nothing I can find in the content folder but 2 folders with none files. Then I create a project with the starter content, migrate the content from your project to my new project. Nothing works still.
WARNING, I’ve seen a lot of messages on features to add that exist using the beta plugin “Editor Scripting Utilities”.
It has been since the preview version of unreal engine 4.22 that I have been doing functionality tests of the widget editor, here is a list;
Get camera location and rotation through a placed editor actor utilities
Get content browser asset selected
Get all asset in content
Get selected actor in world
Create custom file
Edit asset and save
MetaData read write
Get file Type
This list is not at all complete, many nodes are available.
Here is a list of features to add;
Get Editor World Camera info ( location, rotation, fov)
Get Editor Viewport ( Location in desktop, size)
Get Mouse position in Editor viewport
Editor Key and mouse in Editor for WidgetEditor
Get WidgetEditor Instance Reference Instance (currently the widget instance is stored in /temp/, but impossible to use it to know if it is valid
Set window base size of widget editor at opening
Open new EditorWidget
Create Child of EditorWidget with open option
Create function library for Editor Utilities class
Create Error message window message
Block the window closing in some cases (with forcing option in case of)
3D world viewport in widget ( if not exist)
Create copy of asset
Create new asset type, or add factory access
StaticMesh : set collision complexity
Delete Asset file
Create , edit Text asset
Get WidgetEditor Object Content Browser Path
I don’t know if it’s a bug, but the Widget editor instance can stay in some cases, for example I use a “placed editor utilities” with a “widget editor”, the placed actor is linked with the widget with an event (send an event to each tick, if the placed editor doesn’t receive more tick during 10 frame, then it self-destructs) but it doesn’t work all the time, in some cases the tick is still received while the widget is no longer displayed, but I have a solution with the “OnDestroy” event.
Thank you.
**PrefabAsset : **
Some time ago I created a tool that allows to save object groups with a TextAsset ( video below), but it doesn’t work all the time because I use the Paste function ( Ctrl+v) which allows to use a TEXT resource to spawn objects in the world.
Strangely enough it is possible to make this technique work every time by selecting a component ( in world) instead of an actor ( in world) before making the copy ( then you need to spam the copy).
I think it would be simple to create an asset that would allow to save an actor group with this configuration in an asset, and to be able to put it back in the world with a drag and drop.
I think that many people would be interested by this option, moreover all the functions already exist in the editor code, because for the moment it is impossible to use the actor bllueprint merge for complex classes.
Both of these are great ideas! Over time I think you’ll see more of these show up, especially as we start using subsystems more throughout the engine. A lot of that editor code will take some refactoring before it can be exposed to scripting, so it’ll be a slow but hopefully steady process!
Glad to hear it’s working out well for you so far!
Going to also +1 the editor events being something we will focus on, as we add additional editor subsystems. Right now, you can already hook into importing events, using the Import Subsystem!
We also will have more editor-like widgets, like single property displays and details panels. Drag and drop is still an area we’re working on, but you can create drag and drop events with Blueprints inside Editor Utility Widgets even in 4.22.
I highly recommend you add a “Create Editor Utility Widget Blueprint” or “Open Editor Utility Widget Blueprint” function similar to the “Create Widget Blueprint” which will open the selected Editor Utility Widget in the editor whenever called. I think this is a very important feature.
Besides this missing feature, I absolutely love this new tool! I am working on a HUGE project right now that I plan to release to the Marketplace once complete. Since I have practically no c++ knowledge and purely rely on online tutorials for any c++ work that I do, this tool has been a huge help.
This being said, can anyone tell me how to execute the command “Run Editor Utility Widget” (as seen in the menu when right-clicking on any Editor Utility Widget) in c++. I want to create a function that can run this as part of a plugin unless it will be released as part of the next 4.22 release.
I was thinking about access to level editor viewport, right now you only can access it via placed blutility actor, but it’s not always convenient this way. So, I was thinking, maybe it’s worth exposing the level editor viewport to normal blutilities and umg blutilities too? Like, for example, have a “GetViewports” or “GetActiveViewport” node which returns a “Viewport” object, then you can get/set the camera location, fov, size of the window, viewmodes, showflags and other properties? Just an idea.
Other thing I was thinking would be great, but I’m not sure if that’s the same “department”, is to extend the “keep simulation changes” command. Right now it only works on properties of existing objects but you cannot add actors created in PIE back to the level. For example, I’ve made an editor plugin to “snap” actors. The plugin relies on GEditor events, which have some limitations. Then I thought to bring the same idea in game, so people can make building games for example (see here). And I realized you have much more freedom in game. One you made you basic editing primitives (add, delete, move) you can do virtually anything, you can use UMG, create your own “editor events” like you want, have your own manipulators etc. So, in some cases is much more convenient to work this way. But, you cannot save your level you created in PIE, once the “play” ends all new actors are lost. So, i think extending “keep simulation changes” to actors added in PIE would be great! It’s kinda another way around, not bringing in-game stuff (like umg) in editor but bringing editor in game
Alright so here is my kinda unadulterated list of general editor utility feature requests that I’ve been compiling for a long time, since blutilities became a thing. I’m pretty sure they’re all still relevant (apologies if any are already fixed/added). They’re not necessarily specific to the editor widget, but things that I think would be great for making tools that are exposed to an editor user via the widget.
Since it’s kinda a decent list, I’ve tried to order by “how many times I’ve wanted this”, and I separated out a few of the “I’m dreaming” type requests further below
General editor utility requests:
Ability to bind call-in-editor functions to a key
Selection state highlighting has been broken for a while (if you change the selection state, there are actors highlighted which aren’t actually selected, and selected actors that aren’t highlighted - you have to ctrl+click & unclick something to get it to update). I have quite a few tools that manipulate selection.
Get/Set viewport FOV - Please expose the ciewport camera loc/rot to editor utility widget, like it is to placed blutility! Also just requesting FOV access on that too - I often have cameras placed around with different FOVs. Then we could make our own camera bookmarks with FOV included.
“Get Launch Mode” - Ability to detect whether we are in PIE, editor, or standalone cooked/uncooked (preferably an enum - Editor,PIE,StandaloneUncooked,StandaloneCooked). Among other things, most importantly for me this allows the construction script to only run in the editor, without having a bool variable that you have to toggle on every instance to control construction script execution. I’ve seen some interesting hacks to try and work it out (like placing a zero-scaled mesh in the level and checking it), but none of them seem reliable.
Get editor viewport mouse position (passing through screen position & projected world position) e.g. showing a transparent mesh or effect that moves with your mouse (like the “preview mesh”), or showing another art helper tool
Project/Deproject that works in the editor (doesn’t require a playercontroller) - something I have personally been wanting on many occasions.
Execute Console Command doesn’t seem to work in Blutility - if it did, then we could leverage existing console command tools (for example you can solo audio sources, which is very useful, but you have to do it by typing names into a console command)
EditorUtilityComponent - just an ActorComponent that allows us to place the blueprint nodes that can only be placed in blutility classes. Means we can make reusable editor tool functionality in a component.
Please expose / allow writing these properties in blutility:
StaticMesh (asset) . Lightmap Res (in general, allowing writeability to more StaticMesh properties would be useful)
StaticMeshComponent . Override Lightmap Res
StaticMeshComponent . Overridden Lightmap Res
StaticMeshComponent . OverrideMaterials (if elements/sections are removed on a staticmesh, placed instances with material overrides give errors until you manually fix them in notepad - exposing this allows us to fix them in blutility)
LightComponent . Use Inverse Squared Falloff
LightComponent . SpecularScale
Scene Component . Detail Mode (very useful for custom optimization tools)
Editor events:
On actor selected
On viewport click (pass through screen position & projected world position trace hit)
On Editor World Loaded - event when the user loads a new level in the editor, so you can refresh your utility widget, discard stuff related to the previous map and/or load metadata from the newly-loaded map.
On actor changed (any property change, pass through property as name & new value as convertable string)
On map build
On map cook
Some kind of safe way we can show editor popup messages, so we don’t have to implement our own message stack functionality in the widget (even if it’s just a generic bottom-right corner popup to say “there was an error, check your log”).
Get Actor Level - Would be very useful to get the level (streaming level) that the given actor belongs to (for example, we can spawn a replacement actor in the same level). Loads of uses for this.
Allow the actor selection nodes to be placed in non-blutility blueprints (e.g. if we have level helper tools in PIE/SIE, we can automatically select newly created actors for the user when they go back to the editor). If executed in standalone then do nothing.
Clipboard functions (have been missing clipboard functions a lot since Unrealscript, would be super useful, even if it’s development builds only):
Copy to Clipboard - Given string is copied to clipboard
Actor to String - for use with above, converts a given actor to string/T3D (same thing you’d see if you paste an actor into notepad)
Clipboard Actor to String - if the clipboard contains a pasteable unreal object, output it as a string. We can e.g. use this to manually parse actor properties that we are unable to see normally.
Set Asset Selection State - just like Set Actor Selection State, except for assets. We can already get the selected assets, but being able to set the selection would be useful for tools that find or create new assets.
Construction script “WasEndOfDrag” property - Sometimes you have an actor that does several things in the construction script - the heavy stuff you only want to do at the end of a drag but you still want to see other things update in real time. If the Construction Script event passed through a “WasEndOfDrag” bool, that would be a more flexible solution than having to decide per-class whether it runs per-frame or not.
Add warning/error to map build (to be used with the “On map build” event requested above) e.g. in a large BP project you have a lot of custom actors placed that could really do with LD-sanity-checking
Actor/Asset Action feature request - I’ve found that I nearly always want some options to go with the scripted action, but I don’t want a dialog box to pop up every time (e.g. 75% of the time I use the same settings). I wonder if, underneath “Call in editor” there could be an additional checkbox “Call in editor advanced options”, so a dialog box with the input variables only appears if the user holds CTRL while clicking. Or something similar.
Ability to bind editor console commands to a key - some console commands would be useful to bind to a key e.g. for audio editing you might want to quickly solo/unsolo the current ambient sound (which there are console commands for, but you have to type it in manually / console command from blutility doesn’t work).
A “Keep Simulation Changes” blueprint node (and/or console command) - so we can have level helper tools that create new objects, and the user doesn’t have to find them one by one in the Outliner and Keep Simulation Changes manually.
"I’m-probably-dreaming" features:
Select By Property - super useful feature from UDK where you could shift+click on a property in the details window, and afterward it’d give you the right-click > Select > Select all [ActorType]Actors with [SelectedProperty]==[SelectedValue]. There was also a Property Selection view mode which showed everything white, except all [ActorType]Actors with [SelectedProperty]==[SelectedValue] would be red. It looks like the viewmode is still there but unused. One of the most nifty features UDK ever had. The first part of it (not the viewmode) can be hacked in blutility, but you have to specifically code in each property type (which I’ve been doing, but it’s quite painful and very bulky).
Ability to add a component to an actor in Blutility. I can’t remember why I wrote this, but I think components that you add in editor get destroyed, or don’t keep their properties or something, so I’ve just discarded this possibility ever since. It’d be great if our tools could add permanent, editable components (but I haven’t really thought about this much).
Set Variable By Name - a generic node with “VariableName” & “Value” inputs of type String - returns false if it can’t find a variable of the given name in the target object, or it can’t cast the value to the detected type of variable. This has dangerous-for-the-average-user written all over it and I’m not really expecting this but let’s chuck it here for laughs anyway.
“Light Trace” Blueprint node - like a line trace node, except it traces against shadowcasting geometry instead of visibility/collision. Returns true if the trace is blocked by a shadowcaster. e.g. allows us to check in Blutility which lights are relevant to an object. Alternatively, a function in LightComponent that returns if the lightcomponent is relevant to the given location, and the intensity there.
“Get Light Intensity at Location” - gets the intensity of the given light at the given location, without having to reverse the falloff math ourselves.
And just a big THANK YOU to anyone involved in bringing Blutilities and this editor widget into existence. It’s amazing that a not-really-programmer like myself can implement their own tools like this (I try to remind myself when making requests that blueprint in general is a massive engineering feat that is literally life-changing for me, so thanks to Epic for this).
Is there currently a way for a Utility Widget to detect whether the world type is in Editor, PIE, or Game Instance? Or to disable a utility widget while in PIE or Game Instance mode?
Currently, I have a tick event used to detect whether the scene or selection set has become dirty since last frame.
Without events for these things, the tick hits utility functions like GetAllLevelActors and spams a LogEditorScripting error.
I have tried 's blueprint functions that return what world mode the logic is running in. This returns true for editor always, and false for PIE always from within the Utility Widget.
Getting the GameInstance (via GetGameInstance) always returns none.
In fact, trying to get any actor by class returns none.
I just need a way to escape the Utility Widget’s tick while in either PIE or Game Instance or otherwise disable the Utility Widget during these modes.
just ran into another event that would be useful and is editor-utility-widget-specific:
Event On Editor World Loaded - event when the user loads a new level in the editor, so you can refresh your utility widget, discard stuff related to the previous map and/or load metadata from the newly-loaded map.
I currently hack it by checking in tick (every x sec) if the loaded world has changed.
“Get All Subclasses of Class” node, so we can populate editor utility widget dropdowns with classes for the user to pick from, and
The “Soft Class Path” equivalents of Soft Object Path’s “To Soft Object Reference” and “Break Soft Object Path” nodes, so we can convert a string (from e.g. a combobox selection) to a class reference (for spawning things etc).
Long version: I have a “Create Bounding Volume around Selected” function, which creates a simple volume around selected actors’ bounds. I had this in right-click Actor Actions but wanted to move this to Editor Utility Widget (trying to do this with a few things, since utility widget allows you to change the function options without bringing up a dialog every time, allows you to specify a default for e.g. class types & can be one-click).
In my editor utility widget I’d like to allow them to pick the class of Volume they want to create. But currently, I can’t find a way to either:
a) Populate a combobox with all classes of volume, nor
b) Convert a selected combobox string to a class, so that I can spawn the volume
In this case, I guess I will manually populate an array with current volume classes and fill the combobox that way, and map those to strings so I can convert back from the combobox. It’s just obviously not ideal since I’d have to keep that updated with volume classes (and other users of this tool may have their own classes that won’t be in there), and I can’t realistically do this if it’s something with a lot of classes (like if I want to give them an Actor class dropdown).
So, feature request for a) and b) above if possible
After watching the livestream I started experimenting with Utility Widgets and I am starting to face a few challenges.
-How can I detect the right mouse button is down? So far only found an event to detect when the mouse clicks the widget, but I need to know if the mouse is pressed anywhere in the viewport.
-I want to convert the mouse position from screen to world, but I can’t without a player controller, get player controller returns null since it’s in-editor, and get widget owning player also returns null, any workaround?
-Set simulate physics does change the checkbox of simulate physics, but the object does not simulate physics when I hit play, I have to check and uncheck the object manually again for it to work.
Having access to the mouse world location and click, I can start creating a brush and paint items in the scene.
Hope you find this feedback useful, and thanks in advance for the help.
If you have Realtime turned off in the active viewport, Editor Utility Widget Tick only fires when you move your mouse. Also timers (SetTimer by event/function) don’t seem to fire at all (but works fine with realtime turned on in the viewport).
Also, I’m getting this error spam when running PIE:
LogEditorScripting: Error: The Editor is currently in a play mode.
It’s happening because I use some editor scripting nodes in the widget on Tick (I have a heartbeat event that checks every second if the world has changed, or if the selection has changed). I can’t find a way to check if we’re in play mode though, to avoid running those things.
I think I have a reliable repro for this now. If I change some values in my editor utility widget after starting the editor, then open my widget blueprint and compile, it will always give this error (like it’s having trouble destroying something while it’s open). My widget sets its own values on startup, so essentially the error will always happen on first compile.
-Tabs are a global setting so if you create and add a Editor Widget Tab in Project A and then open Project B it will try to open the Editor Widget tab from Project A but fail and the tab will be an empty “unrecognized tag”… So I end up closing those but when I go back to Project A I need to reopen and setup the view like I want it again.
Changing an Actors location etc thru Editor Widget dont mark the actor/map as dirty so no hint that the map has changed when you close or change map
I have released an editor only plugin to fix/add some of the missing features, like you can bind a bunch of Level Editor and Asset events, get the mouse position in the level editor etc.
Its something until Epic add proper support for this kinda stuff
i want to request the following list
1.about material. i want to change material shading model use editor widget
2.get the specified texture in the material use editor widget