Dealing with Blueprint class derived from C++ class
Hello guys, How do you deal with the blueprints that are derived from C++. More specifically, the Constructor part.
When doing code in constructor, sometimes the changes are applied to the Blueprint, sometimes I need to restart the editor, sometimes, I need to restart the editor AND regenerate the visual studio project files to get the changes to apply and in the worst case the changes are not applied in the existing BP. In the last case, where the changes are not applied, when I create a fresh derived BP, the changes are there normally. The same problem occurs whether I compile the code inside the editor, or from the VS.
Is there something that I am missing?
asked Apr 30 '19 at 03:46 PM in C++ Programming
I don't know about having to regenerate the project files - that seems like a step too far. Sometimes I need to rebuild VS but I generally do that out of habbit now anyway as I've had a few hot-reload issues.
However, as for the values changing or not changing. As I see it if you have object A and make no changes to it at all, then edit the C++ constructor and restart, the changes you made in the constructor should then appear in object A. If you have object B which you created at the same time as object A, but you changed some value and saved, when you make changes to your constructor those changes are not put back into object B but instread the values you saved are deserialised and applied on top of your default (constructor) values. This makes sense to me because if any value can be edited, you don't want to loose those changes as a result of you adjusting the default parameters (this would make the life of a designer pretty miserable).
I have to admit I've not completed tested this behaviour so I could be wrong or it might be dependent upon your UPROPERTY settings, but this is this is my assumption and I've not really stumbled across issues with the theory.
answered Apr 30 '19 at 04:31 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here