About
GeData is a container class. This container is used to store data of all Cinema API data types that are supported by Cinema 4D.
Access
A GeData object can be used to directly change the value of a parameter of a C4DAtom object:
- C4DAtom::GetParameter(): Gets the value of the given parameter.
- C4DAtom::SetParameter(): Sets the value of the given parameter.
See also C4DAtom Manual.
A BaseContainer object stores multiple values using GeData objects:
- BaseContainer::GetParameter(): Retrieves the GeData for the given DescID.
- BaseContainer::SetParameter(): Sets the GeData for the given DescID.
- BaseContainer::GetData(): Returns the GeData element for the given ID.
- BaseContainer::SetData(): Sets the GeData element for the given ID.
- BaseContainer::GetDataPointer(): Returns a read-only pointer to the GeData element for the given ID.
- BaseContainer::GetDataPointers(): Sets an array of read-only GeData pointers for the given array of IDs.
- BaseContainer::GetIndexData(): Returns a pointer to the GeData element for the given index.
- BaseContainer::InsData(): Inserts a GeData element into the BaseContainer with the given ID.
- BaseContainer::InsDataAfter(): Inserts a GeData element into the BaseContainer with the given ID after the specified other element.
- BaseContainer::FindIndex(): Returns the index of the given GeData element.
See also BaseContainer Manual.
BaseObject*
object =
doc->GetActiveObject();
GeData data;
const Float radius = data.GetFloat();
NONE
Definition: asset_browser.h:1
@ DA_REAL
Float.
Definition: c4d_gedata.h:40
#define Osphere
Sphere.
Definition: ge_prepass.h:1119
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
#define ConstDescID(...)
Definition: lib_description.h:592
maxon::Float Float
Definition: ge_sys_math.h:57
@ PRIM_SPHERE_RAD
Definition: osphere.h:6
const char * doc
Definition: pyerrors.h:226
Data
Type
A GeData object stores data of a certain type.
- GeData::SetDefault(): Sets the default value for the given data type.
- ::DEFAULTVALUE: Dummy value for the constructor to initialize the object with the default value.
BaseContainer& bc = ((BaseList2D*)
node)->GetDataInstanceRef();
@ DTYPE_BASELISTLINK
BaseLink.
Definition: lib_description.h:73
@ DEFAULTVALUE
Dummy value for the default value GeData constructor.
Definition: c4d_gedata.h:64
- GeData::GetType(): Returns the type of the stored data.
- Note
- If the type is not set, GeData::GetType() returns ::DA_NIL.
GeData data;
if (!success)
const Float radius = data.GetFloat();
maxon::Bool Bool
Definition: ge_sys_math.h:46
Access
The GeData class offers access functions for all supported data types. "Set" functions set the value and also change the data type if needed. "Get" functions return the value and are only allowed to be used if the data type matches.
::Int32 and ::Bool data (data type ::DA_LONG):
- GeData::GetBool(): Returns the ::Bool value.
- GeData::GetInt32(): Returns the ::Int32 value.
- GeData::SetInt32(): Sets a ::Int32 value.
::Int64 data (data type ::DA_LLONG):
- GeData::GetInt64(): Returns the ::Int64 value.
- GeData::SetInt64(): Sets the ::Int64 value.
::Float data (data type ::DA_REAL):
- GeData::GetFloat(): Returns the ::Float value.
- GeData::SetFloat(): Sets the ::Float value.
See also Primitive Data Types Manual (Cinema API).
Void pointers (data type ::DA_VOID):
- GeData::GetVoid(): Returns the void pointer.
- GeData::SetVoid(): Stores the void pointer.
GeData data;
data.SetVoid(&object);
SomeObject*
const obj =
static_cast<SomeObject*
>(data.GetVoid());
PyObject * obj
Definition: complexobject.h:60
- Note
- In general it is not recommended to use "raw" pointers, instead see BaseLink Manual.
Raw memory (data type ::DA_BYTEARRAY):
- GeData::GetMemoryAndRelease(): Returns a pointer to the stored memory and hands over the ownership.
- GeData::GetMemory(): Returns a pointer to the stored memory.
- GeData::SetMemory(): Stores the raw memory.
GeData geData;
geData.SetMemory(memory, memSize);
if (data != nullptr)
{
}
Py_ssize_t count
Definition: abstract.h:640
Py_ssize_t char * output
Definition: unicodeobject.h:985
maxon::Char Char
Definition: ge_sys_math.h:47
maxon::Int Int
Definition: ge_sys_math.h:55
::Vector objects (data type ::DA_VECTOR):
- GeData::GetVector(): Returns the ::Vector object.
- GeData::SetVector(): Stores the ::Vector object.
See also Vector Manual (Cinema API).
::Matrix objects (data type ::DA_MATRIX):
- GeData::GetMatrix(): Returns the ::Matrix object.
- GeData::SetMatrix(): Stores the ::Matrix object.
See also Matrix Manual (Cinema API).
String objects and C4DUuid objects (data type ::DA_STRING):
- GeData::GetString(): Returns the ::String object.
- GeData::SetString(): Stores the ::String object.
See also String Manual (Cinema API).
Filename objects (data type ::DA_FILENAME):
- GeData::GetFilename(): Returns the Filename object.
- GeData::SetFilename(): Stores the Filename object.
See also Filename Manual.
C4DUuid objects: (data type ::DA_UUID):
- GeData::GetUuid(): Returns the C4DUuid object.
- GeData::SetUuid(): Stores the C4DUuid object.
BaseTime objects (data type ::DA_TIME):
- GeData::GetTime(): Return the BaseTime object.
- GeData::SetBaseTime(): Stores the BaseTime object.
See also BaseTime Manual.
Tristate (data type ::DA_TRISTATE):
See also TriState Manual.
BaseContainer objects (data type ::DA_CONTAINER):
- GeData::GetContainer(): Returns the BaseContainer.
- GeData::SetContainer(): Stores the BaseContainer.
GeData data;
{
BaseContainer bc;
bc.InsData(100, "foobar");
data.SetContainer(bc);
}
{
const BaseContainer* bc = data.GetContainer();
if (bc == nullptr)
}
#define MAXON_SCOPE
Definition: apibase.h:2891
See also BaseContainer Manual.
BaseLink objects (data type ::DA_ALIASLINK):
- GeData::GetBaseLink(): Returns the BaseLink object.
- GeData::GetLink(): Returns the BaseList2D object referenced by the stored BaseLink object.
- GeData::GetLinkAtom(): Returns the C4DAtomGoal object referenced by the stored BaseLink object.
- GeData::SetBaseLink(): Stores the BaseLink object.
- GeData::SetBaseList2D(): Stores a BaseLink object referencing a given BaseList2D object.
See also BaseLink Manual.
Custom data types:
- GeData::GetCustomDataType(): Returns the custom data type object.
- GeData::SetCustomDataType(): Stores a custom data type object.
GeData data;
PriorityData* const priorityData = data.GetCustomDataTypeWritable<PriorityData>();
if (priorityData == nullptr)
#define PRIORITYVALUE_CAMERADEPENDENT
::Bool Camera dependent.
Definition: customgui_priority.h:35
@ EXPRESSION_PRIORITY
Definition: texpression.h:6
Copy
The data of one GeData object can easily be copied to another object:
- GeData::CopyData(): Copies the data to the given target GeData object.
- GeData::operator=: Copies the GeData object.
GeData stringData { "foobar" };
GeData intData(100);
stringData.CopyData(&intData, nullptr);
@ DA_STRING
String.
Definition: c4d_gedata.h:46
Clear
A GeData object can be cleared.
- GeData::Free(): Deletes all internal data and sets the type to ::DA_NIL.
GeData data { "foobar" };
data.Free();
@ DA_NIL
No value.
Definition: c4d_gedata.h:37
Compare
Two GeData objects can be compared with the usual operators:
- GeData::operator==: Returns true if two GeData objects are equal.
- GeData::operator!=: Returns true if two GeData objects are not equal.
GeData intergerDataA;
intergerDataA.SetInt32(123);
GeData integerDataB;
integerDataB.SetInt64(123);
if (intergerDataA != integerDataB)
Disc I/O
A GeData object can be stored in a HyperFile:
- HyperFile::ReadGeData(): Reads the GeData object from the HyperFile.
- HyperFile::WriteGeData(): Writes the GeData object to the HyperFile.
AutoAlloc<HyperFile> hf;
if (hf == nullptr)
{
hf->WriteGeData(data);
hf->Close();
}
else
{
}
PyCompilerFlags const char * filename
Definition: ast.h:15
WRITE
Problems writing the file.
Definition: ge_prepass.h:4
ANY
Definition: lib_substance.h:28
maxon::Url MaxonConvert(const Filename &fn, MAXONCONVERTMODE convertMode)
AutoAlloc<HyperFile> hf;
if (hf == nullptr)
{
GeData data;
hf->ReadGeData(&data);
hf->Close();
}
else
{
}
READ
Problems reading the file.
Definition: ge_prepass.h:3
Further Reading