Can I copy&paste editor widget code to create my own?


I’m creating a plugin that makes quite heavy use of curves interpolation. I’d like to include curve editor for them, however, I have some more complex data that I’d like to display/evaluate.

So SCurveEditor class was the first place I looked into but it isn’t quite enough. It has everything I need but I’d like to modify it a bit. For example I’d like to implement my own ProcessDrag or ProcessClick functions but I cant do that since they are private and not virtual.

The question is: Can I take entire SCurveEditor widget code, copy/paste it into my own widget and override some functionality in a plugin? I think that it might be ok for free, open source plugin but I’m planning on keeping it closed source and selling it.
So can I include some part of Epic’s code in a plugin and still call it MY plugin and make money out of it?

Do I need to include some kind of disclaimer in the file where most of the code is taken from the Engine? Will this kind of code have some problems making it’s way to the marketplace?

I guess it’s more of a licensing question so if anyone could move it I would appreciate it.