Announcement

Collapse
No announcement yet.

Editor Utility Widgets Feedback

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

    #76
    Hi! Thanks for the amazing system! I come here with a problem though I can't spawn a tab from C++.

    I put a plugin on the Marketplace and a customer let me know that it's hard to find it in the Content Browser. It turns out that it's a part of Engine Content when installed from Marketplace. So what I'm trying to do is to add a menu button to the level editor (Window -> My tool) that will spawn the Utility Widget.

    The linker complains:
    error LNK2019: unresolved external symbol "private: static class UClass * __cdecl UEditorUtilityWidgetBlueprint::GetPrivateStaticClass(void)"
    error LNK2019: unresolved external symbol "public: class TSharedRef<class SDockTab,0> __cdecl UEditorUtilityWidgetBlueprint::SpawnEditorUITab(class FSpawnTabArgs const &)"
    Is it on purpose that EditorUtilityWidgetBlueprint.h is not a part of BLUTILITY_API? If yes, then at least an exposed function for that purpose would be very useful.

    I based my function on AssetTypeActions_EditorUtilityWidgetBlueprint.cpp. I also followed the invaluable tutorial by IsaraTech, but they just skipped the spawning part (probably due to the same problem)

    Below is the part of my code that causes trouble:

    Code:
    if (!LevelEditorTabManager->CanSpawnTab(RegistrationName))
    {
        IBlutilityModule* BlutilityModule = FModuleManager::GetModulePtr<IBlutilityModule>("Blutility");
        UEditorUtilityWidgetBlueprint* WidgetBlueprint = Cast<UEditorUtilityWidgetBlueprint>(Blueprint);
        WidgetBlueprint->SetRegistrationName(RegistrationName);
        LevelEditorTabManager->RegisterTabSpawner(
            RegistrationName,
            FOnSpawnTab::CreateUObject(WidgetBlueprint, &UEditorUtilityWidgetBlueprint::SpawnEditorUITab)
        ).SetDisplayName(DisplayName).SetGroup(BlutilityModule->GetMenuGroup().ToSharedRef());
    
        BlutilityModule->AddLoadedScriptUI(WidgetBlueprint);
    }
    Last edited by Oskar Świerad; 07-24-2019, 05:04 PM.
    Tech Art Aid tutorials - shaders, procedural techniques, optimization

    Comment


      #77
      Originally posted by Oskar Świerad View Post
      Hi! Thanks for the amazing system! I come here with a problem though I can't spawn a tab from C++.

      I put a plugin on the Marketplace and a customer let me know that it's hard to find it in the Content Browser. It turns out that it's a part of Engine Content when installed from Marketplace. So what I'm trying to do is to add a menu button to the level editor (Window -> My tool) that will spawn the Utility Widget.

      The linker complains:


      Is it on purpose that EditorUtilityWidgetBlueprint.h is not a part of BLUTILITY_API? If yes, then at least an exposed function for that purpose would be very useful.

      I based my function on AssetTypeActions_EditorUtilityWidgetBlueprint.cpp. I also followed the invaluable tutorial by IsaraTech, but they just skipped the spawning part (probably due to the same problem)

      Below is the part of my code that causes trouble:

      Code:
      if (!LevelEditorTabManager->CanSpawnTab(RegistrationName))
      {
      IBlutilityModule* BlutilityModule = FModuleManager::GetModulePtr<IBlutilityModule>("Blutility");
      UEditorUtilityWidgetBlueprint* WidgetBlueprint = Cast<UEditorUtilityWidgetBlueprint>(Blueprint);
      WidgetBlueprint->SetRegistrationName(RegistrationName);
      LevelEditorTabManager->RegisterTabSpawner(
      RegistrationName,
      FOnSpawnTab::CreateUObject(WidgetBlueprint, &UEditorUtilityWidgetBlueprint::SpawnEditorUITab)
      ).SetDisplayName(DisplayName).SetGroup(BlutilityModule->GetMenuGroup().ToSharedRef());
      
      BlutilityModule->AddLoadedScriptUI(WidgetBlueprint);
      }
      In 4.23 Preview, the Editor Utility Subsystem has a function SpawnAndRegisterTab that should be able to help with that, and it just takes the Editor Utility Widget Blueprint as an input.

      Comment


        #78
        Amazing! Thanks
        Tech Art Aid tutorials - shaders, procedural techniques, optimization

        Comment


          #79
          I was wondering if it's possible in any way with the current Editor Utility mechanics to compile the lights for a level (and get notified when it's done), would be really great for automatizing the process of rebuilding multiple levels when some global setting, actor, material or sublevel changes.
          LinkedIn, Engine Contributions
          Polars (WIP), Game Jam Projects
          Marketplace: Viewport Utilities, Blueprint Streams, Control Structures

          Comment


            #80
            Originally posted by Shadow.Storm View Post

            In 4.23 Preview, the Editor Utility Subsystem has a function SpawnAndRegisterTab that should be able to help with that, and it just takes the Editor Utility Widget Blueprint as an input.
            That's great!!
            I have a question though, im working on a project that is still in 4.22, is there anyway getting a reference of the Editor Utility Widget within a regular widgetblueprint? right now, I get warning that it can not access the variable called EditorWidget (a variable ref to my editor utility widget)

            Comment


              #81
              Originally posted by Rosium View Post

              That's great!!
              I have a question though, im working on a project that is still in 4.22, is there anyway getting a reference of the Editor Utility Widget within a regular widgetblueprint? right now, I get warning that it can not access the variable called EditorWidget (a variable ref to my editor utility widget)
              Hi! So, as early as 4.22, we began enforcing a stronger line between editor code and runtime code. It's safe to reference runtime code in editor code, since you have to have it for things like Play In Editor testing. It's not safe to reference editor code in runtime code, as you may be trying to access data that doesn't exist and could crash, etc. You can reference a regular widget blueprint in an editor widget blueprint, but the case you are trying won't be supported.

              Comment


                #82
                Hey all so first of all editor widgets are my best friend atm, i do everything with them. There is one thing i would like added that i find is needed, The ability to create child bps through the widget, I know it can be done by making a factory but as it is already available through right clicking a similar func would be useful

                Comment


                  #83
                  Out of the curiosity, Is there a reason why you can not call functions that there were created within the editor utility widget within a regular widget blueprint?

                  Comment


                    #84
                    Originally posted by Rosium View Post
                    Out of the curiosity, Is there a reason why you can not call functions that there were created within the editor utility widget within a regular widget blueprint?
                    Editor Utility Widgets Cannot be used on Run Time which is the only way you'd be able to access a normal widget

                    Comment


                      #85
                      Originally posted by SinkingShipEnt View Post

                      Editor Utility Widgets Cannot be used on Run Time which is the only way you'd be able to access a normal widget
                      Sorry for the late reply, i lost this thread in my notes, I understand, i figured it would be a runtime issue. but i may have to disagree with you a little bit, i was able to call functions created within the editor widget into a regular widget through event dispatchers. you just need a way to save information.

                      if i may ask, would you know a way of the resetting a widget after you click "Run"?

                      Comment


                        #86
                        I am wondering if anyone knows how to get references to actors that were spawned in runtime. I can GetAllActorsOfClass for actors that were placed in edit mode, but I cannot get actors that were spawned. Does anyone know how to do this?

                        I cannot use get actors in level as they can no longer be used in PIE.

                        Thanks.

                        EDIT: Oh it seems this might be getting fixed in 4.23 with the world context input being exposed on nodes. Getting the game world, and piping that into GetAllActorsOfClass allows you to get actors spawned in runtime.

                        I guess there isn't a way of getting actors from the game world before this change? Perhaps in code?
                        Last edited by Clampy; 08-19-2019, 03:01 PM.

                        Comment


                          #87
                          Can we have some UMG styling system and an Editor Style so these widgets can actually look like real editor tools instead of being totally out of place?

                          Comment

                          Working...
                          X