Announcement

Collapse
No announcement yet.

How to show UProperties in a DockTab for a plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to show UProperties in a DockTab for a plugin

    Hey,

    I am building a C++ plugin and have a UClass with the properties I want,
    1. how can I use the Slate Widgets to have these show up and be editable in the editor when I press my plugin button (It's a standalone type that opens a DockTab),

    2. is a customization required ? Unfortunately I have not found a working tutorial on this yet.
    I have an IDetailCustomization inherited class and I understand that it is supposed to just customize the layout of a uclass, but

    3. How do you make that UClass show up in a DockTab ?

    I have the following classes for clarity :
    FPlanetEngine (Plugin Module)
    FPlanetEngineStyle
    FPlanetEngineCommands
    UPlanetEngineData
    FPlanetEngine​​​​​​​Details

    4. I want to make the details come up and be editable in a DockTab like so :
    Click image for larger version

Name:	Screenshot_62.jpg
Views:	35
Size:	36.5 KB
ID:	1719929​​​​​​​


    Thank you,
    Nick

    #2
    You can spawn a SSingleObjectDetailsPanel as the content of your tab and then pass it an instance of your class to display with the SetPropertyWindowContents method.

    Comment


      #3
      Do you need to include any additional depencies ?
      I currently have
      Code:
          TSharedRef<SDockTab> DockTab = SNew(SDockTab)
              .TabRole(ETabRole::NomadTab)
              .Content()
              [
                  SNew(SSingleObjectDetailsPanel)
                  .SetPropertyWindowContents(PlanetEngineData)
      
                  ];
      And the header for including SSingleObjectDetailsPanel.h cannot be found for some reason

      Comment


        #4
        Must include "KismetWidgets" to your Build.cs public modules.
        | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

        Comment


          #5
          Right, I added that, but for some reason it still won't recognize the header for the detail row.
          These are my current depencies :

          Code:
                  PublicDependencyModuleNames.AddRange(
                      new string[]
                      {
                          "Core",
                          "CoreUObject",
                          "Engine",
                          "InputCore",
                          "ProceduralMeshComponent",
                          "KismetWidgets"
                          // ... add other public dependencies that you statically link with here ...
                      }
                      );
          and then it says cannot open source file on
          Code:
          #include "SSingleObjectDetailsPanel.h"

          Comment


            #6
            you also should have Slate and SlateCore modules there.
            | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

            Comment


              #7
              It is still saying the same thing, I added slate and slatecore, I have those in the private dependencies as well.
              I have no clue as to why it is not working at this point

              Comment


                #8
                Is your module Editor type or runtime type?
                Runtime modules cannot use these classes from Editor.
                | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                Comment


                  #9
                  It is an Editor type, in my .uplugin file I have

                  Code:
                      "FileVersion": 3,
                      "Version": 1,
                      "VersionName": "1.0",
                      "FriendlyName": "PlanetEngine",
                      "Description": "",
                      "Category": "Other",
                      "CreatedBy": "",
                      "CreatedByURL": "",
                      "DocsURL": "",
                      "MarketplaceURL": "",
                      "SupportURL": "",
                      "CanContainContent": false,
                      "IsBetaVersion": false,
                      "IsExperimentalVersion": false,
                      "Installed": false,
                      "Modules": [
                          {
                              "Name": "PlanetEngine",
                              "Type": "Editor",
                              "LoadingPhase": "Default"
                          }
                      ],    
                      "Plugins": [                      
                        {                                
                          "Name": "ProceduralMeshComponent",
                          "Enabled": true                
                        }
                      ]
                  }
                  Just putting everything down for clarity

                  Code:
                          PublicDependencyModuleNames.AddRange(
                              new string[]
                              {
                                  "Core",
                                  "CoreUObject",
                                  "Engine",
                                  "InputCore",
                                  "ProceduralMeshComponent",
                                  "Slate",
                                  "SlateCore",
                                  "KismetWidgets"
                                  // ... add other public dependencies that you statically link with here ...
                              }
                              );
                  
                  
                          PrivateDependencyModuleNames.AddRange(
                              new string[]
                              {
                                  "Projects",
                                  "InputCore",
                                  "UnrealEd",
                                  "PropertyEditor",
                                  "LevelEditor",
                                  "CoreUObject",
                                  "Engine",
                                  "Slate",
                                  "SlateCore"
                                  // ... add private dependencies that you statically link with here ...    
                              }
                              );
                  and then in my module startup class I try to do
                  Code:
                  #include "SSingleObjectDetailsPanel"
                  and it freaks out.
                  Last edited by NemoRick; 02-12-2020, 05:13 AM.

                  Comment


                    #10
                    Hey, @BrUnO XaVIeR do you have any other ideas of what can be causing this error ?
                    I tried changing Editor mode to DeveloperTool, as well as adding KismetWidgets to private as well and nothing seems to recognize the header for the property row.

                    Also, if it does work, do I need to spawn it inside the brackets of the dock tab content like so :

                    Code:
                      
                         TSharedRef<SDockTab> DockTab = SNew(SDockTab) 
                    .TabRole(ETabRole::NomadTab)        
                    .Content( SNew(SSingleObjectDetailsPanel)
                    .SetPropertyWindowContents(PlanetEngineData));
                    or inside square brackets like so :

                    Code:
                       TSharedRef<SDockTab> DockTab = SNew(SDockTab)
                             .TabRole(ETabRole::NomadTab)        
                    .Content()        
                    [            
                    SNew(SSingleObjectDetailsPanel)            
                    .SetPropertyWindowContents(PlanetEngineData)            
                     ];

                    Comment


                      #11
                      The API page shows how you're supposed to include the header file :

                      https://docs.unrealengine.com/en-US/...nel/index.html

                      Also you can search engine source for usage examples.
                      | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                      Comment


                        #12
                        I did some digging, for anyone having this problem in the future, add "Kismet" to your private dependency modules.
                        The only thing left is to figure out how to set the actual contents inside of it.

                        Comment

                        Working...
                        X