Download

Adding Doubles Support to Blueprint? "Type 'double' is not supported by blueprint."

First time post on the forums, I am hoping I can find some answers from the experienced people here.

I am trying to add actual double support to blueprints. Nothing like a String>Double method that others have done. I have scoured the internet and forums in search of answers, but I have found little help.
So far I have defined some regular double math functions in blueprint (they don’t compile of course “Bad function definition”) and I have made a little Float64.h which is a copy of the native Float32.h in the source; thus far I have found no use for either of those headers in the actual code so I don’t really know why they exist.

I am currently editing the source engine to get this support in; I have been aware from the beginning that I would be doing this.

I see no reason why my doubles are not working, the engine simply won’t compile because of them. I can only assume there is some place hidden in the source that has a big whitelist or blacklist(unlikely) of variables that can be used in blueprints. I just need to find where that is, and I can probably feel my way along from there using floats as a guide (if floats aren’t there I’m going to be in a tough spot though).

I have come across Missing support for uint32 int64 uint64 - UE4 AnswerHub that post, in which the OP claimed to have added the int64 support themselves but did not detail how in any way.
I am foreign to Unreal’s C++ stuff, so I could really use example snippets of code to follow so I can understand these things better.

Thanks for hearing me out, I hope you all can help me solve my little mystery here!

It should go without saying, but obviously you cannot add native support for doubles to Blueprint without extensive engine modifications. Even the simplest of things like property editor widgets don’t deal in doubles, so you’ll need to provide all of that infrastructure too. Have a look at EdGraphScema_K2.h - which contains definitions for all of the blueprint pin types, and these are in turn referred to in various ways all accross the codebase.

Many areas of the blueprint editor are hardcoded around these specific types. You will also need to customize the Unreal Header Tool so that it can properly parse UPROPERTY() and UFUNCTION() macros when used with doubles.


It’s also worth pointing out that all of Unreals’ math libraries and exposed types deal in floating point too, so if you intend to convert between types and use any of Unreals math library (which is very extensive) - you’ll need to rewrite that too.

To be honest, I would really question the need to use doubles in blueprint at all - certainly when it comes to creating scripts around them. Your saving grace here might be to just use a USTRUCT() as a wrapper. doubles can be UPROPERTY(), they just can’t be directly exposed or manipulated in Blueprint. My advice would be to avoid the hell of adding native support, wrap the double in a USTRUCT and pass that into whatever UFUNCTIONS() etc. you want to expose.

Adding true native support will be an endless uphill battle, especially if you ever want to upgrade the engine. I dread to think of how hard it would be to merge related code together each update.

Thanks for the reply!

I am very much aware that extensive engine modification will be (and has been) required. I have been working on this for a little while now.

I have been through that file and (supposedly) added basic support. There were a couple other little definitions (like pin color for example) that also had to be poked at.

Now THIS I was not aware of, do you have any information on where I can look to edit the header tool or add double support. I suspect this is one of the main keys to my problem here.

I have already done this also, unreal treats math doubles pretty well so it wasn’t too bad.

I have also added a custom pin type for doubles so that they will show up. I don’t really have a good way of testing most of my modifications since for the engine to start up it’s kind of “all or nothing” in this scenario. I strongly suspect that I need to find and edit the header tool to accept doubles in functions and structs. If you have any information as to where I can accomplish that it would be massively appreciated.

Well this should go without saying but, you’re crazy :smiley:

To be honest if you have already done most of that, you’re already way ahead of me - I don’t know much more about the subject other than what I posted above really. Just one little gotcha, if you’re changing Unreals Types and Libraries to use doubles instead of floats - make sure you replace all ‘.f’ with ‘.0’ too. One ltitle mistake there and you’re back to dealing with float precision.

Stumbled upon this post and it led me right down the rabbit hole sorry to necro this. I’ve managed to expose double and int64 partially but the editor truncates any variable of type double input to a float. Just wondering if you guys are interested in having a look. Let me know cheers.