How can I convert a list of float values to a string of hex?

86 Views Asked by At

To start off, I'm not a programmer or script writer. I'm modding a 3d model file of a game and it involves using a hex editor to input values into the float32 box in a hex editor like HxD.

So i'm basically putting in values for stuff like vertex coordinates, UV coordinates, etc. HxD automatically converts the values i put in the float32 box to hex. (All tested, works in-game). However this a long tedious process because i have to put the values in one by one by one.

My question is, is there a script or program where i can just paste a list of values, like:

0.298584
0.423096
0.308350
0.417480
0.268066
0.392578
0.321045
0.464844
0.309814
0.464844
0.308350
0.511963
0.298584
0.506348
0.268066
0.536865
0.284668
0.498291
0.260010
0.523193

Then the script will automatically convert the list of values as float32 into hex, like:

01 E0 98 3E 0A A0 D8 3E 0D E0 9D 3E F0 BF D5 3E F2 3F 89 3E FC FF C8 3E 03 60 A4 3E 08 00 EE 3E F1 9F 9E 3E 08 00 EE 3E 0D E0 9D 3E 02 10 03 3F 01 E0 98 3E 06 A0 01 3F F2 3F 89 3E FC 6F 09 3F 01 C0 91 3E FF 1F FF 3E 08 20 85 3E FA EF 05 3F

or

01E0983E0AA0D83E0DE09D3EF0BFD53EF23F893EFCFFC83E0360A43E0800EE3EF19F9E3E0800EE3E0DE09D3E0210033F01E0983E06A0013FF23F893EFC6F093F01C0913EFF1FFF3E0820853EFAEF053F

It would help me make this process less time consuming.

I've been searching other stackoverflow questions, but most of them seem to focus on converting a single float to hex rather than a list of floats. That plus i have limited scripting, programming knowledge.

0

There are 0 best solutions below