About
A BaseOverride defines the settings for a specific BaseList2D object in a certain take.
- Note
- BaseOverride objects are stored with the changed object. One should not access them directly, only through BaseTake.
BaseMaterial*
const material =
doc->GetActiveMaterial();
if (material ==
nullptr || material->GetType() !=
Mmaterial)
{
const String takeName =
"Variation " + String::IntToString(
i);
BaseTake* const materialVariation = takeData->AddTake(takeName, nullptr, nullptr);
if (materialVariation == nullptr)
const GeData newValue { rgb };
BaseOverride* const overrideNode = materialVariation->FindOrAddOverrideParam(takeData, material, matColID, newValue);
if (overrideNode == nullptr)
overrideNode->UpdateSceneNode(takeData, matColID);
}
Py_ssize_t i
Definition: abstract.h:645
return OK
Definition: apibase.h:2740
@ DTYPE_COLOR
Color.
Definition: lib_description.h:56
#define Mmaterial
Standard material.
Definition: ge_prepass.h:1007
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
#define ConstDescID(...)
Definition: lib_description.h:592
@ MATERIAL_COLOR_COLOR
Definition: mmaterial.h:56
maxon::Int32 Int32
Definition: ge_sys_math.h:51
maxon::Float Float
Definition: ge_sys_math.h:57
Vector HSVToRGB(const Vector &col)
maxon::Vec3< maxon::Float64, 1 > Vector
Definition: ge_math.h:140
const char * doc
Definition: pyerrors.h:226
Access
Existing BaseOverride objects can be accessed from the BaseTake or the TakeData object:
- BaseTake::GetOverrides(): Returns all BaseOverride of the take.
- BaseTake::FindOverride(): Returns the BaseOverride if the given node is overridden.
- BaseTake::FindOverrideInHierarchy(): Returns the BaseOverride for the given node and given parameter ID by searching in the entire hierarchy.
- TakeData::FindOverrideCounterPart(): Returns the BaseOverride and BaseTake that stores the backup value.
BaseObject*
const object =
doc->GetActiveObject();
if (object == nullptr)
BaseTake* const take = takeData->GetCurrentTake();
if (take == nullptr)
BaseOverride* const baseOverride = take->FindOverride(takeData, object);
if (baseOverride == nullptr)
Allocation/Deallocation
Overrides are created using the host BaseTake:
- BaseTake::FindOrAddOverrideParam(): Finds or if necessary creates an override for the given object and parameter.
- BaseTake::OverrideNode(): Overrides all parameters of the passed node.
- BaseTake::AutoTake(): Compares the two given nodes and creates needed overrides.
const DescID ID =
CreateDescID(cubeSizeLevel, vectorXLevel);
const GeData newValue { 300.0 };
BaseOverride* const overrideNode = take->FindOrAddOverrideParam(takeData, cube, ID, newValue);
if (overrideNode == nullptr)
overrideNode->UpdateSceneNode(takeData, ID);
@ VECTOR_X
Definition: dvector.h:6
@ DTYPE_VECTOR
Vector
Definition: lib_description.h:69
@ DTYPE_REAL
Float
Definition: lib_description.h:67
#define CreateDescID(...)
Definition: lib_description.h:593
@ PRIM_CUBE_LEN
Definition: ocube.h:6
- Note
- To delete a specific parameter from an override BaseTake::DeleteOverride() must be used.
Navigation
BaseOverride instances are organized in a BaseList2D list:
- BaseOverride::GetNext(): Returns the next BaseOverride in the list or
nullptr
.
- BaseOverride::GetPred(): Returns the previous BaseOverride in the list or
nullptr
.
- Note
- Functions like BaseOverride::GetUp() etc. are reserved for future use.
Read-Only Properties
The following properties can be accessed:
- BaseOverride::GetSceneNode(): Returns a pointer to the original scene node.
- BaseOverride::GetOwnerTake(): Returns the host BaseTake.
- BaseOverride::IsInGroup(): Checks if the BaseOverride is in a group and returns that BaseOverrideGroup.
Override
A BaseOverride stores the values of different parameters. These parameters can be accessed in different ways:
- BaseOverride::IsOverriddenParam(): Checks if the parameter with the given ID is overridden.
- BaseOverride::GetAllOverrideDescID(): Returns the IDs of all overridden parameters.
- BaseOverride::UpdateSceneNode(): Updates the given parameter on the assigned scene node.
BaseOverride* const baseOverride = take->FindOverride(takeData, object);
if (baseOverride == nullptr)
if (baseOverride->IsOverriddenParam(ID))
{
GeData data;
data = data.GetFloat() + 10.0;
baseOverride->UpdateSceneNode(takeData, ID);
}
NONE
Definition: asset_browser.h:1
#define Osphere
Sphere.
Definition: ge_prepass.h:1119
@ PRIM_SPHERE_RAD
Definition: osphere.h:6
Further Reading