x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to create a slate widget for a UProperty of a UClass without the object instance

I have the need to make a slate widget for a graph that allows me to see the UProperties of a UClass and to place a value for said UProperty.

I can't use the PropertyEditor since it seems to need the instance of the object, and I don't have that. I only have an UClass (Specifically a sub class, using TSubclassOf) and I can't make instances of it for various reasons.

I think I found in the blueprint structure editor an example of what I need (the default values table) but I couldn't understand how to replicate that.

Product Version: UE 4.20
Tags:
more ▼

asked Sep 19 '18 at 05:13 PM in C++ Programming

avatar image

Lazy_
22 2 3 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You are aware that you need to hold those variables somewhere in memory? And easiest way to do so is by making UObject of that class? There no way around it, either use UObject or reconstruct it's structure with UProperty data you have by different means (like array?). Blueprint editor probably editing Class Default Object (CDO) which holds default varables of class

https://api.unrealengine.com/INT/API/Runtime/CoreUObject/UObject/UClass/GetDefaultObject/1/index.html

But i would double check it in engine source code since just editing CDO might not only thing you need to do

more ▼

answered Sep 19 '18 at 10:16 PM

avatar image

Shadowriver
36.6k 931 169 1111

avatar image Lazy_ Sep 20 '18 at 09:54 AM

The thing is that I plan to create instances on the assets. Let me explain. I have an EdGraph for a custom asset, which is also a graph, and each EdNode represent a node in my asset graph.

If I create my asset nodes when I create the EdNodes I have the problem that when I copy/cut/paste/duplicate I don't know how to track the pairs (asset node, EdNode) and their informations to keep my asset graph consistent with the EdGraph.

So I thought to create my asset graph only when I save the EdGraph in my custom editor. So I didn't need to keep track of every single change between savings. I thought about destroying the asset and creating a new one for every single change made in the EdGraph, but that sounds stupid and I want to avoid that.

Your comment made me realize that I still don't know if the slate widgets will save the value internally our if they just take it from the objects. In the latter case I guess that I will just have to create and keep track of the asset node at all time...

avatar image Lazy_ Sep 23 '18 at 01:02 PM

Looking into the code I found out that you are supposed to use class FEdGraphUtilities to export the nodes into a text format and FPlatformApplicationMisc to save it into the clipboard.

That made way easier to copy and paste the EdNodes with an instance of the asset.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question