1

I don't fully understand how data types are converted when their sockets are connected. Can someone help me fill in the blanks or better yet, give us a proper diagram about how this happens?

Data Type Definitions

Boolean. True or false value.
Boolean In-depth: A value of either 1 or 0 with 1 = True and 0 = False.
Integer. 32-bit integer.
Integer In-depth: -
Float. Floating-point value.
Float In-depth: -
Vector. 3D vector with floating-point values.
Vector In-depth: -

enter image description here

Data Type Conversions

Integer $\rightarrow$ Boolean. Given integer n, if n $\leq$ 0, then return 0 = False. Otherwise, return 1 = True when n $\geq$ 1.
Float $\rightarrow$ Boolean. Given float n, if n $\leq$ 0, then return 0 = False. Otherwise, return 1 = True when n $\geq$ 0.
Vector $\rightarrow$ Boolean. If vector is (0,0,0), then boolean returns 0 = False. For every other vector, return 1 = True. (Why can't I get a 0 = False value with a vector other than (0,0,0)?)
Float $\rightarrow$ Integer. Truncate.
Vector → Float. Mean. Average of scalars within vector represented as a float.
Vector $\rightarrow$ Integer. Mean and Truncate. Average of scalars within vector represented as float. Then truncated as an integer. (Not too sure if the scalars within the vector are truncated before calculating the average or after.)
Boolean $\rightarrow$ Vector. If boolean 0 = False, then return vector (0,0,0). If boolean 1 = True, then return vector (1,1,1).
Integer $\rightarrow$ Vector. Given integer n, then return vector (n,n,n).
Float $\rightarrow$ Vector. Given float n, then return vector (n,n,n).

Obfuscate
  • 323
  • 12
  • Does this answer your question? What happens when a vector is fed into a value slot of the add node? Maybe I could rework the answer… Also I disagree with the "Actual" value for boolean, it is stored as a single bit in memory (not always, sometimes it's stored as many more bits, with many bits wasted, just so values are aligned), and translates to $0$ or $1$ numerically. Also the bit is often interpreted as $0$ or $1$, but using the same logic a float is actually an int. – Markus von Broady Dec 17 '23 at 18:01
  • Vector is simply 3 floats. 2D vector is 2 floats. Color is... Depends on version, 3 or 4 floats (sometimes includes alpha). Except byte color is 3×8 bits integers in range $[0, 255]$. Oh and there's also quaternions (rotations), I don't know how they convert, I think they just don't (invalid connection). – Markus von Broady Dec 17 '23 at 18:10
  • @MarkusvonBroady Oh!? I did not notice that you already had an answer to this question. Yes, I couldn't quite understand the manual's simplified definitions of the terms so, I included them in my question. I, for one, do feel that the computing lingo tending to go over my head. So, I appreciate the complete and detailed explanations that folks can provide. – Obfuscate Dec 17 '23 at 20:03
  • @MarkusvonBroady I didn't even notice that the color attribute was represented numerically so, I didn't include it. lol! As for Quaternions, I can say that you are correct about them, and they normally give invalid connections when connecting to other data types. I typically use the new nodes, like euler to rotation or rotation to euler to work with them. – Obfuscate Dec 17 '23 at 20:11
  • maybe someone could make a complete thread/answer about these data types as blender updates? – Obfuscate Dec 17 '23 at 20:14
  • For Vector to Boolean, "Why can't I get a 0 = False value with a vector other than (0,0,0)?", it's like this: Boolean only accepts true or false, but while 0 is interpreted as false, no other integer or float value is false. In logic (as long as something is not somehow undefined), not true = false and not false = true. Since all values other than 0 are therefore not false, they are interpreted as true to avoid getting an error for values not in (0, 1). The three vector values are concatenated into one by a logical OR operation which is always true if only one value is not false. – Gordon Brinkmann Dec 18 '23 at 11:36
  • See if this manual section helps. if it doesn't sort you out, perhaps you could rephrase this question, linking back to the manual, explaining where it is lacking, for you. – Robin Betts Dec 18 '23 at 19:26

0 Answers0