#slate

1 messages ยท Page 20 of 1

quaint zealot
#

So that load screen lives its own life with no dependencies

low bluff
#

But you are setting the images etc. in the asset in the editor?

quaint zealot
#

I'm setting images, margins, sizes in editor for the main, shared assets. Stuff like icons, that are used only once or twice, would use the GetIcon("MySlateBrush") approach

#

Random icon example here

#

Random theme setting example there

#

These are just how I liked to work on that game, it's not necessarily best. Most UI people are UMG only

low bluff
#

Right, so you have a StyleSet that is static

#

That one retruns the StyleCatalog when calling GetDefaultTheme on the StyleSet instance

quaint zealot
#

Yeah.

#

It's more like GetOnlyAndFinalTheme ๐Ÿ˜„

low bluff
#

And the StyleCatalog is then where you grab the brushes from

#

return FFlareStyleSet::Get().GetWidgetStyle<FFlareStyleCatalog>("/Style/DefaultTheme");
What does the /Style/DefaultTheme stuff refer to?

#

Is that something engine default or did you specify that somewhere

quaint zealot
#

That's my style asset.

low bluff
#

That doesn't explain me how this works though :P

#

I can't find anything about /Style/DefaultTheme in your project.
Is that a path to something in the content folder, or is it some sort of path for slate that you registered as?

#

It refers to a PropertyName in the function

#

But what is that PropertyName

#

Can I call that "MyOtherTheme" if I want to?

quaint zealot
#

It's not in the project, it's a content asset. BP instance from the FlareWidgetStyleCatalog class

#

Just the name of the file

low bluff
#

So it just sits in /Content/Style and is called DefaultTheme.uasset?

quaint zealot
#

Yes.

low bluff
#

That makes more sense

quaint zealot
#

Like I said earlier, Slate is the kind of framework you'll use to create your own environment depending on what you're doing. Working with a stylesheet asset that defines all common stuff - the content padding setting is one used in like 500 lines - worked for me

#

It's my version of avoiding hardcoding stuff

low bluff
#

Yeah I can see how I can utilize this

#

One StyleSet

#

Multiple Style Assets

quaint zealot
#

You could also simply just have all of these settings in the styleset header.

low bluff
#

FMyStyleSet and then FLoadingScreenStyle

#

And putting all required stuff into the FLoadingScreenStyle asset

#

Think that might work out

#

Not a fan of putting everything into the same style

#

Thanks! Will see how far I get

quaint zealot
#

Just beware, if your loading screen is of the "standalone game module" variety, it also means the style set needs to live there too.

#

If it's of the "compiled in game module and started from level loading callback" variety, it's fine

low bluff
#

It's done in the GameInstance, called when the level loads

quaint zealot
#

HR was #1 and doesn't use styleset in loading as a result, new project is #2, looks like you're doing 2 too.

low bluff
#

Yeah I don't have a second module for the loadingscreen part

quaint zealot
#

Good for your health

low bluff
#

There are enough other things to hurt my health

low bluff
#

Do I need something special to get FSlateWidgetStyle to be found?

#

Build.cs lists SlateCor and Slate.
And I include #include "Styling/SlateWidgetStyle.h"

#

Yet it tells me it can't find the FSlateWidgetStyle class

#

Ah

#

Still had class instead of struct infront of it

#

Stupid templates when creating empty classes via editor

low bluff
#

Hm, can seem to get Slate to do what a UMG Widget in terms of layout.

#

Pretty sure I recreated the UMG widget in Slate 1:1, but some parts are still broken.
Such as a HorizontalBox with a text and a throbber looking totally normal in UMG, but in Slate the Text doesn't properly fill the box and is half behind the throbber (cut off)

#

Also in UMG nearly every element can be aligned. In Slate some of the HAlign and VAlign settings aren't existing

#

Can't even debug this properly as it's a Loading Screen which doesn't show up in Editor, so can't use the Widger reflector

#
+ SOverlay::Slot()
[
    SNew(SBox)
    .HAlign(HAlign_Right)
    .VAlign(VAlign_Bottom)
    .Padding(FMargin(0.f, 0.f, 50.f, 50.f))
    [
        SNew(SHorizontalBox)
        + SHorizontalBox::Slot()
        .HAlign(HAlign_Fill)
        [
            SNew(SBox)
            .HAlign(HAlign_Fill)
            .VAlign(VAlign_Center)
            [
                SNew(STextBlock)
                .Text(FText::FromString("LOADING"))
                .Font(FSlateFontInfo(FPaths::ProjectContentDir() / TEXT("Fonts/Rajdhani/Font_Rajdhani_Medium.ttf"), 42))
                .Justification(ETextJustify::Left)
            ]
        ]
        + SHorizontalBox::Slot()
        [
            SNew(SThrobber)
            .NumPieces(1)
            .Animate(static_cast<SThrobber::EAnimation>(ThrobberAnimation))
            .PieceImage(&LoadingScreenStyle.ThrobberBrush)
        ]
    ]
]
#

If I don't put the SBox around the text, I can't vertically align it as center :/

#

Actually I think I misunderstood how slots work in UMG vs Slate.

#

In UMG they are shown as part of the Widget element.

#

So it seemd the settings are based on the element.
However in Slate the Slot and the Element are two pieces

#

Moving stuff from SBox to the slot now and see what that does

#

That however didn't fix a single thing

#

Seems like Slate Slots are set to FILL by default.

#

AutoWidth solved it

#
+ SOverlay::Slot()
.HAlign(HAlign_Right)
.VAlign(VAlign_Bottom)
.Padding(FMargin(0.f, 0.f, 50.f, 50.f))
[
    SNew(SHorizontalBox)
    + SHorizontalBox::Slot()
    .HAlign(HAlign_Fill)
    .VAlign(VAlign_Center)
    .Padding(FMargin(0.f, 0.f, 40.f, 0.f))
    .AutoWidth()
    [
        SNew(STextBlock)
        .Text(FText::FromString("LOADING"))
        .Font(FSlateFontInfo(FPaths::ProjectContentDir() / TEXT("Fonts/Rajdhani/Font_Rajdhani_Medium.ttf"), 42))
        .Justification(ETextJustify::Left)
    ]
    + SHorizontalBox::Slot()
    .HAlign(HAlign_Center)
    .VAlign(VAlign_Center)
    .AutoWidth()
    [
        SNew(SThrobber)
        .NumPieces(1)
        .Animate(static_cast<SThrobber::EAnimation>(ThrobberAnimation))
        .PieceImage(&LoadingScreenStyle.ThrobberBrush)
    ]
]
#

New code, in case someone wants to learn from my bad slate skills

quaint zealot
#

@low bluff Yeah, layout in Slate basically works like this : you set on each object what the contents of the widget align to, and autowidth makes it use "the size it needs". Autowidth everywhere makes a compact layout, no autowidth makes a full-width layout with everything getting the same space.

#

Slots indeed fill by default.

low bluff
#

Quick question: If I have a Text Variable in a Slate widget that I use for a TextBlock and I update the TextVariable, will it update the TextBlock?
Or do I always have to use a function binding to live update the TextBlock?

#
FText SomeText = FText::FromString("SomeText");

SNew(STextBlock)
.Text(SomeText)

SomeText = FText::FromString("SomeOtherText");
#

Will that update the TextBlock properly?

#

Doesn't look like it updates

visual arch
#

I believe you can only have a value or a getter function (using TAttribute)

#

TAttribute can either have a set value or a callback

#

you can use something like this to set a callback (in this case, a static function)

quaint zealot
#

You can pass values, attributes or callbacks to almost every Slate property

#

.Text(this, &MyClass::MyMethodThatReturnsFText)

low bluff
#

Yeah so just text won't update

#

What signature do I need for the Text function?
const FText Function() const isn't correct hehe

quaint zealot
#

FText Class::Method() const

low bluff
#

Alright

quaint zealot
#

Plenty of that stuff in Helium Rain ๐Ÿ˜ƒ

low bluff
#

:P I know, not the reason I asked

quaint zealot
#

TAttribute<FText> in your class is a bit cleaner if you're going to update it directly

#

As a class member

#

Should be able to pass that to Text() and "just update it"

low bluff
#

So TAttribute<FText> SomeText;

#

And the pass it in

#

And update SomeText?

quaint zealot
#

Should work, yeah.

#

TAttribute is what's used internally

visual arch
#

I don't think that would work, as setting a value for TAttributes only copies it

low bluff
#

I can also just make a var for the TextBlock

#

And update that I guess

visual arch
#

You could also just bind a function that simply returns your text property

#

TAttribute has functions like BindUObject, BindUFunction

low bluff
#

That was the start of this discussion though

#

:P

quaint zealot
#

Passing a TAttribute to an attribute parameter of a Slate widgets will store the attribute, not the value

#

Look at the slate parameters and check for SLATE_ARGUMENT vs SLATE_ATTRIBUTE

low bluff
#

Well I tried using it and it didn't work. So I probably did it wrong.

#

The first assigned value worked, the updating didn't.

quaint zealot
#

From the UE4 code for STextBlock :
SLATE_ATTRIBUTE( FText, Text )

low bluff
#
TAttribute<FText> SomeText;
SomeText.Set(FText::FromString("SomeText"));

SNew(STextBlock)
.Text(SomeText)

SomeText.Set(FText::FromString("SomeOtherText"));
#

Is that wrong?

#

Cause it didn't work

quaint zealot
#

SomeText is a class member right ?

low bluff
#

Yes

#

I'm not saving the TextBlock widget and call SetText, that works

#

So the code that randomizes my text works (just to cut that option out)

quaint zealot
#

Well, that's weird but okay, callback it is

low bluff
#

Yeah, well just calling setText is still better than binding ยฏ_(ใƒ„)_/ยฏ

quaint zealot
#

Bindings's better if you have a bit of complexity, but yeah

low bluff
#

Yeah, I just keep remembering Nick saying "Binding is the worst that happened."

#

And try to make it more event based instead of polling

#

E.g. Bullet Count only updates if you shoot, so tell the text to update instead of polling the BulletCount

#

Bindings are easier and more convenient of course

#

Quick Question about styles: Can I expose a Float variable in them? o.o

quaint zealot
#

Binding is safer imho because you don't need to worry about forgetting some random case in a if somewhere, but yeah, of course it's potentially slower

#

You... can expose a float ? I don't see why not.

low bluff
#

Idk what the FSlateWidgetStyle all supports

#

.> but good

quaint zealot
#

UPROPERTY(EditAnywhere, Category = Main) float BlurRadius;

#

Float !

#

It supports all regular Blueprint

low bluff
#

Probably not the best idea to expose LoadingScreen parameters like this, but heeeeeeeeeey

#

Just need a float to control the time between two random tips

#

Without having to go into code so others can change it too

#

So into the LoadingScreenStyle it is

quaint zealot
#

That's pretty much how styles are intended ๐Ÿ˜ƒ

low bluff
#

I guess? You don't get into contact with Styles much in UMG

quaint zealot
#

Yeah UMG is more direct

#

And it's BP based so a bit less wordy

low bluff
#

Yeah you also rather go and wrap your Native Button into a custom Button widget

#

And assign style there

#

instead of using Styles directly

#

Which is not THAT bad, but still

mossy scaffold
#

i dont get whats the difference between slate_attribute and slate_argument

#

does slate_attribute just put the variable inside of tattribute and thats it?

pastel phoenix
#

FSlateDynamicImageBrush can take UTexture2D

quaint zealot
#

... SProgressBar doesn't have a color & opacity setting for the background, apparently.

low bluff
#

@quaint zealot But the UMG progressbar as a Style that has a Background Tint?

#

So basically a SlateBrush

#

Yeah, FProgressBarStyle has FSlateBrush BackgroundImage

#

Isn't that what you need? the Tint has Color/Opacity

quaint zealot
#

Doesn't apply to the background apparently

urban bloom
#

@quaint zealot it needs to know to draw as Image so it can apply via the tint

#

otherwise it will default to box and I dont think it will show as working

#

hmm. actually maybe not. box should still work

quaint zealot
#

It's not a brush problem, it's a SPRogressBar problem ๐Ÿ˜›

#

The bar colors fine, the background doesn't

#

Style works, too

#

There's just no runtime coloring for the background, so no way to fade the object in and out of existence.

urban bloom
#

I dont get it. I can fade one out in UMG, so its gonna work in slate right?

#

Style has a Background Image, Fill Image and Marquee Image. By default, if I just fade out the Background Image via the Tint colour, it fades out fine

pale nacelle
#

@quaint zealot how did you make your 3d widgets?

radiant snow
#

The widget that appears when I click the Edit button for GameplayTag, what would I do to have it as an umg widget, in the palette? I don't really know much about Cpp.
Are the palette widgets the ones in the SlateTypes.h?

maiden talon
#

I'm working on an editor tool and I made viewport and viewportclient classes, but I have no idea how to spawn them, any help?

#

but the SNew is saying FCharacterToolViewportClient has no member FArguments?

maiden talon
#

ok nvm needed to pass the slate class not the client

#

still don't know how to spawn it, but at least it's compiling

mild oracle
#

Am I going crazy, or does SRichTextBlock not support shadows?

urban bloom
#

/chases @mild oracle with a butterfly net

mild oracle
#

aaaahhh!

#

Wait what

urban bloom
#

Don't make a fuss just get in the van sir.

#

produces a straight jacket

mild oracle
#

OK so I am crazy

#

I dunno what I'm doing wrong, the FTextBlockStyle that's being used has a shadow set

urban bloom
#

Do you need to do it by Style?

#

ie. are you following the tutorial or have you implemented another method?

main hedge
#

shadow works in our rich text

mild oracle
#

I'm still using the rich text stuff from before the re-write

#

so maybe that's it

#

FSlateTextRun etc.

urban bloom
main hedge
#

that's out line not shadow tho

urban bloom
#

yeah I meant how they apply the styling

#

might be worth looking into Decorator classes too

main hedge
#

that : should not have a space before it

mild oracle
#

I'll rewrite our rich text engine to use the new stuff, I've been putting it off

urban bloom
#

yeah Font + Styling can be a tricky thing to get right.

main hedge
#

the outlines used to fuck with it too until I just commented out the part where it took them into account

#

I wonder what the proper fix is

urban bloom
#

I used to get a lot of issues in Scaleform with such things. Anything widget based that is dynamic can get hairy with Fonts. Had to micro-manage my own kerning and shit. Kinda felt that stuff should already be exposed so you can truly customise everything about your fonts and layout/styling

mild oracle
#

I hope it's still possible (maybe easier?) to get inline images, and inline buttons in text

#

And to use my custom rich text format thing too. e.g. This is *bold*, this is _italics_.

main hedge
#

seems like we made the same thing

urban bloom
#

well easy is a relative concept. But you could go as far as producing your images in external code and bringing them in with Asset Manager or similar. There are PHP scripts you could call with VaRest or something to generate your images + shadows etc exactly how you want them

mild oracle
#

wow

#

I was just talking about putting UWidgets or brushes inline for icons and stuff

#

yeah @main hedge ? ๐Ÿ˜„

main hedge
mild oracle
#

Ideally I want to support stuff like Upgrade to [weap:laser2] and it puts a clickable button with the correct name of the weapon

main hedge
#

sounds like a job for a decorator

#

puts arbitrary widgets in the text layout

mild oracle
#

I had some crappy impl. working before the rewrite

#

then 4.21 or whatever it was completely rewrote everything xD

main hedge
#

it is surprisingly difficult to parse markdown

urban bloom
#

I've just had two weeks of imagining the results of a matrix calculation, several-ty hundreds of times. My brain is in rows and columns now

main hedge
#

what is the matrix for ๐Ÿค”

urban bloom
#

slot machine

#

pure UMG slot machine too. Dunno why but I had an idea.

mild oracle
#

@urban bloom OK get in the van

royal geode
#

rofl zeb

sinful pawn
#

Hi Guys! Anybody knows how to make something like this on a plugin? I've been struggling a lot with it. I found SListView but it didn't help me too much

royal geode
#

Wdym @sinful pawn

#

That's a detail view

#

It's all automatic

#

Nothing to make

sudden fossil
#

It's an array of TSubclassOf<>

gray mesa
#

If I want to create an custom editor window similar to this.
where should I start looking?
basically moving trough an animation and be able to place boxes.

urban bloom
#

I would start with the plugin tutorial on the Unreal Academy. That will give you insight into making a custom asset and a little on the custom graphs and how they are made.

#

@gray mesa

gray mesa
#

the video is not available

#

do you happen to know a mirror?@urban bloom

#

nvm it was on me

#

sorry for the ping

urban bloom
#

heh no worries

gray mesa
#

ue4 is on my c drive

#

when I use the widget reflector

#

and click on something it says it cannot find the file

#

but it is looking in the wrong path

ornate crater
#

wild guess, but do you have debugging symbols downloaded?

gray mesa
#

yes....

quaint zealot
#

Never had that feature work for me

#

Just alt shift O in Visual and search for the class, if you've got Visual Assist

royal geode
#

@gray mesa Symlink that directory to your install

gray mesa
#

sym what?

royal geode
#

I suppose your engine isn't installed there

gray mesa
#

yes

royal geode
#

So symlink that directory to your install directory

gray mesa
#

so should I simlink my D drive with my C drive?

royal geode
#

No

#

The folder

gray mesa
#

the install folder you mean?

gray mesa
#

that folder does not exist

royal geode
#

Well obviously

#

As you need to create it

gray mesa
#

the whole structure?

royal geode
#

And make it point to your real install dir

#

Yes

#

So like

#

mklink /D D:\Build\++UE4\Sync\Engine C:\Whatever\Engine

gray mesa
#

@royal geode what am I doing wrong?

#

nvm

#

ok I am lost

royal geode
#

It's an upper case D @gray mesa

#

/D

#

Not /d

pearl badger
#

@gray mesa i actually made that, what did u want to know?

gray mesa
#

@pearl badger what did you make?

#

something similar to the screen shot?

pearl badger
#

That screen shot you posted

#

I made that

#

The custom paper2d hitbox system

gray mesa
#

oh you are the programmer who is working on Unreal Fighter 2D?

pearl badger
#

Yeah/

#

Yeah thats me.

gray mesa
#

sick

#

I am currently just learning slate to create my own boxframe data system for my beat m up.

#

can I ask you questions in the future for when I come across specific stuff I need some direction in?

pearl badger
#

sure i guess, i wont answer everythig though

crisp bluff
#

I can do it in a quarter of the time, but my rate is 8x as high and I require minimum hours kappa

pearl badger
#

fuck u immut

#

โค

gray mesa
#

what kind of stuff won't you answer for example?

pearl badger
#

Spilling source code for what i did, it was private contract work.

#

and anything thats going to take me more than 30 seconds to explain

#

Unless you want to pay me, busy bee

gray mesa
#

oh that wont be needed. it will only be simple stuff anyone knowing slate should be able to answer

pearl badger
#

Thats not how it works

#

Slate != Editor slate and support editor slate kits

#

not even close

gray mesa
#

ok, maybe not so simple stuff... I just started 2 days ago with this stuff I'll learn and know better in the future

urban bloom
#

if Rei can do it, you can too !

#

runs away

royal geode
#

lol Marc

ancient wigeon
#

Is there a way how to access FWidgetBlueprintEditor without modifying engine?

#

I am getting crazy that absolutely every pointer is private, so there is not even a way to hack it

#

I would like to get FWidgetReference of one specific widget from my project editor module

#

That is one thing which is driving me crazy about slate and umg. It lacks extensiblity from project code and all workarounds are blocked by strict access modifiers.

urban bloom
#

I beg to differ but then I have no shame in editing engine code. ๐Ÿ˜„ I think there is a block because they are meant to be private functions internal to a process. WidgetBlueprint stuff has some weird accessor methods in the editor. Usually from some Util class somewhere.

ancient wigeon
#

Nah, downloading source build. I knew that the time of source build is getting closer and closer to our project.

#

Going to do some work on enabling child widget properties propagation in UMG, I think it is one feature which is really missing

urban bloom
#

if you explain what you are doing a bit more, I might be able to help

#

ps. yes to child widget property propagation. I run a chain of SetupDefaults functions atm. It's tidy but its not the tidiest

ancient wigeon
#

Our new UI is built mostly on composition system, so we have multiple reusable widgets. Let's say that you have reusable widget WBP_Button (button style enum) and WBP_GenericDialog which contains this button widget. If you place your WBP_GenericDialog into another widget blueprint you lose access to WBP_Button properties because it is deeper then one level.

urban bloom
#

I see

ancient wigeon
#

I already have nice setup which is abusing SaveGame propety flag. If this flag is checked, then this property is visible in all parent widget properties, no matter how deep it is. This work's nicely however values get reset on compile, so I suspect that I am modifying just preview widget, not actual template widget.

urban bloom
#

Can you not abuse the WidgetTree to get access?

#

When I select a Widget in my detail panel, I only get the variable's Detail Panel. If you wanted to show the properties of that widget, you can do it with a Detail Panel Customisation. You would simply loop the Widget Tree of the passed in widget, then output it's Slate views

ancient wigeon
#

What I do is that in details panel customization I am geting customized object (=selected umg widget). For this customized object I am calling GetPropagatedProperties recursively (using WidgetTree). Output of GetPropagatedProperties is array of UProperty*. Every UProperty has own entry in details panel and when I modify it, value get's set correctly in UProperty. However, after compile, value of UProperty resets.

urban bloom
#

are you marking it dirty?

ancient wigeon
#

I noticed that if I modify the variable then yellow 'reset to defaults' arrow does not pop up. My guess was that it needs to get invalidated/marked dirty. However, I tried many different ways to mark it dirty

urban bloom
#

there are ways to save objects in a widget blueprint too. I have a function that gets the outer Widget Blueprint from a passed widget. Then I do what I need to its widget tree objects. Save the file manually and tadaa

ancient wigeon
#

nothing did the job

#

Save resets the value too.

#

There is another interesting thing about this. I originally tried to make these variables use standard properties customization (IPropertyHandle)

#

however that crashes on modify when modified variable is copied from Preview widget to Template widget,

#

because preview widget is hardcoded as currently selected widget

#

so I ended up using just simple SEditableText instead of original property customization widgets

#

but that gives me the error above

#

I will try to look for some manual save function

urban bloom
#

Looking at some old code. I have this that I use to mark a blueprint as dirty so the compile is required, which will save properly. First you mark your object dirty as usual. Then call this

FBlueprintEditorUtils::MarkBlueprintAsModified(UYourAPI::GetWidgetOwningBlueprint(WidgetInstance));
#
UWidgetBlueprint* UYourAPI::GetWidgetOwningBlueprint(UWidget* InWidget)
{
    TWeakObjectPtr<UObject> WidgetObj = InWidget->WidgetGeneratedBy;
    UWidgetBlueprint* OutWidget = Cast<UWidgetBlueprint>(WidgetObj.Get());
    if (OutWidget)
    {
        return OutWidget;
    }
    else {
        return nullptr;
    }
}```
ancient wigeon
#

That's interesting, I was trying to find some way of calling MarkBlueprintAsModified() but I could not find anything. I am going to try that, thank you

urban bloom
#

that util class is a life saver

ancient wigeon
#

I see, i was looking at FWidgetBlueprintEditorUtils before. FBlueprintEditorUtils has whole bunch of new toy functions, haha

urban bloom
#

Yeah the WidgetBlueprintEditor stuff is kind of behind a wall because its a layer on top of UUserWidget in terms of what the developer is supposed to edit. I found this out the hard way trying to make a new WidgetBlueprint class that derives from UUserWidget. It did not go well. Instead I merely used the "switch the class parent" method which isn't the same but works.

ancient wigeon
#

So it did not help

#

however, I was able to get it work with custom engine

#

I needed to add just one line!

#

I was able to make it work using default property customization, no need for custom editable text

#

...without modified engine:

#

IDetailCategoryBuilder& Cat = DetailBuilder.EditCategory(TEXT("Designer"));
Cat.AddExternalObjectProperty({ PropOwnerPair.Owner }, PropOwnerPair.Property->GetFName());

this external object details customization crashes the engine because of this checkf in UProperty:

ancient wigeon
#

nah, i tested it incorrectly, It still needs some work

bleak tapir
#

Anyone have any idea what would cause ProcessMouseMove from spiking hard by just sweeping my mouse across the viewport, while playing in a standalone application? UpdateTooltipTime also spikes with it, even when there's no UI in the viewport

mild oracle
#

I wish if you set an image to tile vertical & horizontal it wouldn't set its minimum size to be the size of the texture. I have a 32x32 tiling image that I want to use in many places, even places that are smaller than 32x32... But without sizeboxes it doesn't work

#

it's kinda annoying

narrow terrace
#

Hello Im right now learning slate and Im working on sort of recreating the throbber widget but to be able to also have each piece disappear if the animation is set to none. And Im having trouble understanding how the animation curve actually adjusts each piece via scale or opacity... because I dont see any regular syntax for a delegate being bound or anything like that...

#

If anybody is able to explain how this works I would really appreciate it ๐Ÿ˜ƒ

narrow terrace
#

So I think I figured it out...

#

They setup a throbber curve to play and while its playing they also bound the functions GetBrushScale and GetPieceColor which will get the curve's current time while its playing and calculates how to adjust its scale, and opacity and such...

craggy holly
#

I don't suppose anybody has made a PIE chart widget in Slate have they at all?

#

I'm looking for something where I can define a bunch of regions then drag handles around to tweak ratios.

urban bloom
#

I did see one once, although you can do that in a shader

#

@craggy holly

craggy holly
#

yeah nah I'm looking for a special widget for a details customisation. I'll figure something out

mild oracle
#

@craggy holly There's a plugin called kantan charts that I think had a pie chart in it?

#

If you make something I'd love it if you could post it, I have to do pie charts for our game too ๐Ÿ˜‰

urban bloom
#

Im sure I saw one. Ill see if I can dig it up

#

nm. it was a material

#

but then you could just make your own widget for it with a material + some UMG input control

maiden talon
#

How would I make a grid of clickable buttons in slate

maiden talon
#

cool, good starting point, thanks

cosmic herald
#

i made a subclass of the SButton, and i have some init logic that should only be done once, where should i do that? it seems like there is no constructor but a Construct function. should i override that?

royal geode
#

yep

cosmic herald
#

so is that jus a slate thing? treat the Construct function as the constructor conceptually?

royal geode
#

Yup

cosmic herald
#

thx ๐Ÿ˜„

maiden talon
#

can you change the size of an SCheckBox?

urban bloom
#

of course

severe shard
#

I'm trying to set my slate font, but for some reason it doesn't get applied. Is there a specific setting I have to select in the font, or font face in order to make a font work with slate?

#

.Font(FSlateFontInfo(FPaths::EngineContentDir() / TEXT("Slate/Fonts/My-Font.ttf"), 12))

maiden talon
#

@urban bloom how do you do that? I'm very new to slate

urban bloom
#

SetRenderScale

maiden talon
#

ah ok, didn't know that existed, thanks

inland elbow
#

I think I have my brain wrapped around how to build the UI, just how do I get data back out of it? There's the callbacks... but they only give me the value, not what was changed.

inland elbow
#

if I have a SEditableTextBox, how do I get it's value after it's been changed?

bleak tapir
#

Has anyone successfully masked a BackgroundBlur?

cosmic herald
#

is there a way to extend the FSlateApplication? or more specially, the FHittestGrid behavior inside it? trying to see if i can avoid an engine change

urban bloom
#

@cosmic herald depends how you want to modify it. The best way is to extend from it with a new class and use that. If not, you can manage your own properties seperate from the class but you will have to serialise and save your associated data properly (can be a pain). There may be some Editor Utility interface to it. But essentially you are looking as a plugin to avoid engine changes

cosmic herald
#

@urban bloom but it seems to have the getter for FHittestGrid only and no setter, not sure how I can extend it without adding a setter to the engine code

#

actually, that's from a SWindow....๐Ÿค”

pastel basin
#

Greetings. I have a question. Can Slate be changed dynamically? (as example text color loaded from ini file)

royal geode
#

@pastel basin wdym

pastel basin
#

I think i found an answer (i wanted to make an ui element that can be set from ini file)

sand fable
#

Hello, I can't seem to figure out why my Sliders are Visible but very very small

I'm doing this:

    Overlay->AddSlot()
        .HAlign(HAlign_Left)
        [
            SAssignNew(PitchSlider, SSlider)
            .Orientation(Orient_Vertical)
            .IsFocusable(false)
            .Value(this, &SInspectorModePreviewEditorViewport::GetCurrentPitchOffset)
            .OnValueChanged(this, &SInspectorModePreviewEditorViewport::OnPitchSliderValueChanged)
        ];

    // Yaw, bottom centered slider
    Overlay->AddSlot()
        .VAlign(VAlign_Bottom)
        [
            SAssignNew(PitchSlider, SSlider)
            .Orientation(Orient_Vertical)
            .IsFocusable(false)
            .Value(this, &SInspectorModePreviewEditorViewport::GetCurrentPitchOffset)
            .OnValueChanged(this, &SInspectorModePreviewEditorViewport::OnPitchSliderValueChanged)
        ];

And they are small as hell, can see them in the Widget reflector but not where they are supposed to be

#

I thought elements filled the space in an Overlay? AM I doing something wrong please?

pastel phoenix
#

did you tried
.VAlign(VAlign_Fill)
.HAlign(HAlign_Fill)

pastel basin
#

I have more like VS question than Slate. But very related.
When i'm opening a CPP from WidgetReflector, it opens a new instance of VS. How to make it open in already running VS where the project is opened?

pastel phoenix
#

try to open VS first, then start your editor from VS via ctrl-F5

cold quarry
#

So i'm trying to create a custom button that's a child of SButton. When I try to create it in RebuildWidget, I'm getting an error that says OnClicked is not a member of SAdvancedButton::FArguments

#
    MyButton = SNew(SAdvancedButton)
        .AdvancedOnClicked(BIND_UOBJECT_DELEGATE(Delegates::FMouseButtonSignature, HandleClicked))
        .OnClicked(BIND_UOBJECT_DELEGATE(FOnClicked, SlateHandleClicked))
        .OnPressed(BIND_UOBJECT_DELEGATE(FSimpleDelegate, SlateHandlePressed))
        .OnReleased(BIND_UOBJECT_DELEGATE(FSimpleDelegate, SlateHandleReleased))
        .OnHovered_UObject(this, &UAdvancedButton::SlateHandleHovered)
        .OnUnhovered_UObject(this, &UAdvancedButton::SlateHandleUnhovered)
        .ButtonStyle(&WidgetStyle)
        .ClickMethod(ClickMethod)
        .TouchMethod(TouchMethod)
        .IsFocusable(IsFocusable)
        ;
sand fable
#

@cold quarry What does your .h for your widget look like?

#

And I also have a problem.

I'm trying to use SListView and I'm struggling.

I pass in an array of TWeakObjectPtr<MyType> as the ListItemsSource as follows:

                            SNew(SListView<TreeDataSharedPtr>)
                            .ItemHeight(24)
                            .ListItemsSource(&MyArray)
                            .OnGenerateRow(this, &MyClass::OnGenerateItemTreeRow)
                            .OnSelectionChanged(this, &MyClass::OnItemTreeSelectionChanged)
                            .SelectionMode(ESelectionMode::Single)

And for some reason, once in the SListView::GenerateWidgetForItem() my CurItem is null and if I go back up a bit from the callstack, I can see that my entire array of source items is invalid... But when I break in the Construct(), I have my 2 items and it's setting it properly...

What could mess up that array inbetween please? Any suggestion is welcome

pastel phoenix
#

perhaps you should keep MyArray in the class somehow, don't let him be destroyed, @sand fable

#

is it local variable?

sand fable
#

It's a class variable

#

I sorta fixed the issue by using SAssignNew and storing the resulting widget as a SharedPtr as well in my class

#

But I still have problems with the list resetting to empty and so I have 0 children despite initializing it with an array of 2 items and everything working well in the Construct

pastel phoenix
#
    mListView = SNew(SListView<TSharedPtr<Choice>>)
....
                    SNew(SScrollBox)
                    + SScrollBox::Slot()
                    [
                        mListView.ToSharedRef()
                    ]

works fine for me

sand fable
#

It's a lot more convoluted than that in terms of modules, dependencies, pointers etc, so I'm guessing the problem stems from that

#

Thank you for your input though!

pastel phoenix
#

btw, class variables are:

    TArray<TSharedPtr<Choice>>                mChoices;
    TSharedPtr<SListView<TSharedPtr<Choice>>> mListView;
sand fable
#

Hello, much like a IDetailsView, is there a way to have, inside one of my Widgets (for example, an SExapandableArea), a widget allowing for the display of 1 specific property from an object,

In my case, my object has an array of structs and I would want to display 1 of those struct in each ExpandableArea, but everything under it handled to be modifying a given object.

Much like DetailsView, without all the fuss about filters and picking only a single property etc etc, does that exist please?

crimson jungle
#

Hello. I'm trying to customize my details and add a button to the right of a string property. I did it but some details of customization are bothering me. So I have two questions.

  1. My property is added with right align but I can't find where I can change it. If I disable property name displaying then the property is left align.
  2. Is it possible to add a row in a category not in the top but in the bottom after other properties? In the best case, I want to add my property in the same style as other properties in the category. I mean with general splitting on two columns.
    I'm sorry if I did mistakes in English or in the description of my problem.
    My code looks like that:
.CustomWidget(true)
[
    SNew(SSplitter)        
    + SSplitter::Slot()
    [
        SNew(SProperty, DirectoryProperty)
    ]

    + SSplitter::Slot()                
    [
        SNew(SHorizontalBox)
        + SHorizontalBox::Slot()
        .AutoWidth()
        [
            SNew(SButton)
            .Text(NSLOCTEXT("English", "SetPath", "..."))
            .HAlign(EHorizontalAlignment::HAlign_Left)
            .OnClicked_Lambda(SetPathDialog)
        ]
    ]
];```
jolly prawn
#

I have an SHorizontalBox, how can I make its slots fixed size? I tried the following but FillWidth didn't do what I thought it would do

        .FillWidth(100)
        .MaxWidth(100)
        [
            SNew(STextBlock)
            .Text(title)
        ];```
#

.WidthOverride() Does not seem to exist, only AutoWidth()

sand fable
#

@jolly prawn Yeah so far from what I've seen, slate doesn't let you arbitrarely give a pixel size to widgets. They fill each other using specific rules but that's about it. Also, FilleWidth takes in a value from 0 to 1, it's a % of its parent.

jolly prawn
#

ok! I can probably work with that! Thanks.

jolly prawn
#

Nvm, I can't work with that. I thought I could set a good size on my slots by setting them to a percentage of their parent but I can't make them fill out the entire space

sand fable
#

That might be because the content isn't taking the entire space, the problem might be deeper

#

Could you screenshot the problem using the Widget Reflector please? Just to make sure we're on the same page here

jolly prawn
#

SGitWidget is just a SVerticalBox and SGitWidgetRow is just a SHorizontalBox

#

You're right, my SVerticalBox isn't taking up the entire space of the SBox

#

I have a function that returns my SVerticalBox and it's meant to fill its parent

#

I thought that maybe I could set the padding of my SVerticalBox to 0 but it doesn't seem to have a function for that ๐Ÿ˜ฉ

sand fable
#

@jolly prawn SOrry for the very late answer. You probably figured it out by now, but it's because your widget doesn't have everything setup properly. I think if it did, it would calculate its size properly and fill up its parent!

#

StillerAutoMatte and StillerFlair

#

When I had an SListView missing arguments such as OnGenerateRow and OnGetChildren, it was doing the exact same. As soon as I added those, it created my items and they were filling the entire thing

cosmic herald
#

im trying to extend the FButtonStyle to include an extra an state, but im not exactly sure how to hook it up to my custom button widget. every reference to the style variable is of type FButtonStyle, how would i change that?

ivory adder
#

Copy paste sbutton class and change fbuttonstyle to your own style

jolly prawn
#

I found the issue to my widget not filling their parent. The parent had .HAlign(HAlign_Center) and .VAlign(VAlign_Center) that messed up my child widgets. Obvious in hindsight, but I didn't know that it would mess up my stuff back then.

sand fable
#

Hi, trying to display a custom widget showing certain fields of a certain struct.

So far, I create it like that:

bool PropertyFilter(const FPropertyAndParent& Property) const
{
    bool bShouldBeDisplayed;

    const FString& PropName = Property.Property.GetOwnerProperty()->GetNameCPP();

    bShouldBeDisplayed = Property.ParentProperty
        || PropName == FString("bOverrideDefaultCameraSettings")
        || PropName == FString("SpecificCameraParameters");

    return bShouldBeDisplayed;
}
#
// inside a function that takes care of initializing stuff
            // Property module to create a Structure Details View
            FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");

            FStructureDetailsViewArgs StructureDetailsViewArgs = FStructureDetailsViewArgs();
            FDetailsViewArgs DetailsViewArgs = FDetailsViewArgs(
                /*bUpdateFromSelection = */        false,
                /*bLockable = */                false,
                /*bAllowSearch = */                false,
                /*NameAreaSettings = */            FDetailsViewArgs::ENameAreaSettings::HideNameArea,
                /*bHideSelectionTip = */        true,
                /*NotifyHook = */                nullptr,
                /*bSearchInitialKeyFocus = */    false,
                /*ViewIdentifier = */            NAME_None
            );

            StructureDetailsView = PropertyEditorModule.CreateStructureDetailView(DetailsViewArgs, StructureDetailsViewArgs, nullptr);
            StructureDetailsView->GetDetailsView()->SetIsPropertyVisibleDelegate(FIsPropertyVisible::CreateRaw(this, &STMEInspectorModePreviewWidgetImpl::SMyWidget::PropertyFilter));
            StructureDetailsView->GetOnFinishedChangingPropertiesDelegate().AddRaw(this, &SMyWidget::OnCameraParamsChanged);


// later on in the code, same class
            const MyStruct* State = MyActor->GetMyStruct(InName);

            FStructOnScope* StateStruct = new FStructOnScope(MyStruct::StaticStruct(), (uint8*)&State);
            StateStruct->SetPackage(MyActor->GetOutermost());
            StructureDetailsView->SetStructureData(MakeShareable(StateStruct));
#

And it seems it's loading forever and end up causing out of memory exception and crash the editor.

Is it because of Nested Structs ??? MyStruct contains another struct. But before I tried that, I tried displaying that other struct that's inside and it worked fine.
All I did was change the type of struct used in the FStructInScope and suddenly nothing works. Any suggestion is welcome.

#

Seems to be stuck in the SetStructureData

sand fable
#

It would appear as though, even though I filtered some things out (including some arrays), those empty arrays are still causing trouble

royal geode
#

Is there a way to make TArrays not collapse when adding a new item in details view?

lone shoal
#

Crossposting from cpp. Can we override/work around GetDesiredSize on UWidgets to force a certain height or width without a sizebox?

#

It's not virtual, so overriding won't work ๐Ÿ˜ฆ

main hedge
#

you can override it on a custom SWidget, otherwise, that's exactly the point of a size box so it would be silly to not use one

jolly prawn
#

So I have an SVerticalBox (going to change it to a scroll box later) with rows of SHorizontalBox's. There are can be 2 or 3 slots on each row, I want each slot to take a third of the space available so that if there are only two slots being used then the the space where the third slot would have been is not occupied. I was able to implement this by adding an empty text slot to the third "non-existing" slot. I wanted to know if there was a less hackish solution I could use instead?

#

I can't use SGridPanel because I want to be able to scroll the top layer with an SScrollBox, but maybe i could put an SGridPanel inside an SScrollBox slot? I'd have to make some refactoring if I wanted to change to SGridPanel though, if that's the only right way to do this then I'll just keep using my empty slot hack.

main hedge
#

a scrollbox only has one child slot

#

so you'd put the vertical box or the grid panel inside it

#

it seems like a grid panel is more appropriate here

jolly prawn
main hedge
#

huh, interesting

#

well anyway, putting the grid panel into the scroll is how you'd achieve that

jolly prawn
#

This is my SScrollBox with a single slot with the same exact SVerticalBox as above within

#

How can I make my ScrollBox container look like the version without a scroll box? I've tried setting the VAlign to fill for both the scroll box slot and vertical box slot. I also tried setting the padding of my scroll box slot to 0 (though I haven't tried using both at the same time) but it didn't help

#

By using the widget reflector I found out that the scroll box is occupying all available space but the vertical box is not, for some reason I do no understand

main hedge
#

hm I've never tried to make something fill a scroll box before in the direction it is supposed to be scrolling

#

that seems counter intuitive also since then the elements would shrink when you add more

jolly prawn
#

I guess yeah, kinda wanted a vertical list but if it overflows then I can scroll the rest of the contents

royal geode
#

@jolly prawn Have you tried adding a SSpacer?

jolly prawn
#

No idea what that is, I'll look into it tommorrow at work! Thanks for the tip

main hedge
#

it's a widget that takes up a fixed amount of layout space and otherwise does nothing

bleak tapir
#

Is it possible to get the absolute size of a widget that's a child of a UGridPanel?

main hedge
#

get its cached geometry after it has been rendered for a frame or prepass has happened some other way

main hedge
#

is it possible to force redraw of the slate ui while the game thread is frozen processing some a thing for a while? I know this isn't a nice thing to need, but the editor can do this too while importing meshes etc

#

can't seem to figure out how it is done in the editor

urban bloom
#

@main hedge I guess it depends if Slate is running on the game thread or not. I never actually had to check that out but I presumed it was due to the way it is affected by a 0.0 global dilation. Not that it means for sure, but my presumption.

#

Im not 100% on this but if Slate is essentially rendered as part of the RHI system, then it should be possible to have it in another thread right?

#
{
    SCOPE_TIME_GUARD(TEXT("FSlateApplication::Tick"));

    // It is not valid to tick Slate on any other thread but the game thread unless we are only updating time
    check(IsInGameThread() || TickType == ESlateTickType::TimeOnly);

or maybe not

eternal wave
#

is there any widget for tab bar?

royal geode
#

You can use the widget reflector to see which widgets are used in the editor

plain portal
#

:17 PM] phy: Is there a way to make TArrays not collapse when adding a new item in details view?

#

@royal geode did you find a solution to this?

royal geode
#

@plain portal no ๐Ÿ˜ญ

#

It's so annoying right

plain portal
#

I think I solved it in the task plugin in some cases in a branch but I gave up

#

will have to look

royal geode
#

๐Ÿ˜ƒ

toxic dove
#

just something cool i wanted to share

main hedge
#

how many 1000 lines to make this with slate

toxic dove
#

i can go count lol

#

nvm too many files ๐Ÿคฃ

#

it involves 3 different custom gameplay modules though to be fully functional

pastel phoenix
#

do it works without UEditor?

toxic dove
#

no its an editor extension

low bluff
#

I remember doing that for setting up a traffic system

undone geyser
#

is it possible to create slate windows from Python?

cunning epoch
#

How can I bind a slate widget created with SNew()?

#

I really just want to get a TArray of all selected items in an SListView Widget but can't seem to figure it out

#

I have tried doing SAssignNew(InstantiatedWidget, SListView) where instantiated widget is an object of type SListViewWidget but its not working.

cunning epoch
#

Ok I managed to get it to work with the instantiated widget by using a custom SListViewWidget

pastel phoenix
#
TSharedPtr<SListView<TSharedPtr<Choice>>> mListView;
...
    mListView = SNew(SListView<TSharedPtr<Choice>>)
low bluff
#

SAssignNew(mListView, SListView<TSharedPtr<Choice>>) is also a thing

#

Parameters might be swapped, can't recall

cunning epoch
#

Yeah I got it to work doing that exactly

#

Thanks guys

knotty sequoia
#

btw, about slate

#

when don't have any UE4 editor windows open, the empty window is around 120 fps, on a gtx 1080 TI

#

opening a single blueprint window makes the viewport go to 100 fps

#

80 fps 11 milliseconds with a bunch of Blueprints opened, 120fps 8 milliseconds without any

#

this isn't too much of an issue to be honest, and I don't know if other GUI Apis would have similar issues

#

but still, it doesn't seems like slate is so lightweight

main hedge
#

this is because people bound thousands of delegates to retrieve values every frame in bp graph widgets

royal geode
#

๐Ÿ˜“

knotty sequoia
#

no I mean @royal geode it's not like your voxel plugin, the voxel plugin is awesome

#

the voxel plugin is built on UE4 and inherits UE4 limitations

#

@main hedge this was during editor, the game wasn't running or anything

#

I don't even use delegates

#

I think phyronaz voxel plugin is rather powerful tbh... I can't say i've seen other plugins display anything like it

#

interesting to know that it's probably more a blueprint issue tho

main hedge
#

not your game

#

the bp editor

knotty sequoia
#

ok

ancient blade
#

i had a goofy idea, since you cant get em boosted through the UI texture what if you rendered out to texture a boosted version of the UI elements and got it that way?

main hedge
#

what do you mean by boosted?

ancient blade
#

I got it working through the 2d Scene Capture camera but it is easier to control just creating a 2d plane and projecting a material with an em boost.

noble skiff
#

hmm.. so I have a custom struct detail override. it works perfectly.
except.. when this struct happens to be in a map.. there is no way to remove the map element. Is there an easy way to add the little down arrow with the "delete" element button, when struct with IPropertyTypeCustomization is used?

#

(i assume it would be same issue if it's in a TArray too, but ihaven't checked that one yet)

#

Nevermind

#

it is on the value lol

#

im blind.

potent wasp
#

Hey guys, so I searched around the last few days in order to find some kind of solution for UE to render to multiple windows. I know that it is possible to workaround restrictions by using SceneCapture, but I am looking for a solution similar to ExtraWindow on github which sadly is too old and doesnt work anymore. I imitated the PIE engine code, but I cant get it to work and I dont want to dig too deep into the engine. If someone tried this stuff before I would happily receive any hints or clues ๐Ÿ˜‚

bleak tapir
#

For a IDetailCustomization interface, I'm trying to use IDetailLayoutBuilder::GetObjectsBeingCustomized inside of "CustomizeDetails", how would I cast the object to a struct to access the data? GetObjectsBeingCustomized fills an array of type TWeakObjectPtr<UObject>

royal geode
#

@bleak tapir you can only customize objects using that

dry apex
mild oracle
#

If I have a TSubclassOf<UUserWidget>, is there really no way to spawn it through Slate? I really want to be able to show custom tooltips on rich text inline widgets

main hedge
#

instantiate it and use TakeWidget

#

the slate widget will keep the UObject alive

craggy holly
#

I'm not sure that latter part is true actually - but you can inherit from FGCObject for your Slate Widget and add the instantiated UObject to the list of GC references, then clean it up later.

#

There's a few places where the engine does that.

main hedge
#

the widget hierarchy generated by a UUserWidget begins with a SObjectWidget that is a FGCObject for the explicit purpose of keeping the UObject alive

bleak tapir
#

Does anyone know what SControl they use for a localizable FText property?

wide plaza
#

not really well experienced with slate but i'm working on an editor tool. i added a SScrollBox but it doesn't appear to be working after resizing the window (content still overflows w/out scrolling)

#

there must be something i'm missing

#

nvm figured it out, it was .AutoHeight on the containing vertical box slot

low bluff
#

Do I have any chance of replacing FSlateApplication with a custom child of it?

#

Cause I'm a bit pissed that Epic thinks Tresholds for Axis "KeyDown" isn't needed.

main hedge
#

if you modify FSlateApplication::Create then yes

low bluff
#

@main hedge Is it against all nature to do that? :D

#

Hm create is not virtual

#

Mรคh

#

If I have to modify the engine then I could also just implement thresholds :/

wary steeple
#

Has anyone investigated implementing ToolTips for gamepad and know of specific pitfalls I should be aware of?

quaint zealot
#

Dont use the tooltip system basically

#

Add your own overlay on bottom focus

wary steeple
#

cool lol

pastel phoenix
#

you cold make your own child of IInputProcessor, @low bluff , and process all inputs as you wish

elfin shore
#

Hey so I'm trying to figure out how to draw a filled custom shape, given a number of points, on screen?

#

I can draw lines and whatnot but how to fill the screen space within those lines I have no idea

maiden talon
#

is there a way to set the fixed size of a tab

#

I know about SetSizeCoefficient but that's relative

#

or do I not do that with NewStack

merry sapphire
#

Hey Ya'll, I'd like to change the default (top) representation of a struct in an array in the details panel to ideally all in-line like this. I'm currently following some basic guide for writing slate but I was curious if anyone had specific advice to achieve this?

warm vault
#

If you want to customize the header, one thing you can do is wrap the array inside a UStruct, the array must be UProperty exposed to Editor (EditAnywhere) and with a Category specified... Then you can create a struct customization and replace the header widget with your own.

proper epoch
#

I think that @azure tundra 's idea is not bad, although I can't figure out how to put it inside of a data asset

pastel phoenix
#

i think you should multiply your position to DPI Scalling

proper epoch
#

Hmm, what do you mean by multiplying position? What I meant is that I can't get a preview image displayed in a data asset

#

But sure, this one might be useful further on

main hedge
#

can I disable the dpi-downscaling of tooltips?

quaint zealot
#

Hello guys. I'm drawing a material to screen using viewport client with HUD, and using movie player with Slate

#

(don't ask)

#

It works well, but both renders look a tiny bit off

#

The Slate one is brighter

#

Any idea ?

quaint zealot
#

Okay, it's a canvas issue - it doesn't use srgb apparently

quaint zealot
#

So the funny thing about drawing a material through the Canvas API (I know, I know) is that it will draw SRGB textures as linear.

neat smelt
main hedge
#

you mean umg? just check out how they do it

#

but actually don't, bindings are horrible and slow

leaden goblet
#

Hey guys

#

So with slate I can do GUI for plugins?

#

๐Ÿ‘€

low bluff
#

Technically,yes

#

@Agente Dog#7526

leaden goblet
#

@low bluff Do you know where I can find some good docs on how to do it?

#

I havent found good docs :/

low bluff
#

There are non

#

You can find one stream

#

From epic

#

And then you gotta look unto the engine on how the editor works

#

Best thing is checking paper2d plugin

leaden goblet
#

Paper2d?

#

Got it

lament marsh
#

Hi, I have an issue with slate not recognizing my font and outputting this. Any ideas how to fix this?

pastel basin
#

@lament marsh maybe that the text is in unicode?

lament marsh
#

@pastel basin Thanks for the reply. I'm a total newbie to slate. I'm using a ttf file.

pastel basin
#

yeah, but all fonts have ranges, and if the text is in unicode it may be encoded in a different range, generally that's not issue for latin characters, but it may be

lament marsh
#

Could it be the way I'm declaring it?

const FSlateFontInfo _fontinfo = FSlateFontInfo(FPaths::EngineContentDir() / TEXT("UI/Fonts/MyFont.ttf"), 16);

#

SNew(STextBlock)
.ShadowColorAndOpacity(FLinearColor::White)
.ColorAndOpacity(_loadingTextColor)
.Font(FSlateFontInfo(_fontinfo.FontMaterial, _fontinfo.Size))
.Text(this, &SAsyncLoadingScreen::GetText)

quaint zealot
#

Sounds like you're using a pretty old approach here

#

The all font info thing isn't required anymore

lament marsh
quaint zealot
#

I currently use this UPROPERTY(EditAnywhere) FTextBlockStyle Font;on a FSlateWidgetStyle type objet (any UObject, like UDataAsset, should do)

#

You can then do .Font(&AssetObject->Font)

#

Amusingly I was the one asking in that AnswerHub thread ๐Ÿ˜›

#

And that was 5 years ago - this isn't the way anymore

#

The really simple and no-bullshit way today is to have an UDataAsset class with whatever style settings or font object you want, create such an object in content browser, reference it in your code through the Asset Manager

#

You can then just pass the name / path of your asset to widgets you build

#

SNew(SCustomButtonClass).StyleAsset("/Game/UI/MainButtonStyle");

#

In any case, let a content asset hold the font for you, don't load it from a TTF.

lament marsh
#

Awesome, thanks. I'll give that a shot.

quaint zealot
#

There's an entire style system in Slate, too

#

I officially use it, I guess, but... really I don't even need it and I could just use my asset manager interface class (that basically searches all UDataAssets at boot time and has nice lookup functions for them)

lament marsh
#

Ok, yeah it sounds like the datasset will definitely do for me. I'm just trying to set a font.

quaint zealot
#

The important part is, assets that you create in the content browser to hold content is the safest approach

#

That makes them packaged, loaded, searchable programmatically in a generic way

#

Whether you use data assets or Slate styles is pretty much the same thing AFAIK

void smelt
#

Hi everyone! Is there a way to hide/show properties depending on some condition (enum for example) in details?

quaint zealot
#

Yes

#

meta = (EditCondition = "bMyBool")

#

That only disables, but look into the other metas, there's probably one to hide

void smelt
#

I don't need bool in properties. I need something like enum list where I choose some type and depending on that type some properties are appeared or hidden

quaint zealot
#

Then you'll need to look at something more involved

void smelt
#

Okay, thanks ๐Ÿ™‚

void smelt
#

So. I have UMyClass. In this class I have TMap<FName, FMyStruct> SomeMap. In FMyStruct I have EMyEnumType and other properties like float Property1, float Property2. How do I access EMyEnumType in CustomizeDetails function and hide/show Property1 or Property2 depending on EMyEnumType on every FMyStruct instance in SomeMap?๐Ÿ™‚

toxic dove
#

for hiding some properties

#

you can bind to the details view's IsPropertyVisible delegate

#

there is one for allowing editing as well

sturdy shale
#

does anybody know a good example of how to use tabs?

toxic dove
#

just use the widget inspector and inspect any of the editor widgets and read their classes

#

find one you like

sturdy shale
#

yeah, but that doesnt explain how those classes work

#

;/

toxic dove
#

what do you mean?

#

the code will tell you exactly how?

#

oh you mean how to actually create the widgets and display then

sturdy shale
#

yeah its not super intuitive

#

especially when you have like super deep hirarchies of widgets^^

toxic dove
#

just break into the construct of a widget, and then read code

sturdy shale
#

like for example, I cant figure out how SDockingTabStack works

toxic dove
#

read the callstack

sturdy shale
#

or if it even is what I need

toxic dove
#

unfortunately extending the editor is not something that is readily accessible in the form of a neat guide, because honestly the best tutorial is just reading the engine code. break into one editor window you like and climb the callstack and investigate how it ends up being spawned

#

and then you can start making cool tools like these for your designers!

sturdy shale
#

that looks neat ๐Ÿ˜„

toxic dove
#

i really dont remember which editor window i read to start this up

#

maybe it was the blueprint debugger out of all things

#

this one

#

go look how its made

sturdy shale
#

never even knew about this window

#

thx

#

so FTabManager seems to be responsible for them tabs

toxic dove
#

yes

sturdy shale
toxic dove
#

hurray

sturdy shale
void smelt
#

@toxic dove thanks. Will try that.

earnest gyro
#

@sturdy shale looks like you didn't register your tab spawners

sturdy shale
#

yeah it idnt re register them after closing the window

sturdy shale
#

If I wanted to have my own Widget for an Editor Window, would I create the containing NomadTab inside that widget aswell?

graceful trench
#

Hey, are there any decent slate tutorials/examples? I am trying to figure out couple things and so far it is giving me nothing but trouble, currently trying to create a ComboButton MenuContent and things are just not working out for me :/ (fails to compile)

maiden talon
#

there's no real good examples or documentation on slate unfortunately, the best advice I can give you is to look at engine source code

graceful trench
#

been there ... I did use a menubuilder in a past for a small thing but that thing just does not want to work here

#

I will take bad examples...but complete ones as well ๐Ÿ˜„

fierce orbit
#

Hey guys.. I'm new here, and i thought maybe there is help to be found. SO ... I want to animate the alignment of an SConstraintCanvas slot ... is that even possible. If it is i have no clue how to reference that slot... SConstraintCanvas::AddSlot returns the slot but like i said.. i have no clue how to reference it properly

supple hinge
#

hello, i was able to use a userwidget as a SWidget for the movieplayer to display a loading screen. The problem is that the script i did in the umg widget to do . .. ... over time doesn't work. i believe that is because umg uses the game thread and the movie player uses the slate thread so it doesnt run the script. Is there any way of doing this without having to use slate?

graceful trench
#

Hey, just a quick one... I have a SDockTab and inside it SBox, and in it SVerticalBox... in the Vertical box I have SScrollbar but that does not want to scroll as it stretches beyond the boundaries of the available window space the SDockTab provides. Trying to set fill where ever I can but the thing is still overflowing...

#

Any hints would be greatly appreciated ๐Ÿ˜„

#

I can share the code but it is a bit messy at the moment ๐Ÿ™‚

graceful trench
#

So my best guess at this moment is that the expandable area has no idea how big its content is so it just kind of overflows ๐Ÿ™‚ which is unfortunate but what can I do ...

lethal kite
#

you can force any textblock to minimum desired size

#

regardless of text inside it

shut goblet
#

Is there some way to get buttons to just be flat colors without any border effects? If i set it to image with "None" it seems to use a border image anyhow

toxic dove
#

yes you have to specifically give it a button style, otherwise it will fallback to the default

#

does anyone know how to get the mouse position when there is a drag-n-drop operation occurring? you cant get it through the player controller anymore during a drag-n-drop

maiden talon
#

are slate widgets you make with SNew or SAssignNew automatically garbage collected when the owning widget is closed?

quaint zealot
#

No, the garbage collector only works on UObjects

#

However, Slate uses smart pointers everywhere

maiden talon
#

but e.g. can you call SNew without assignin the result to anything and it will be cleaned out of memory?

#

cause for AssignNew I use smart pointers as well so I assume that is safe memory wise

quaint zealot
#

It will be cleaned out, yes.

maiden talon
#

ok cool

#

how could I focus a SSearchBox upon it's creation

quaint zealot
#

FSlateApp::SetAllUserFocus

#

Or something

maiden talon
#

or is it cause it's a weakptr instead of shared

#

ok shared ptr doesn't seem to crash

#

but it's still not getting focus it seems ๐Ÿค”

maiden talon
#

got it working, needed to be delayed one frame

quaint zealot
#

Or you can call the slate prepass

#

And it might work the first frame

maiden talon
#

so I made a details customization for a custom type

#

but when they're in an array, they don't have the delete insert duplicate button

#

I found the DetailPropertyRow does it with PropertyEditorHelpers::MakeRequiredPropertyButtons

#

which in turn uses PropertyCustomizationHelpers::MakeInsertDeleteDuplicateButton

#

but idk how to know if my object is in an array or not, and how to get the array that it's part of

#

or do I somehow need to make a detailscustomization for the array of the type as well

tall axle
#

Hi All, I've created a Slate window with a UMG widget. all is working fine, but when I resize the window it just stretched everything. I'm sure there must be some kind of redraw or re-render function, but I can't seem to find it.
Any suggestion on how to not stretch the content of the SWindow when resizing?

warm vault
#

@tall axle Have you tried changing your DPI scaling inside ProjectSettings?

warm vault
#

what do we use to create a table-like view?

#

SListView along with SMultiColumnTableRow as table rows?

main hedge
#

why wouldn't you use the actual STableView?

warm vault
#

Because when I googled for it, I didn't find anything ๐Ÿ˜‚ I couldn't find the class in engine code either. I will search again, seems like I was careless in my search

#

there are only STableViewBase and STableViewTesting :/ are you sure that STableView exists?

#

sorry but I think the only table views there are, are SListView, STreeView and STileView?

low bluff
#

What's the issue with using the Base version?

rigid hull
#

can someone help me with drag drop operations? drag visual blocks everything until it ends. i need to capture ondragover but it wont happen at all.

warm vault
#

@low bluff its abstract

warm vault
#

what do we do to fix visual studio's code formatting for Slate code?

#

or does everybody just live with it?

maiden talon
#

I just live with it

spring frost
#

I embrace the chaos

main hedge
#

I format it manually br_egg

maiden talon
#

the worst is when you want to change it to another function or something and copy past it and your formatting is gone again ๐Ÿ˜ฆ

main hedge
#

press ctrl z

placid scarab
#

cry

pastel phoenix
#

slate code is just a style, you can not use it

#

instead of + SCanvas::Slot() you could use canvas->AddSlot();

#

etc

#

everything is replacible by normal c++ code

quaint zealot
#

And you often need to

warm vault
#

i see

#

ok xD

dry wren
#

Its really irritating

warm vault
#

dont try to reference a style that doesnt exist

warm vault
#

Whyyy

#

whyyyyy did no one tell me about PropertyCustomizationHelpers much sooner

royal geode
#

@warm vault WHYYYYYYYYYYYYYYYYYYYYYYY

#

well I think at that point I already reimplemented most of them in my own helpers ๐Ÿ˜ญ

warm vault
#

i feel you man xD

#

FPropertyEditorModule provides some nice tools to create slate widgets for properties as well

#

anyway, life got a lot easier after learning how to use all the helpers hidden in the engine

warm vault
#

Does anyone know how to draw the draw material function of the hud class over a widget? There is no Z-Order and the widget is drawn on top of it

pastel phoenix
#

may be you should draw to texture, and integrate texture in widget

exotic isle
#

stupid question but: are the editor built-in widgets (like SClassViewer) not usable in our own code? I see them in Private folders most of the time...

#

or SPropertyEditorAsset which seems super useful

pastel phoenix
#

if they are in /Runtime/ they are usable

exotic isle
#

@pastel phoenix even in an editor module and even if they are in a Private subfolder?

pastel phoenix
#

editor module is not in Runtime. private - no

exotic isle
#

arf too bad ๐Ÿ˜ฆ thanks for the help !

#

ah my bad

#

I meant even for use in my editor module

#

not if the widget I'm interested in is in an editor module

#

for instance, if I have an editor module in my game, and I need something in Runtime/Private, will it work? I've got lots of errors at compile time but beginning with Slate and it could come from anywhere as far as I know with my knowledge ^^'

pastel phoenix
#

you could use editor module in developement, but you can't include it is shipping build

#

did you tried make shipping?

exotic isle
#

ah yes indeed, I don't want my editor module to package, it's juse for use by designers in the editor

pastel phoenix
#

aah, ok

exotic isle
#

no it's at compile time in development editor

#

trying to use SPropertyEditorAsset to have a nice actor picker

#

I switched to use the helper methods but did not manage to make it work for now

warm vault
#

yeah you should use the helpers if you want to edit it inline, but you can also use the SClassPickerDialog

#

just search the engine for uses of SClassPickerDialog and you will get it how to use it

#

the only thing less obvious about this is the fact, that you need to implement your own class view filter by implementing the IClassViewerFilter interface. the interface is public, but all implementations you will find for this interface are private. the class viewer module uses the interface though.

#

@exotic isle

exotic isle
#

thanks @warm vault ! ๐Ÿ˜„ I will look into it. I tried to find usage of SClassPickerDialog but I must I've missed something in my research as I did not find anything. Will try again

warm vault
#

you can search for references

exotic isle
#

good idea it may work better than search in global solution

warm vault
#

did you do a text based search ๐Ÿ˜ฑ

exotic isle
#

well sometimes it works better than intellisense ^^'

snow umbra
#

Hi guys - I've just upgraded my project from 4.19 to 4.23 and this image swap has stopped working. Is it wrong or a bug? Anyone got any ideas? PS it's not because of the big jump in versions cos I did it first to 4.20 and same thing happened

woven zealot
#

Hello, how can I render just chosen widgets to same render target?

jagged jewel
#

Hello. I placed my hardware cursor called cursor.cur inside a "Slate" folder inside my content folder. I adjusted the hardware cursor path inside the project settings to "Slate/cursor" and it's not working. What am I missing?

#

output log gives me this error:

#

Ok i got it working. Appearantly the cursor can not be named cursor. Changing the name to cursor_sword fixed it ๐Ÿคท

#

Anyone know why? Is this a name reserved by the engine or something?

warm vault
#

i think it should be cursor_64x64.cur or something like that to really work as expected

#

at least if i interpret the error message right @jagged jewel

low bluff
#

The error basically says that _64x64.cur stuff needs to be removed:P

serene eagle
#

I guess the solution says more about the problem than the error by itself. Because WixZ wrote that there is no suffix like _64x64 and he fixed it by adding _sword I think he's right with the assumption that cursor.cur is already reserved by unreal engine

warm vault
#

nah i think UE4 expects the cursor name and then searches for the right cursor by adding the _WidthxHeight and file ending ๐Ÿคท๐Ÿผ

serene eagle
#

But error message said that there shouldn't be a file suffix like _WidthxHeight and he only added _sword as name appendix not as information suffix

warm vault
#

i assume it ignores everything beyond the _

unkempt locust
#

how would I go about Adding a EditorWidget to be Launched inside of a SDockTab?

#

Is that possible

#

?

serene eagle
#

@unkempt locust what do you mean by EditorWidget you mean like an SListView or SButton inside of SDockTab?

unkempt locust
#

Well i'm working on launching a EditorWidget seperately. Was going to try and launch it into a Tabbed window

#

I just can't seem to figure out how todo it properly

serene eagle
#

@unkempt locust but I don't know exactly what you mean with EditorWidget. If you have a SDockTab you can spawn buttons and stuff in it, but I don't know what you want to spawn inside the Tab when you use the word EditorWidget.

unkempt locust
serene eagle
feral needle
#

How would I go on by extracting the Swidget from UUserWidget

#

to use with FLoadingScreenAttributes::WidgetLoadingScreen

feral needle
#

Oh shit didn't realize this was a thing

#

thanks

severe shard
#

Is there a way to have a moving material on slate?

quaint zealot
#

Yeah, use a time parameter and drive it from tick

severe shard
#

@quaint zealot Ok, thanks. I'll give that a shot.

main hedge
#

is it possible to distribute a slate app as a single binary (with resources for the style included) ?

severe shard
#

Can I extract a materialinstancedynamic from a FSlateDynamicImageBrush?

I have found GetSourceObject, but that seems to only work with UMaterialInterface.

quaint zealot
#

@main hedge You mean like the Epic launcher ?

#

Basically make an UE game with just Slate UI in it

#

Well, you're not getting single-file though, sorry

low bluff
#

@main hedge Pretty sure Allar made a pure Slate app once, which was not directly a game but more in the sense of other standalone apps like the UnrealFrontend. Is that what you mean?

quaint zealot
#

Probably, but Slate resources still need to be UE4 resources that go in a pak

low bluff
#

Right, so it wouldn'T be a single file

severe shard
#

I'm looking at the Helium Git example in order to figure out how to play a video, but it doesn't seem like they are actually using videos for anything. The only thing I could find was on:

https://github.com/arbonagw/HeliumRain/blob/858d786b53a9d05c0c6a90b84ef7086173f04fb8/Source/HeliumRainLoadingScreen/FlareLoadingScreen.cpp

I'm doing this in my slate code, but I only get a 10 seconds black screen in editor and build.

        LoadingScreen.bAutoCompleteWhenLoadingCompletes = false;
        LoadingScreen.MinimumLoadingScreenDisplayTime = 10.f;
        LoadingScreen.MoviePaths.Add("LoadingScreenPlayer_Video");
        GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
        GetMoviePlayer()->PlayMovie();```
quaint zealot
#

No, we 're not using video for anything.

#

Just that SFlareLoadingScreen Slate widget in the file you linked, which is a simple throbber under the game title

spring frost
#

@severe shard Are you creating a loading screen from a video?

#

What resolution is the video?

#

I remember something about Videos need to have an odd resolution. Like instead of 1080p it has to be 1088p in order for it to appear.

#

Dont ask me why, i cant remember haha

paper hamlet
#

like one section of a radial menu

#

or even just a radial menu to start with

#

sorry for asking i'm sure there are posts out there but i can't find anything with the forums being down

#

if i wanted to attach it to a UWigdetComponent i has to inherit from UUserWidgetComponent

low bluff
#

You usually make these shapes outside of UE4 in your 2D application

#

And then you import that.

#

You can then calculate which option to highlight/select based on the mouse position

paper hamlet
#

what about dynamically resizing them based on how many items it has

main hedge
#

a radial menu can be done with a material

#

convert pixel position to radial gradient and check if you're within some angle

paper hamlet
#

ok i'll try that

#

thanks

severe shard
#

@quaint zealot I see, but thanks for putting up the code so we can have an example project.

@spring frost Yeah, it's 1920x1080. Hm, I wish there was more official information out there than just the bare basics on how to make a static loading screen, especially when it comes to weird settings like that.

spring frost
#

Try changing the res to 1088 and see what happens

#

Not sure if its a bug or design choice or something weird.

#

๐Ÿคท

severe shard
#

I'll give it a try, thanks.

polar cedar
#

Hello! Guys

#

Any ideas how to make editor context menu for RMB in the level viewport?

ivory adder
#

Hitproxy, catch click, create menu?

pastel phoenix
#

bool MyInputProcessor::HandleMouseButtonDownEvent(FSlateApplication& SlateApp, const FPointerEvent& MouseEvent)

full fox
#

any idea why retainer box with RenderOnPhase turned off keeps rendering container? Especially calling SlatePrepass

craggy holly
#

IIRC RenderOnPhase means render it at discrete intervals. if you turn it off, it re-renders every frame if it's invalidated.

#

If you're calling SlatePrepass manually won't it invalidate the geometry and force the whole thing to re-render anyway?

#

Oh I'm two days late. wups

nova nacelle
#

is there a way i could get an owner if UProperty? in terms of IPropertyHandle

#

right, just figured it out myself, there's GetOuter

nova nacelle
#

how can i get some kind of global SWidget to use in FSlateApplication::PushMenu?

#

the closest real SWidget i have is NameContent/ValueContent from FDetailWidgetRow. they don't work though, always reference some invalid widget for some reason

#

or, a little bit different question, doing struct customization where can i get any actual SWidget to have as parent?

nova nacelle
elder zealot
#

Hey everyone. I'm stuck on a problem and thought maybe someone can offer a suggestion. I have a textbox with text too big to fit. In a normal situation I'd be happy with a scrollbar and call it a day. However, this time I want to use an additional textbox and split the text into pages. Both are of the same size. So my logic is this: Take one textbox and check initial text. If it's too large, split it and perform the same action recursively on the bits that were split. Logic sounds solid but I'm stuck at the 'checking if text doesn't fit box' part.

Anyone knows how that is done? I keep digging through code but I can't find anything of the sorts so far. Thanks!

#

SScrollbox should contain the answer I'm guessing, since it has the option to display the bar when the content is too large. Will come back if I find anything relevant.

warm vault
#

Could anyone help me with figuring out how to get a Widget to show on screen when i press a button.... and when i press the same button....it will also be dissapear

pastel phoenix
#

make your InputProcessor class

#
bool MyInputProcessor::HandleKeyDownEvent(FSlateApplication& SlateApp, const FKeyEvent& InKeyEvent)
{
    FKey key = InKeyEvent.GetKey();
    AMyPlayerController* playerController = GetPlayerController();
    AssertRet(playerController, false);
    if (key == EKeys::Escape)
    {
        if (playerController->isIngameMainMenuOpened())
        {
            playerController->closeMenu();
            return true;
        }
        playerController->openIngameMainMenu();
        return true;
    }

something like this

#

then in controller you must create and destroy widget by

    mWidget = SNew(MyWidget);
    GEngine->GameViewport->AddViewportWidgetContent(
        SNew(SWeakWidget)
        .PossiblyNullContent(mWidget.ToSharedRef())
    );

and

    if (mWidget.IsValid())
    {
        GEngine->GameViewport->RemoveViewportWidgetContent(mWidget.ToSharedRef());
        mWidget.Reset();
    }
#

and you need also make a function to turn on and off mouse

woven zealot
#

Hello, how can I render slate/umg widgets faster then 8 fps?

tame granite
#

is there a way to debug slate hit test regions, something that will show a translucent overlay of them or something?

#

in editor or pie in new window, my mouse clicks are offset by 60 pixels or something, but in editor builds launched with -game they are fine

low bluff
#

Something other than the WidgetReflector?

#

@tame granite

tame granite
#

things looked ok in widget reflector, I didn't know if the shapes there represented the hit box or some kind of render bounds or something

pastel phoenix
#

try to change screen size and watch how mouse click offset will change

#

may be it i s just DPI scalling

mild oracle
#

I'm trying to use a material with buttons. I want to be able to update a parameter on my material instance when the player mouses-over a button. But the only way I can think to do this is to create a new Material Instance on every single button and update that material. Isn't this a huge waste of memory? Are there smarter ways?

wary steeple
#

@mild oracle That sounds right to me. There are global material properties if you want all material instances in each button to react at once

mild oracle
#

I'm going to try to do a pooling system so every single one of my buttons isn't creating a new dynamic material instance

#

Seems kind of weird that this is so difficult though

wary steeple
#

Having a material instance per button seems like the right thing to do and I don't think material instances are perf heavy, depending on the material

#

You likely won't have to do any kind of performance wrangling unless you have hundreds of buttons drawing all at once

mild oracle
#

@wary steeple I was mainly worried about every time a button gets created, we have to create a matinst and deal w it. I can easily have 30-50 buttons on-screen

ancient wigeon
#

Hey, have you guys tried to get rid of automatic game pause when dragging viewport window or scaling it?

#

Would like to disable that especially for server

brave cape
#

Hey all. Stuck on this right now. I have a UWidget in the world with Slate components inside and I can't figure out how to get mouseover events on in-world things behind this UWidget... all the slate components are HitTestInvisible and I haven't found anything on the UWidgetComponent that looks like it would help -- any hints?

#

solved it... was collision-related... stupid

#

should have checked that first

#

๐Ÿ™‚

severe shard
#

When using:

.Font(FSlateFontInfo("SomeFont", 30))

Does the font file have to be in a specific folder? It doesn't apply the font for me, but the size changes just fine.

severe shard
#

I was able to fix the font problem, but I have a different question. Has anyone ever successfully used a MaterialInstanceDynamic to update a material in tick in a slate widget?

maiden talon
#

I've done it in a tick, not in a slate widget though

quaint zealot
#

Yes @severe shard

severe shard
#

@quaint zealot Ok, so it is possible then. I must be doing something wrong. The material is properly showing on screen, but it won't move, even though the breakpoint does hit tick as it should and even updates the value.

quaint zealot
#

It's probably updated and you've not shown the correct material

severe shard
#

    LoadingInstance = UMaterialInstanceDynamic::Create(_loadingScreenMaterial.Get()->GetMaterial(), OwnerHUD.Get()->GetWorld());

    loadingBrush = new FSlateMaterialBrush(*_loadingScreenMaterial.Get(), FVector2D(100.f, 100.f));
    loadingBrush->SetResourceObject(_loadingScreenMaterial.Get());
#
        .HAlign(HAlign_Fill)
        .VAlign(VAlign_Fill)        
        [
            SNew(SImage)
            .Image(GetSlateBrush())
        ]
#
{


    if (LoadingInstance != nullptr)
    {
        time += InDeltaTime;

        LoadingInstance->SetScalarParameterValue("Time", time);
    }
}

FSlateMaterialBrush* STestSlateWidget::GetSlateBrush() const
{
    return loadingBrush;
}
#

That's my setup. LoadingInstance is a UMaterialInstanceDynamic

#

_loadingScreenMaterial is a UMaterialInterface

#

Does anything jump out as an obvious issue why it doesn't update?

quaint zealot
#

Nothing shocking I think

#

What's LoadingInstance ?

#

Should be _loadingScreenMaterial ->SetScalarParameterValue("Time", time);

#

AH sorry

severe shard
#

It's a UMaterialInstanceDynamic

quaint zealot
#

I misread ๐Ÿ™‚

#

Here's your issue

#

loadingBrush = new FSlateMaterialBrush(*_loadingScreenMaterial.Get(), FVector2D(100.f, 100.f));

#

Should be LoadingInstance

#

Not the source (unchanging) material

#

Also '*stuff.get()' is just 'stuff' AFAIK

severe shard
#

Ok, I'll give that a shot, thanks.

#

I was using Get(), because it's a TWeakObjectPtr

quaint zealot
#

Should work anyway ?

severe shard
#

Awesome it's moving now, thanks.

I'm not sure about the get.

If I remove the get out of this for example: _loadingScreenMaterial.Get()->GetMaterial()

I can't use GetMaterial().

quaint zealot
#

What's _loadingScreenMaterial in the first place ?

#

I specifically meant that '*_loadingScreenMaterial.Get()', and nothing else, should just be _loadingScreenMaterial

#

Anyway if it works, it works

severe shard
#

It's a TWeakObjectPtr<UMaterialInterface> _loadingScreenMaterial. It seemed to be recommended to use weak object pointers.

tribal fractal
#

I'm trying to create list of assets (UObjects) with selected asset details panel. Anyone know where I can start searching for how to get UObject array from content browser?

quaint zealot
#

Are you looking for all content assets ?

split laurel
#

You want to edit your assets? So basically you want to work on the class default objects right?

tribal fractal
#

@quaint zealot - just my UClass. Trying to get this working using AssetRegistry but can't find my assets.
@split laurel - yes, exactly.

quaint zealot
#

What's your class inheriting from ? What's the purpose ?

tribal fractal
#

UObject. I'm trying to create items editor which will search for items (UObjects) and user would be able to change their properties in one place without searching for items in content browser.

quaint zealot
#

Use UDataAsset

#

Put them in content browser ina folder, done

split laurel
#

if you have assets in the content browser you should be able to find them via AssetRegistry. How are you using the AssetRegistry?

quaint zealot
#

They're not assets.

tribal fractal
quaint zealot
#

Dataasset allows it too IIRC

tribal fractal
#

was trying using StaticClass() but still can't find them.

#

but when I'm searching for UBlueprint (like SClassViewer does) it finds my assets but with bunch of other

split laurel
#

@quaint zealot for me it sounds like he is looking for assets though?

tribal fractal
#

yes, those UObjects (each item) is in content browser

split laurel
#

if you are looking for specific blueprint classes that's a tad more difficult

quaint zealot
#

UObjects are not assets

tribal fractal
split laurel
#

but his UObjects are assets

quaint zealot
#

They're not "assets"

#

Not for UE

#

They're just objects

split laurel
#

if they are in the content browser they count as assets to me

quaint zealot
#

As classes, or content ?

#

As content = asset registry finds them

#

= assets

#

as classes = not assets

split laurel
#

apparently they do get found with asset registry

quaint zealot
#

They don't

tribal fractal
#

guys, above function find them

quaint zealot
#

Ah, well

split laurel
#

..xD

tribal fractal
#

but can't filter them with my class

#

I still get all blueprints etc

split laurel
#

yeah blueprints are a bit tricky since they all share the same 'class', which is Blueprint and not the class they inherit from

#

you have to access the blueprint's generated class and test that

tribal fractal
#

filtering used 2 image above isn't working for my exact class but with others (which are based on UObject) is

#

for example UNiagaraParameterCollection can be found using GetAssetsByClass

#

but my UGDInvItem wont ๐Ÿ™‚

#

and I don't see any differences from collection and my class - they use the same macros etc

split laurel
#

so you have a C++ class UGDInvItem, you create Blueprints inheriting from UGDInvItem and want to find only those right?

tribal fractal
#

yes, exactly

split laurel
#

yeah ok let me take a look in my code, done that before

tribal fractal
#

which GetAssetsByClass is used for, but not working for my class

quaint zealot
#

Just loop over the result with IsA(UGDInvItem::StaticClass())

split laurel
#

I don't think that works with blueprints

tribal fractal
#

yes I can do it but I don't want to

#

trying to learn something here

#

๐Ÿ™‚

quaint zealot
#

It works with everything

#

GeneratedClass for BP

split laurel
#

yeah with generated class it does

#

but I think you'll have to loop over them

#

Blueprints are kind of an exception

tribal fractal
#

ok then, will loop

#

thanks guys, will be asking while working on it. Want to use property editor to list the assets and be able to change their variables using property matrix

split laurel
#

sure

tribal fractal
#

damn I see that I need to load them to check if they are my class

#

FAssetData is just info where it is

#

no defaults object or something

#

maybe I can filter them using name - will check what's in that structure

split laurel
#

good point, I'll have to think about how to handle that with my tool too because currently Im looping over them

tribal fractal
#

as asset class is Blueprint

split laurel
#

the TagsAndValues map? niiiice that's good to know

#

going to rewrite my code asap

tribal fractal
#

yes, TagAndValues - will paste my code when finished

split laurel
#

with my current batch renaming tool I did the mistake of loading all the assets before actually renaming them lol. Anyone know if there is a way of renaming assets without actually loading them? Probably not?

tribal fractal
#

This is working but I'm not sure yet if it's good approach.

FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));

// Retrieve all blueprint classes 
TArray<FAssetData> BlueprintList;
TArray<FAssetData> ItemsList;

FARFilter Filter;
Filter.ClassNames.Add(UBlueprint::StaticClass()->GetFName());
Filter.ClassNames.Add(UBlueprintGeneratedClass::StaticClass()->GetFName());
Filter.bRecursiveClasses = true;
AssetRegistryModule.Get().GetAssets(Filter, BlueprintList);

for (FAssetData& BPAssetData : BlueprintList)
{
    UClass* ParentClass = nullptr;
    FString ParentClassName;
    BPAssetData.GetTagValue(FBlueprintTags::NativeParentClassPath, ParentClassName);
    
    if (!ParentClassName.IsEmpty())
    {
        UObject* Outer = nullptr;
        ResolveName(Outer, ParentClassName, false, false);
        ParentClass = FindObject<UClass>(ANY_PACKAGE, *ParentClassName);
        if (ParentClass->IsChildOf(UGDInvItem::StaticClass()))
        {
            ItemsList.Add(BPAssetData);
        }
    }
}
split laurel
#

not sure about performance of FindObject

#

but for now I guess it doesn't hurt to try

tribal fractal
#

now I need to get pointer to that UGDInvItem - default object using FAssetData

split laurel
#

yup, you can access the BlueprintGeneratedClass' function GetDefaultObject

tribal fractal
#

hmn how? I just have FAssetData currently

#

got it. Have MutableDefault. Can move to property matrix.

tribal fractal
#

is there any way to tell if property was created in blueprints and not in c++ using UPROPERTY?

split laurel
#

you are moving fast, did you just add the property matrix or is that custom UI?

tribal fractal
#

I'm using property matrix - don't want to create my editor for this, to much work

#

now I'm working on how to add colums for properties created in Blueprints and marked that they should be added to etir

#

*editor

#

to show selected item details I need to use IDetailCustomization or there is some SWidget that can be used instead? Just pass Property into it.

split laurel
#

you mean a details panel? There's a function that creates it for you and you just need to pass in the UObject

tribal fractal
#

yes, exactly, any chance you can check where I can find this function?

split laurel
#

FPropertyModule CreatePropertyView or CreateDetailsView, I'm not sure which one is the correct or most adequate one rn

tribal fractal
#

well can't find FPropertyModule in ue4 4.23 ๐Ÿ˜„

split laurel
#

sorry, FPropertyEditorModule

tribal fractal
#

damn, Epic did a lot of job with slate... was able to create simple items editor in like 4 hours.

split laurel
#

yup I love Slate :-) just browsing through all of that engine code to find the function you need for your tool and bam, it works

tribal fractal
#

I was working with slate like 3 or 4 years ago and wasn't so great then ๐Ÿ˜„ maybe I was just not skilled enough ๐Ÿ˜›

serene eagle
#

slate is very powerful but documentation is less than existent. Even if you go through source code sometimes struggle to how a Slate Widget works properly. It's a lot of try and error. Had to learn a lot about the framework before I could work in it in any kind of a decent way.

split laurel
#

btw one suggestion, your tools is a really great idea. How about making use of a class filter on top that refreshes the list when being updated?

#

that way you could filter directly for whatever type of class you want

#

want to edit all potions? Go ahead. Edit all collision blueprints? Go ahead!

#

also yes Slate is a pain at first, but learning with source & trial and error will teach you more than some docs ever would imo. But some references for many common use cases would be nice indeed

serene eagle
#

if you figured out how slate is designed it's much easier and more easy because like the most widgets are same in how they are designed and there aren't a lot of special cases.

tribal fractal
#

@split laurel yes, I'm doing it right now, will change categories as well when changing item type.

split laurel
#

niiiice ๐Ÿ’ช

willow salmon
#

What sort of slate widget should I be using for drawing graphs?

#

Do I need to just use SImage with a texture that I build as a bitmap, procedurally on the CPU, or is it easier to use these things like FSlateDrawElement::MakeLines()?

tribal fractal
#

I'm trying to load async my items (testing 10k items for performance) and maybe someone know how to use FStreamableManager to have delegade when one item or less was loaded? There is only delegate when finished everything. I want to populate items list while async loading assets.

split laurel
#

@tribal fractal you should be able to register to AssetRegistry with the delegate 'OnAssetAdded', which gets called for every asset while discovering afaik. There are tons of engine assets though that you will not want to handle

#

that is if you are talking about at engine startup. On second thought, that's probably not what you mean right? You just want to load 10k assets

tribal fractal
#

I have created lambda and have the callback, but I can see that FStreamableManager is loading to much data

#

like 1GB for 10k items.

split laurel
#

hmm dunno about that, but tell me if you find out about it. My renaming tool right now needs about 5 seconds to populate 60k assets

tribal fractal
#

and I need to use FAssetData::FastGetAsset(true); to be able to add it to property table, and doing this way while having 10k items take a lot of glitch but isn't creating that memory

#

5 seconds for 60k assets sounds cool ๐Ÿ˜„

split laurel
#

it's not loading them.. just creating lots of structs based on fassetdata :D

tribal fractal
#

hmn AssetData uses LoadObject and StreamManager StaticLoadObject

#

maybe here is difference

#

if I won't be able to find solution will do this other way: just do search and pages to load 100 items per page.

split laurel
#

Yeah, you could have a timer trigger every 0.5 seconds or so that gathers the currently available assets

#

it wouldn't be 100% smooth but probably smooth enough

tribal fractal
#

well streaming is working OK for me, BUT why it's taking so much memory ๐Ÿ˜

split laurel
#

maybe thats just what happens when you load 10k assets

tribal fractal
#

yea, trying to find a way to use FAssetData without using GetAsset

split laurel
#

yeah, you could list all the assets without their details first, just the names, and load them when clicking on them

#

although that would disable the advantages of the property matrix

#

seeing all values at once

tribal fractal
#

I can load assets that are visible

#

will try that