Hi guys.
I’m writing for finding a solution to my global programming problem.
What am I trying to do?
Binding UMG to C++ is really easy (as for me) Writing C++ code that declares widget elements, functions, animation variables etc., making User Widget layout, defining elements on UWBP as variables, reparenting, fixing bugs and that’s it.
(videos that show this process:
- Unreal Engine 4 UI: C++ & Blueprints UMG Workflow Tutorial - YouTube
- Unreal Engine 4 C++: Binding UMG widgets to C++ classes - NO BLUEPRINT - YouTube
they aren’t mine, but nevertheless…)
I’m trying to do the same actions, but with ordinary Blueprints (such as Actor, Pawn etc.) But I have a global problem.
In UMG, after reparenting, I still have an access to full elements transform data, and my variables are staying the same. In normal Blueprint, I tried to declare components, write functions, implement basic Timeline in C++, and set up component appearance in BP. But every time, I have a fail.
Let me show you how I imagine my door (without starter content), on the screenshot from my prototype Blueprint class.
And BP Event Graph:
Please, notice the fact, that I have a full access to all transform data of all components. And that Event Graph is working correctly.
Now, let’s look at C++ “translation”
It’s only code, and I need to make BP child.
So it’s reserved variables, or I really can’t get an access to all transform data?!
for that screenshot, I “uncommented” AddOwnedComponent code, btw
I have tried numerous solutions, sometimes I got the access to transform, sometimes I lost ability of editing components in BP editor, but I could edit everything in World Editor (adding location, scale, rotation, meshes…) Second situation was buggy and editor has been crushed, or in the best case, C++ code of opening a door wasn’t working.
I don’t know how to solve it.
So, I need to make BP-to-C++ bind process similar to UMG-to-C++ bind, and I mean that:
- All data of components (transform, mesh…) are fully and constantly accessible and editable in BP editor.
- I don’t need to go to World Editor for editing meshes or something else.
- Editing components are not influencing C++ code functionality (in my door case, Timeline activation)
- I can add something in Event Graph to extend the class functions.
These condition are telling that a full freedom of editing components in BP x C++ (as it was in UMG x C++) is required.
So how to implement that?
I’m looking forward to your answers, help, comments, solutions.
Good luck, and I hope it is possible to implement [BP-C++ process = UMG-C++ process]