Primitive data types are the building blocks for data stored within Cinema 4D. These data types are typically based on the standard data types of C++ and are available in a 32 and 64 bit version.
Boolean values are used for logical operations:
int
.Bool variables can be created on demand or can be obtained from other entities.
Access Bool values stored in a BaseContainer:
See also BaseContainer Manual.
Access Bool values stored in a GeData object (GeData type is DA_LONG):
See also GeData Manual.
A Bool value can be stored in a BaseFile or a HyperFile:
See also BaseFile Manual on Bool and HyperFile Manual on Bool.
A character variable contains a single symbol and is typically the smallest piece of memory.
char
.unsigned char
.UInt16
.UInt32
.A character can be stored in a BaseFile or HyperFile:
See also BaseFile Manual on Char and HyperFile Manual on Char.
Integer variables contain whole numbers. Both signed and unsigned variations are available, both in 16, 32 and 64 bit.
short int
.unsigned short int
.signed int
.unsigned int
.signed long long
.unsigned long long
.Int64
.UInt64
.Integer values can be created by casting them from float values. To do this safely these macros should be used:
Integer variables can be obtained from other entities.
Access integer values stored in a BaseContainer:
See also BaseContainer Manual.
Access Int32 or Int64 values stored in a GeData object (GeData type is DA_LONG or DA_LLONG):
See also GeData Manual.
String objects can be parsed to get the numeric value represented by the string:
See also String Manual (Classic).
To display them in the GUI, integer numbers also can be converted to String objects:
See also String Manual (Classic).
An integer value can be stored in a BaseFile or a HyperFile:
See also BaseFile Manual on Integer and HyperFile Manual on Integer.
Floating point numbers present rational numbers with limited precision. Variations are available in 32 and 64 bit.
float
.double
.Float64
.Floating point variables can be obtained from other entities.
Access float values stored in a BaseContainer:
See also BaseContainer Manual.
Access float values stored in a GeData object (GeData type is DA_REAL):
See also GeData Manual.
Of course it is also possible to cast integer types into float values. Just be aware of the limited precision of different float formats.
String objects can be parsed to get the numeric value represented by the string:
Since floating point values are only stored with limited precision they cannot represent every value perfectly. This is especially critical when it is needed to compare two floating point values:
To display them in the GUI, floating point numbers also can be converted to String objects:
A floating point value can be stored in a BaseFile or a HyperFile:
See also BaseFile Manual on Float and HyperFile Manual on Float.