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"

Inheriting Widget Blueprints

The 'pick parent class' menu does not show up when you make a new widget blueprint, but you can still go to Blueprint Props and reparent it from a drop down menu. However, after doing this, the widget designer content is STILL EMPTY. And now, when i use the child widget in place of the parent one, nothing shows up. Using the parent one shows up fine. All i wanted to do is override some functions in the child, not even change the design. Adding a sizebox and adding the original inherited variable widget to it as a child also does nothing.

How do you properly inherit Widget Blueprints ?

engine version 4.6 preview

Product Version: Not Selected
Tags:
more ▼

asked Nov 28 '14 at 12:38 AM in Blueprint Scripting

avatar image

rajkosto
188 24 31 145

avatar image DannyKarp Feb 20 '15 at 02:01 AM

I am seeing the same thing. Will there be a way to do this in the future? I'm on 4.7 Preview Build at the moment.

avatar image John Alcatraz Apr 03 '15 at 08:57 PM

same problem here...

avatar image falola May 25 '15 at 09:13 AM

I would like to know as well (doesn't work with 4.9)

avatar image SuperDuperYeah Jun 29 '15 at 06:35 AM

Actually... trying to reparent anything at the moment in 4.8.1 causes an instant crash on my side. I can create a widget from an existing one but it won't show up in the "user created" list.

avatar image Chadvvick Aug 06 '15 at 08:07 AM

bump this. I'm trying to do the same thing for swapping out images that we use for text localization (stylized font only uses English letters, so we had to do everything with images). I was able to change the parent class and I binded all of the images to texture2D variables. The variables show up in the graph for the child, but nothing shows up in game when I try to create the widget and add it to the viewport.

If any of you guys have had luck or know of a workaround, please let me know. If I find a way to make this work, I'll do the same. Thanks

avatar image Smomo Nov 08 '15 at 03:07 PM

Same problem here, the function and variables can be inherited but WONT display on the Variables panel (You can get variables and call function by code).

BUT, the Design never inherited

avatar image Heroico May 08 '16 at 04:11 PM

Bump this! 4.11 (and 4.12 preview) and still no widget blueprint inheritance.

I am forced to duplicate and manually maintain the hierarchy by hand.

avatar image Bob3DGames Feb 01 '17 at 10:21 AM

I'm having the same problem. My code is a hideous mess as a result of this and having to manage two dozen duplicate widgets instead of some simple code that just casts back to the parent in order to set variables.

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

6 answers: sort voted first

You can definitely create a widget a child widget when you go to create a new blueprint. Right click in the content browser, select blueprint and then search for the name of your widget class and create new one deriving from it.

more ▼

answered May 08 '16 at 04:28 PM

avatar image

SuperDuperYeah
118 5 9 12

avatar image Heroico May 08 '16 at 05:08 PM

Well, I just tried this and things seem to be working.

(The trick is to try to create a "Blueprint Class", not a "Widget Blueprint")

Edit: Forgot to mention that the inherited designer is empty and you have to rebuild your UI's contents.

avatar image SuperDuperYeah May 08 '16 at 05:20 PM

Yep that's... the only downside. Which you know... I hope would be implemented at some point (getting all your widgets in when creating a child).

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

So here is what I got to work for mine. I'm not sure if this applies to your situation or not.

I created the regular UMG for our Main Menu and set up all of the functions that controlled the button presses and other options that the player can select in the UMG. I then created a second UMG and instead of using the drop down for the parent class, I deleted the Root Panel and then dragged the original UMG for the Main Menu onto the canvas from the "user created widgets" section on the left hand side in the designer palette. I was then able to access all of the functions from the original Main Menu UMG. For the items that I wanted to change out, in our case the text images that I am using for the different languages, I binded the images to a Texture2D variable. On EventConstruct in the second UMG (the one I wanted to make the changes to) I grabbed a reference to the pasted Main Menu UMG and set the specific images there. Changing out the different UMGs was quite a task, but I am able to swap between the two UMGs by selecting a language from the Main Menu.

I hope this helps in some way. If you would like, I can take screen shots of any of the parts of the process or UMGs that I am using

more ▼

answered Aug 08 '15 at 09:40 AM

avatar image

Chadvvick
21 1 3 8

avatar image Wallenstein Sep 29 '15 at 08:21 AM

Is this really the canonical way to derive a UMG blueprint from another? Sounds more like a workaround to me.

The reparenting in the File menu works now in Version 4.9 but still, when I show the widget screen, nothing shows up, it is as if there was no cahnge in parent class at all

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

still can't derive from Widget Blueprints properly in 4.10

but I might have found another dirty workaround:

  1. Make a duplicate of the original Widget Blueprint

  2. Change the parent class of the duplicate to the original you want to inherit from

  3. Witness loads of error spam about already existing functions and variables

  4. Repeat steps 5-8 for all functions:

  5. copy the graph (without the function-enter node) AND memorize where the inputs connect

  6. delete the function (in the functions list)

  7. override the function

  8. paste the function graph and connect inputs and exec chain

  9. Rename all the Elements in Designer which are also variables

  10. Replace all references to those elements in the Graph

  11. compile and enjoy

It's strange that the inherited widget blueprint works fine after that (can still edit in Designer) but it doesn't work at all when you make a new class that inherits from another like it's supposed to be. Might be a minor Bug that causes major problems.

more ▼

answered Dec 01 '15 at 11:57 AM

avatar image

flip hazard
1 2

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

I tried flip hazard solution, in 4.1, but things broke very often when modifying the "base" blueprint.

My variant for working around this issue in 4.11 is:

1) Create a MyWidgetBase_BP that contains all of the logic and absolutely nothing in the designer. No components, no child widgets. Whenever the logic needs to reference a ChildComponent, it calls an empty GetChildComponent() accessor method.

2) Create a MyWidgetDerived_BP, delete every default in the designer, go to the graph, change parent class to MyWidgetBase_BP.

3) In each Derived blueprint, fill in the designer stuff, child widgets, etc. Override all the inherited (empty) child component accessor methods to return whatever you put in the designer.

4) Make sure that no blueprint references components directly, and that all use the (polymorphic) accessor methods.

Voilà! You have now a child class with all the parent class´ logic, ready to override.

Edit: Try @SuperDuperYeah's suggestion.

more ▼

answered May 08 '16 at 05:08 PM

avatar image

Heroico
95 5 5 7

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

I guess best solution for this would be to use Interfaces :)

more ▼

answered Oct 04 '16 at 12:14 PM

avatar image

AndrewFord
94 2 14 14

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

UMG Widget inheritance is indeed not possible (according to Nick Darnell). For that to work, the UMG designer would have to be able to merge different widget trees or something..

See here and here:

UMG-widgets

Inheritance

So although you cant reparent them, it will not work as imagined :(

Nesting and interfaces seems to be (still) the way to go.

more ▼

answered Feb 01 '17 at 10:31 AM

avatar image

KVogler
102 8 10 16

(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