Hi Greg—there are a few things going on here, and I agree that it’s confusing. Let me explain how it works now and get your feedback.
The first is that XYZs and XYZ Distance nodes now always output a length, even if the inputs were numbers. This means that depending on your length display settings, you will see in a Watch from XYZ Distance, potentially different numbers as you toggle between show data and show raw data, where “show raw data” will always give the length’s numerical value in meters. The default display setting for a watch window is to show you the raw data, which is the length in meters. Toggling this will show you the feet-numerical value (as that’s the setting you are using), and for clarity, will append the text “ft.”
The formula node, which is also hidden inside the Feet to Meters custom node available on the Package Manager, does not read units, so when you feed it a length, it will take the numerical equivalent in the unit system you are using and always give you back a number at the end. Feeding in “12 inches” (raw data = 0.305) to a formula node will read 12 if using inches, 1 if using feet, or 0.305 if using meters.
In your example, at the top, part of the confusion is that Watch displays raw data by default, which matches the value of a length in meters and the rest is due to the fact that you are viewing a length to begin with but a number to end with since your data passed through a formula node. See, for example:
- “Length” is the data type, not “feet,” “meters,” “inches,” etc, so when you have 1.5ft it is already simultaneously 0.4572m. What happens when you try to convert a length depends on how you tried to do it. If you use a formula node, it strips the units from the value so you are left with a number, which is, indeed, the meter equivalent as a number (in your example, you converted feet from meters to feet, which explains the particularly weird value—you probably meant to use Feet to Meters). You can preserve the unit information by not using a formula node.
In the second, lower part, of your definition is a variation on that earlier theme. The length “1.5 ft” is behaving as a number when it comes out of the Meters to Feet node because inside a formula node is multiplying by 3-something. You are using a formula node again to effectively compare “4.921” to the various lengths coming from XYZ Distance, which converts them to numbers as well, using the number of their feet-equivalent since you are viewing lengths in feet.
Your comparison on the bottom would make more sense if you compare the lengths directly, without the conversion factor which is actually muddying the waters.
I hope this helps. As a way to make this less confusing—this was an excellent question, btw—which of these things do you think should change and how:
- - XYZ and XYZ Distance always produce a length
- - The Formula node does not operate mathematically on units (we would love to do this, but it will require a massive rewrite of the code, and would be a ways off)
- - You have the option to see raw data at all
- - The Watch node shows you the raw data by default
Or any other reactions would be very helpful!