#edited for formatting

1 messages ยท Page 1 of 1 (latest)

lost raptor
#

sec, reading

#

I had a very similar case but I'm trying to remember what the hell I did

Looking through the project

#

Yeah, so if a type has new action reregistered, it removed anything else registered before for it

So yeah it overrides it

#

all of it expects a specific base class

#

both the factory and asset actions

#

I had a very similar case and I ended up going the custom button route with a custom dialog, etc... that creates the asset

#

SClassPickerDialog::PickClass is exported

lost raptor
#

(sorry had to remember what I did, been a while since I looked at this code)

yeah, tho I registered it in the folder context menu

So there is an option when you right click a folder

And from there just ran the class picker and use the result to create the asset

You could also if you want a fancy dialog have a UObject with FDirectoryPath and TSubclassOf<> as upropeties and have an SWindow with a details view and instance of the object, so you can use that object as a "settings object"

So you can have the devs select the path and class without going through class/path pickers

That's what I did here, that Blueprint selection is an embedded details view viewing a custom settings object

#

Np ๐Ÿ‘Œ

#

tho I think if you want it to show up in the normal asset creation menu, you could maybe do it

Make a dummy UObject class literally used for nothing but to just register type actions and a factory

In Factory::ConfigureProperties run SClassPickerDialog::PickClass to select a custom type
And in the FactoryCreateNew use that saved class to create the object

As far as I can see nothing checks (from my quick search at least) if the created object is of the same class as what the factory is supposed to support (I haven't tested this but it looks like it might work)

#

you can display whatever you want in ConfigureProperties

#

Oh yeah I see what you mean

#

I'm kinda leaning more towards a custom button
Because this is hacky

#

just something I thought of just now so wanted to share it ๐Ÿ˜†

lost raptor
#

Lol

So the idea is working?

#

Nice, luckily the editor doesn't check if the created object is of the same type as what the factory supports ๐Ÿ˜†

Tho should be possible to mimic the class picker
A simple version would be to iterate the classes derived from a class you care about (which would only really work reliably for native classes) a populate a custom widget

#

Well outside the factory I mean
Everything to get it to work is luckily exposed and overridable