#include <c4d_baseobject.h>
All objects in Cinema 4D are derived from the BaseObject class.
Contains methods for the object's position, scale and rotation, as well as for accessing the sub-items of the object (e.g. tags and animation tracks).
Private Member Functions | |
BaseObject () | |
~BaseObject () | |
Alloc/Free | |
static BaseObject * | Alloc (Int32 type) |
static void | Free (BaseObject *&bl) |
Navigation | |
BaseObject * | GetNext () |
const BaseObject * | GetNext () const |
BaseObject * | GetPred () |
const BaseObject * | GetPred () const |
BaseObject * | GetUp () |
const BaseObject * | GetUp () const |
BaseObject * | GetDown () |
const BaseObject * | GetDown () const |
BaseObject * | GetDownLast () |
const BaseObject * | GetDownLast () const |
Abs Pos/Scale/Rot | |
Vector | GetAbsPos () const |
void | SetAbsPos (const Vector &v) |
Vector | GetAbsScale () const |
void | SetAbsScale (const Vector &v) |
Vector | GetAbsRot () const |
void | SetAbsRot (const Vector &v) |
Frozen Pos/Scale/Rot | |
Vector | GetFrozenPos () const |
void | SetFrozenPos (const Vector &v) |
Vector | GetFrozenScale () const |
void | SetFrozenScale (const Vector &v) |
Vector | GetFrozenRot () const |
void | SetFrozenRot (const Vector &v) |
Rel Pos/Scale/Rot | |
Vector | GetRelPos () const |
void | SetRelPos (const Vector &v) |
Vector | GetRelScale () const |
void | SetRelScale (const Vector &v) |
Vector | GetRelRot () const |
void | SetRelRot (const Vector &v) |
Ml/Mg Matrix | |
const Matrix & | GetMl () const |
void | SetMl (const Matrix &m) |
Matrix | GetFrozenMln () const |
Matrix | GetRelMln () const |
Matrix | GetRelMl () const |
void | SetRelMl (const Matrix &m) |
Matrix | GetMg () const |
void | SetMg (const Matrix &m) |
Matrix | GetMln () const |
Matrix | GetMgn () const |
Matrix | GetUpMg () const |
void | CopyMatrixTo (BaseObject *dst) const |
Bounding Box | |
Vector | GetMp () const |
Vector | GetRad () const |
void | GetDimension (Vector &mp, Vector &rad) const |
Editor/Render/Deform Mode | |
Int32 | GetEditorMode () const |
Int32 | GetEditorModeH () const |
void | SetEditorMode (Int32 mode) |
Int32 | GetRenderMode () const |
Int32 | GetRenderModeH () const |
void | SetRenderMode (Int32 mode) |
Bool | GetDeformMode () const |
void | SetDeformMode (Bool mode) |
Int32 | GetRealDeformMode () const |
void | SetRealDeformMode (Int32 mode) |
Unique IP | |
Int32 | GetUniqueIP () const |
void | SetUniqueIP (Int32 ip) |
Tag | |
BaseTag * | GetFirstTag () |
const BaseTag * | GetFirstTag () const |
BaseTag * | GetLastTag () |
const BaseTag * | GetLastTag () const |
BaseTag * | GetTag (Int32 type, Int32 nr=0) |
const BaseTag * | GetTag (Int32 type, Int32 nr=0) const |
maxon::Block< const BaseTag *const > | GetTagsOfType (Int32 type) const |
maxon::Block< BaseTag *const > | GetTagsOfType (Int32 type) |
const void * | GetTagDataR (Int32 type, Int32 nr=0) const |
void * | GetTagDataW (Int32 type, Int32 nr=0) |
Int32 | GetTagDataCount (Int32 type) const |
const VariableTagDataRef & | GetVariableTagData (Int32 type, Int32 nr=0) const |
BaseTag * | MakeTag (Int32 type, BaseTag *pred=nullptr) |
VariableTag * | MakeVariableTag (Int32 type, Int32 count, BaseTag *pred=nullptr) |
void | InsertTag (BaseTag *tp, BaseTag *pred=nullptr) |
void | KillTag (Int32 type, Int32 nr=0) |
Bool | CopyTagsTo (BaseObject *dest, Int32 visible, Int32 variable, Int32 hierarchical, AliasTrans *trans) const |
Cache | |
BaseObject * | GetCache () |
const BaseObject * | GetCache () const |
BaseObject * | GetDeformCache () |
const BaseObject * | GetDeformCache () const |
LineObject * | GetIsoparm () |
void | SetIsoparm (LineObject *l) |
BaseObject * | GetCacheParent () const |
BaseObject * | GetCacheTopParent () const |
Phong | |
Bool | SetPhong (Bool on, Bool anglelimit, Float angle) |
Dirty | |
Bool | IsDirty (DIRTYFLAGS flags) const |
void | SetDirty (DIRTYFLAGS flags) |
Bool | CheckCache (const HierarchyHelp *hh) const |
void | Touch () |
Color Properties | |
void | GetColorProperties (ObjectColorProperties *prop) const |
void | SetColorProperties (ObjectColorProperties *prop) |
maxon::Opt< maxon::Color > | GetDisplayColor () const |
Modeling Axis | |
const Matrix & | GetModelingAxis (BaseDocument *doc) |
void | SetModelingAxis (const Matrix &m) |
Hierarchy Clone | |
BaseObject * | GetAndCheckHierarchyClone (const HierarchyHelp *hh, BaseObject *op, HIERARCHYCLONEFLAGS flags, Bool *dirty, AliasTrans *trans, Int childCount, maxon::BaseArray< BaseObject * > *children, Bool addChildOrClone=false) |
BaseObject * | GetAndCheckHierarchyClone (const HierarchyHelp *hh, BaseObject *op, HIERARCHYCLONEFLAGS flags, Bool *dirty, AliasTrans *trans, Bool allchildren) |
BaseObject * | GetHierarchyClone (const HierarchyHelp *hh, BaseObject *op, HIERARCHYCLONEFLAGS flags, Bool *dirty, AliasTrans *trans) |
BaseObject * | GetHierarchyClone (const HierarchyHelp *hh, BaseObject *op, HIERARCHYCLONEFLAGS flags, Bool *dirty, AliasTrans *trans, DIRTYFLAGS dirtyflags) |
Dependence List | |
void | NewDependenceList () |
Bool | CompareDependenceList () |
void | AddDependence (const BaseObject *op) |
void | AddDependence (const BaseObject *op, DIRTYFLAGS dirtyflags) |
void | TouchDependenceList () |
Rotation Order | |
void | SetRotationOrder (ROTATIONORDER order) |
ROTATIONORDER | GetRotationOrder () const |
Synchronized Rotation Mode | |
void | SetQuaternionRotationMode (Bool active, Bool bUndo) |
Bool | IsQuaternionRotationMode () const |
Bool | SynchronizeVectorTrackKeys (Int32 vectorTrackID, Bool bUndo, BaseTime startRange=BaseTime(-108000, 1), BaseTime endRange=BaseTime(108000, 1)) |
Bool | FindBestEulerAngle (Int32 rotationTrackID, Bool bAdjustTangent, Bool bUndo, BaseTime startRange=BaseTime(-108000, 1), BaseTime endRange=BaseTime(108000, 1)) |
Bool | EvaluateSynchronizedRotation (const BaseTime &time, ANIMATEFLAGS flags, Vector *resultRotation=nullptr) |
Miscellaneous | |
Bool | GetVectorTracks (const DescID &id, CTrack *&xfound, CTrack *&yfound, CTrack *&zfound) |
Bool | GetVectorCurves (CCurve *curveToSearch, CCurve *&xfound, CCurve *&yfound, CCurve *&zfound) |
UInt64 | GetGUID () const |
Int32 | GetHighlightHandle (BaseDraw *bd) |
SplineObject * | GetRealSpline () |
const SplineObject * | GetRealSpline () const |
Float | GetVisibility (Float parent) const |
Bool | SearchHierarchy (const BaseObject *op) const |
Private | |
BaseObject * | GetOrigin (Bool safe) |
const BaseObject * | GetOrigin (Bool safe) const |
void | SetOrigin (BaseObject *origin) |
BaseObject * | GetTopOrigin (Bool parent, Bool safe) const |
BaseObject * | GetEditObject (BaseObject **psds, DISPLAYEDITSTATE state, Bool safetey=true) const |
void | RemoveFromCache (Bool clearParentObject=true) |
DRAWRESULT | ObjDraw (DRAWPASS drawpass, BaseDraw *bd, BaseDrawHelp *bh) |
maxon::Tuple< Bool, maxon::HashInt > | GetObjectDrawHash (Int32 type) const |
void | GetDrawStateData (void *state) const |
Additional Inherited Members | |
Static Public Member Functions inherited from BaseList2D | |
static BaseList2D * | Alloc (Int32 type) |
static void | Free (BaseList2D *&bl) |
Static Public Attributes inherited from BaseList2D | |
static const Int32 | SETBIT_FLAG_NODIRTY |
static const Int32 | SETBIT_FLAG_REMOVE |
|
private |
|
private |
|
static |
Allocates a base object. Destroy the allocated base object with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
[in] | type | The object type: Object Types |
|
static |
BaseObject* GetNext | ( | ) |
Gets the next object in the list. Convenience version of GeListNode::GetNext().
const BaseObject* GetNext | ( | ) | const |
BaseObject* GetPred | ( | ) |
Gets the previous object in the list. Convenience version of GeListNode::GetPred().
const BaseObject* GetPred | ( | ) | const |
BaseObject* GetUp | ( | ) |
Gets the parent object of the list node. Convenience version of GeListNode::GetUp().
const BaseObject* GetUp | ( | ) | const |
BaseObject* GetDown | ( | ) |
Gets the first child object of the list node. Convenience version of GeListNode::GetDown().
const BaseObject* GetDown | ( | ) | const |
BaseObject* GetDownLast | ( | ) |
Gets the last child base object of the list node. Convenience version of GeListNode::GetDownLast().
const BaseObject* GetDownLast | ( | ) | const |
Vector GetAbsPos | ( | ) | const |
Gets the absolute position of the object.
These are the absolute local coordinates within the parent object.
If the object has no parent then these are world coordinates.
void SetAbsPos | ( | const Vector & | v | ) |
Sets the absolute local position of the object within its parent.
These are the absolute local coordinates within the parent object.
If the object has no parent then these are world coordinates.
[in] | v | The object's absolute position to set. |
Vector GetAbsScale | ( | ) | const |
Gets the absolute scale of the object.
This is relative to the object's parent if it has one.
void SetAbsScale | ( | const Vector & | v | ) |
Sets the absolute scale of the object.
This is relative to the object's parent if it has one.
[in] | v | The object's absolute scale to set. |
Vector GetAbsRot | ( | ) | const |
Gets the absolute HPB rotation of the object.
This is relative to the object's parent if it has one.
void SetAbsRot | ( | const Vector & | v | ) |
Sets the absolute HPB rotation of the object.
This is relative to the object's parent if it has one.
[in] | v | The object's absolute HPB rotation to set. |
Vector GetFrozenPos | ( | ) | const |
Gets the frozen position of the object.
void SetFrozenPos | ( | const Vector & | v | ) |
Sets the frozen position of the object.
[in] | v | The object's frozen position to set. |
Vector GetFrozenScale | ( | ) | const |
Gets the frozen scale of the object.
void SetFrozenScale | ( | const Vector & | v | ) |
Sets the frozen scale of the object.
[in] | v | The object's frozen scale to set. |
Vector GetFrozenRot | ( | ) | const |
Gets the frozen HPB rotation of the object.
void SetFrozenRot | ( | const Vector & | v | ) |
Sets the frozen HPB rotation of the object.
[in] | v | The object's frozen HPB rotation to set. |
Vector GetRelPos | ( | ) | const |
Get the relative position of the object.
void SetRelPos | ( | const Vector & | v | ) |
Sets the relative position of the object.
[in] | v | The object's relative position to set. |
Vector GetRelScale | ( | ) | const |
Gets the relative scale of the object.
void SetRelScale | ( | const Vector & | v | ) |
Sets the relative scale of the object.
[in] | v | The object's relative scale to set. |
Vector GetRelRot | ( | ) | const |
Gets the relative HPB rotation of the object.
void SetRelRot | ( | const Vector & | v | ) |
Sets the relative HPB rotation of the object.
[in] | v | The object's relative rotation to set. |
const Matrix& GetMl | ( | ) | const |
Gets the local matrix representing the object's position, scale and rotation.
void SetMl | ( | const Matrix & | m | ) |
Sets the local matrix representing the object's position, scale and rotation.
[in] | m | The object's local matrix to set. |
Matrix GetFrozenMln | ( | ) | const |
Gets the frozen and normalized matrix of the object.
Matrix GetRelMln | ( | ) | const |
Gets the relative and normalized matrix of the object.
Matrix GetRelMl | ( | ) | const |
Gets the relative matrix of the object.
void SetRelMl | ( | const Matrix & | m | ) |
Sets the relative matrix of the object.
[in] | m | The object's relative matrix to set. |
Matrix GetMg | ( | ) | const |
Gets the world (global) matrix representing the object's position, scale and rotation.
void SetMg | ( | const Matrix & | m | ) |
Sets the world (global) matrix representing the object's position, scale and rotation.
[in] | m | The object's world matrix to set. |
Matrix GetMln | ( | ) | const |
Gets the local normalized matrix representing the object's position, scale and rotation.
Matrix GetMgn | ( | ) | const |
Gets the world (global) normalized matrix representing the object's position, scale and rotation.
Matrix GetUpMg | ( | ) | const |
Gets the world (global) matrix of the parent object representing the parent's position, scale and rotation.
If the object has no parent object then the method returns a unit matrix.
void CopyMatrixTo | ( | BaseObject * | dst | ) | const |
Copies the object's matrix to another object.
[in,out] | dst | The destination object to copy the matrix to. |
Vector GetMp | ( | ) | const |
Gets the object's bounding box center in local space.
Vector GetRad | ( | ) | const |
Gets the object's bounding box radius (x/y/z).
Gets the object's bounding box center in local space. This call combines the GetMp()/GetRad() in one call and is much more performant if you need both values.
[out] | mp | center of the object |
[out] | rad | radius of the object |
Int32 GetEditorMode | ( | ) | const |
Gets the mode of the editor dot for the object.
Int32 GetEditorModeH | ( | ) | const |
Gets the mode of the editor dot for the object.
void SetEditorMode | ( | Int32 | mode | ) |
Sets the mode for of editor dot for the object.
[in] | mode | The editor mode to set: MODE |
Int32 GetRenderMode | ( | ) | const |
Gets the mode of the render dot for the object.
Int32 GetRenderModeH | ( | ) | const |
Gets the mode of the render dot for the object.
void SetRenderMode | ( | Int32 | mode | ) |
Sets the mode of the render dot for the object.
[in] | mode | The render mode to set: MODE |
Bool GetDeformMode | ( | ) | const |
Gets the enabled mode of the deformation/generator tick.
void SetDeformMode | ( | Bool | mode | ) |
Sets the enabled mode of the deformation/generator tick.
[in] | mode | true to enable the generator/deformer object, otherwise false. |
Int32 GetRealDeformMode | ( | ) | const |
Gets the real deform mode (MODE_ON, MODE_OFF, MODE_UNKNOWN).
void SetRealDeformMode | ( | Int32 | mode | ) |
Sets the real deform mode (MODE_ON, MODE_OFF, MODE_UNKNOWN).
[in] | mode | MODE_ON, MODE_OFF or MODE_UNKNOWN. |
Int32 GetUniqueIP | ( | ) | const |
Gets the IP number for the object.
GetUniqueIP() and SetUniqueIP() allow Cinema 4D to identify and track objects between different frames (which is necessary for stuff like object motion blur).
In case of a static generator that is easy: for every frame there is exactly the same structure.
For a particle system however that is different: e.g. there could always be 3 objects (particles), but some might be the same, some might be new ones.
To allow Cinema 4D to track that stuff an IP-like system is used: each object can carry a unique Int32 number and Cinema 4D creates full paths from it, e.g. 5.7.102.43.65.2
This is done 100% internally.
Only generator objects that have variable output or generator objects that use GetHierarchyClone() need to program some extra lines.
Such objects need to set the bit OBJECT_UNIQUEENUMERATION. Then it needs to assign unique Int32 values to all objects returned (except for the top-level object, which is handled by Cinema 4D).
Example:
A generator has 3 objects, but those objects appear and disappear during time. Say that obj3
is child of obj1
; obj1
and obj2
are children of main
(which is returned). obj2
and obj3
might not be present:
The generator will call:
That is all that is needed. Cinema 4D will recognize which object matches another object at a different time.
If GetHierarchyClone() is called those objects already have a unique numeration. It is only needed to assign a unique value to the top level:
void SetUniqueIP | ( | Int32 | ip | ) |
BaseTag* GetFirstTag | ( | ) |
Gets the first tag associated with the object.
const BaseTag* GetFirstTag | ( | ) | const |
BaseTag* GetLastTag | ( | ) |
Gets the last tag associated with the object.
const BaseTag* GetLastTag | ( | ) | const |
Gets a tag of a certain type associated with the object.
[in] | type | The type of tag to fetch from the object: Tag Types |
[in] | nr | Optionally specify a starting tag index to begin the search. If the requested number is not available then nullptr will be returned even if there is a tag of that type with a different index. |
maxon::Block<const BaseTag* const> GetTagsOfType | ( | Int32 | type | ) | const |
Gets an array of tags of a certain type associated with the object.
[in] | type | The type of tags to fetch from the object: Tag Types |
maxon::Block<BaseTag* const> GetTagsOfType | ( | Int32 | type | ) |
Gets an array of tags of a certain type associated with the object.
[in] | type | The type of tags to fetch from the object: Tag Types |
Gets a variable tag's readable data of a certain type associated with the object.
[in] | type | The type of tag to fetch the data for: VariableTag Types |
[in] | nr | Optionally specify a starting tag index to begin the search. |
Gets a variable tag's writable data of a certain type associated with the object.
[in] | type | The type of tag to fetch the data for: VariableTag Types |
[in] | nr | Optionally specify a starting tag index to begin the search. |
Gets the variable tag data count.
[in] | type | The type of tag to fetch the data for: VariableTag Types |
Gets the copy-on-write reference to the data of a variable tag of a certain type associated with the object.
[in] | type | The type of tag to fetch the data for: VariableTag Types |
[in] | nr | Optionally specify a starting tag index to begin the search. |
Creates and associates a tag with the object.
[in] | type | The type of tag to create: Tag Types |
[in] | pred | The previous tag to insert the tag after, or nullptr if the tag should be inserted at the start of the tag list. The caller owns the pointed tag. |
VariableTag* MakeVariableTag | ( | Int32 | type, |
Int32 | count, | ||
BaseTag * | pred = nullptr |
||
) |
Creates and associates a variable tag with the object.
[in] | type | The type of variable tag to create: VariableTag Types |
[in] | count | The data count. |
[in] | pred | The previous tag to insert the tag after, or nullptr if the tag should be inserted at the start of the tag list. The caller owns the pointed tag. |
Inserts tag into the object's tag list.
[in] | tp | The tag to insert. The object takes over the ownership of the pointed tag. |
[in] | pred | The previous tag to insert the tag after, or nullptr if the tag should be inserted at the start of the tag list. The caller owns the pointed tag. |
Removes a tag from the object and frees its resources.
[in] | type | The type of tag to remove: Tag Types |
[in] | nr | Optionally specify a starting tag index to begin the search. |
Bool CopyTagsTo | ( | BaseObject * | dest, |
Int32 | visible, | ||
Int32 | variable, | ||
Int32 | hierarchical, | ||
AliasTrans * | trans | ||
) | const |
Copies the object's tags to another object.
[in] | dest | The destination object. The caller owns the pointed object. |
[in] | visible | true if the tag must be visible, false if it must not be visible or NOTOK if it can be either (if this property does not need to be checked). |
[in] | variable | true if the tag must be variable, false if it must not be variable or NOTOK if it can be either (if this property does not need to be checked). |
[in] | hierarchical | true if the tag must be hierarchical, false if it must not be hierarchical or NOTOK if it can be either (if this property does not need to be checked). |
[in] | trans | An alias translator for the operation. Can be nullptr. The caller owns the pointed alias translator. |
BaseObject* GetCache | ( | ) |
Gets the object from the previously built cache.
Situations can be quite complex in Cinema 4D. For instance GetCache() could return a list of objects.
For example the default Sweep Generator internally has some built-in caches for the sweep surface and for the caps.
The following helper routine can be used to make things easier. It browses through this rather complex hierarchy of objects and caches recursively:
Remember:
Use the above routine only if the caches are already built. It is for instance not safe to use it in a command plugin since the user can have stopped the scene redraw and the building of caches.
const BaseObject* GetCache | ( | ) | const |
Gets the object from the previously built cache.
Situations can be quite complex in Cinema 4D. For instance GetCache() could return a list of objects.
For example the default Sweep Generator internally has some built-in caches for the sweep surface and for the caps.
The following helper routine can be used to make things easier. It browses through this rather complex hierarchy of objects and caches recursively:
Remember:
Use the above routine only if the caches are already built. It is for instance not safe to use it in a command plugin since the user can have stopped the scene redraw and the building of caches.
BaseObject* GetDeformCache | ( | ) |
Gets the previously built cache that has been deformed by an active deformer.
It is important to understand the concept how the deformer cache operates.
For each object in the hierarchy that generates a polygonal cache a deformer cache could also have been created by an active deformer object.
A simple example will help to see how this works:
Take the simple hierarchy shown above, the array generator object creates a virtual hierarchy in the cache, this can be retrieved using GetCache().
This hierarchy is:
From each of the Cube objects a further cache is generated, this time polygonal:
From these the deformer object generates a deformed polygon cache:
So the final hierarchy is:
When a deformer becomes active every object/cache object gets a deform cache (if it was a polygonal object). The deformer cache is always polygonal and is only ever a single object.
Important:
The caches are always built after all plugins and expressions have been called.
If the virtual objects have to be accessed to obtain a polygonal based object it is generally advised to call SendModelingCommand() with MCOMMAND_CURRENTSTATETOOBJECT::
This will rebuild the cache for the passed object if needed, and then clone the polygonal objects.
Another possible solution is to use the Hierarchy class, this will give full access to all virtual objects, or can be used to just rebuild the internal caches.
But be aware that rebuilding the internal caches can cause serious overhead, be time consuming and if called too soon in the pipeline, the caches may need to be rebuilt afterwards.
const BaseObject* GetDeformCache | ( | ) | const |
Gets the previously built cache that has been deformed by an active deformer.
It is important to understand the concept how the deformer cache operates.
For each object in the hierarchy that generates a polygonal cache a deformer cache could also have been created by an active deformer object.
A simple example will help to see how this works:
Take the simple hierarchy shown above, the array generator object creates a virtual hierarchy in the cache, this can be retrieved using GetCache().
This hierarchy is:
From each of the Cube objects a further cache is generated, this time polygonal:
From these the deformer object generates a deformed polygon cache:
So the final hierarchy is:
When a deformer becomes active every object/cache object gets a deform cache (if it was a polygonal object). The deformer cache is always polygonal and is only ever a single object.
Important:
The caches are always built after all plugins and expressions have been called.
If the virtual objects have to be accessed to obtain a polygonal based object it is generally advised to call SendModelingCommand() with MCOMMAND_CURRENTSTATETOOBJECT::
This will rebuild the cache for the passed object if needed, and then clone the polygonal objects.
Another possible solution is to use the Hierarchy class, this will give full access to all virtual objects, or can be used to just rebuild the internal caches.
But be aware that rebuilding the internal caches can cause serious overhead, be time consuming and if called too soon in the pipeline, the caches may need to be rebuilt afterwards.
LineObject* GetIsoparm | ( | ) |
Gets the previously built isoparm representation of the object.
void SetIsoparm | ( | LineObject * | l | ) |
Sets the isoparm representation of the object.
[in] | l | The isoparm representation of the object to set. The object takes over the ownership of the pointed isoparm. |
BaseObject* GetCacheParent | ( | ) | const |
A cache/deform object has no GetUp() link. Instead this method can be called to detect the cache building parent.
BaseObject* GetCacheTopParent | ( | ) | const |
A cache/deform object has no GetUp() link. Instead this method can be called to detect the top cache building parent.
Sets the phong smoothing for the object.
Deletes any existing Phong tag. If on is set to true it creates a new Phong tag.
[in] | on | false removes the Phong tag from the object. true creates a new Phong tag. |
[in] | anglelimit | true if angle should be used. |
[in] | angle | The phong angle. |
Bool IsDirty | ( | DIRTYFLAGS | flags | ) | const |
Checks if the object has been changed since the last time the object was touched.
[in] | flags | The object part to check: DIRTYFLAGS |
void SetDirty | ( | DIRTYFLAGS | flags | ) |
Sets if any part of the object was changed.
[in] | flags | The object part that was changed: DIRTYFLAGS |
Bool CheckCache | ( | const HierarchyHelp * | hh | ) | const |
Check if cache is built and if it matches the requirements (polygonized/isoparm, level of detail etc.)
[in] | hh | A HierarchyHelp, usually passed from the calling method parameters, for instance ObjectData::GetVirtualObjects(). |
void Touch | ( | ) |
Marks object to be used by generator. Automatically resets dirty values for use with IsDirty().
void GetColorProperties | ( | ObjectColorProperties * | prop | ) | const |
Gets the object's color properties and fill prop.
[in] | prop | Filled with the color properties. The caller owns the pointed color properties. |
void SetColorProperties | ( | ObjectColorProperties * | prop | ) |
Sets the object's color properties from prop.
[in] | prop | The color properties to set. The caller owns the pointed color properties. |
maxon::Opt<maxon::Color> GetDisplayColor | ( | ) | const |
Returns the selected display color of the object.
const Matrix& GetModelingAxis | ( | BaseDocument * | doc | ) |
Gets the internal matrix for the modeling axis.
[in] | doc | The document for the operation. The caller owns the pointed document. |
void SetModelingAxis | ( | const Matrix & | m | ) |
Sets the internal matrix for the modeling axis.
[in] | m | The new modeling axis to set. |
BaseObject* GetAndCheckHierarchyClone | ( | const HierarchyHelp * | hh, |
BaseObject * | op, | ||
HIERARCHYCLONEFLAGS | flags, | ||
Bool * | dirty, | ||
AliasTrans * | trans, | ||
Int | childCount, | ||
maxon::BaseArray< BaseObject * > * | children, | ||
Bool | addChildOrClone = false |
||
) |
Checks and generates a clone of the child objects of a parent generator.
Similar to GetHierarchyClone() except that it checks if the hierarchy is dirty and if not it does not need to generate a new clone.
[in] | hh | Usually passed through from a calling method, for instance from ObjectData::GetVirtualObjects(). The caller owns the pointed hierarchy helper. |
[in] | op | The object to start the clone from, usually the first child of the parent object. The caller owns the pointed object. |
[in] | flags | The flags for the generation of the cloned chain. The values are: HIERARCHYCLONEFLAGS |
[in] | dirty | Assigned the state of any changes to the chain. true if some part of the child objects in the chain has changed, otherwise false. |
[in] | trans | An alias translator for the operation. Can be nullptr. The caller owns the pointed alias translator. |
[in] | childCount | Maximum number of children to check (starting at the first child). With a negative value the function checks exactly one child and doesn't create a parent Null object for the clones. |
[in] | children | An optional array where the generated clones are added. For each child there will be one entry, even if no clone is generated for that child (then the entry will be nullptr or the child depending on addChildOrClone). Note that this array gets filled only in the dirty case. |
[in] | addChildOrClone | When true, the original child will be added to children instead of a nullptr in the case of a child which doesn't generate a clone. |
BaseObject* GetAndCheckHierarchyClone | ( | const HierarchyHelp * | hh, |
BaseObject * | op, | ||
HIERARCHYCLONEFLAGS | flags, | ||
Bool * | dirty, | ||
AliasTrans * | trans, | ||
Bool | allchildren | ||
) |
Checks and generates a clone of the child objects of a parent generator.
Similar to GetHierarchyClone() except that it checks if the hierarchy is dirty and if not it does not need to generate a new clone.
[in] | hh | Usually passed through from a calling method, for instance from ObjectData::GetVirtualObjects(). The caller owns the pointed hierarchy helper. |
[in] | op | The object to start the clone from, usually the first child of the parent object. The caller owns the pointed object. |
[in] | flags | The flags for the generation of the cloned chain. The values are: HIERARCHYCLONEFLAGS |
[in] | dirty | Assigned the state of any changes to the chain. true if some part of the child objects in the chain has changed, otherwise false. |
[in] | trans | An alias translator for the operation. Can be nullptr. The caller owns the pointed alias translator. |
[in] | allchildren | true if all children should be used in the check. |
BaseObject* GetHierarchyClone | ( | const HierarchyHelp * | hh, |
BaseObject * | op, | ||
HIERARCHYCLONEFLAGS | flags, | ||
Bool * | dirty, | ||
AliasTrans * | trans | ||
) |
Generates a clone of the child objects of a parent generator.
[in] | hh | Usually passed through from a calling method, for instance from ObjectData::GetVirtualObjects(). The caller owns the pointed hierarchy helper. |
[in] | op | The object to start the clone from, usually the parent object itself. The caller owns the pointed object. |
[in] | flags | The flags for the generation of the cloned chain. The values are: HIERARCHYCLONEFLAGS |
[in] | dirty | Has to be set to nullptr for the cloning to take place. Set to true if some part of the child objects in the chain has changed, or false if nothing has changed. |
[in] | trans | An alias translator for the operation. Can be nullptr. The caller owns the pointed alias translator. |
BaseObject* GetHierarchyClone | ( | const HierarchyHelp * | hh, |
BaseObject * | op, | ||
HIERARCHYCLONEFLAGS | flags, | ||
Bool * | dirty, | ||
AliasTrans * | trans, | ||
DIRTYFLAGS | dirtyflags | ||
) |
Generates a clone of the child objects of a parent generator. This version accepts dirtyflags parameter.
[in] | hh | Usually passed through from a calling method, for instance from ObjectData::GetVirtualObjects(). The caller owns the pointed hierarchy helper. |
[in] | op | The object to start the clone from, usually the parent object itself. The caller owns the pointed object. |
[in] | flags | The flags for the generation of the cloned chain. The values are: HIERARCHYCLONEFLAGS |
[in] | dirty | Has to be set to nullptr for the cloning to take place. Set to true if some part of the child objects in the chain has changed, or false if nothing has changed. |
[in] | trans | An alias translator for the operation. Can be nullptr. The caller owns the pointed alias translator. |
[in] | dirtyflags | The dirty flags stored within the dependence list. |
void NewDependenceList | ( | ) |
Starts a new dependence list. Enables to keep track of changes made to any children.
Bool CompareDependenceList | ( | ) |
Compares if anything in the dependence list has changed.
void AddDependence | ( | const BaseObject * | op | ) |
Adds a child object to the dependence list.
Usually op is a child object used by a generator object.
[in] | op | The child object to add to the dependence list. Should be a child object used by the generator object. The caller owns the pointed object. |
void AddDependence | ( | const BaseObject * | op, |
DIRTYFLAGS | dirtyflags | ||
) |
Adds a child object to the dependence list. This version accepts dirtyflags parameter.
[in] | op | The child object to add to the dependence list. Should be a child object used by the generator object. The caller owns the pointed object. |
[in] | dirtyflags | The dirty flags stored within the dependence list. |
void TouchDependenceList | ( | ) |
Marks all the objects in the dependence list to be replaced by the generator.
void SetRotationOrder | ( | ROTATIONORDER | order | ) |
Sets the rotation order of the object.
[in] | order | The rotation order to set for the object: ROTATIONORDER |
ROTATIONORDER GetRotationOrder | ( | ) | const |
Gets the rotation order of the object.
Sets the Synchronized Rotation Mode of the object.
[in] | active | Enable/Disable the Synchronized Rotation mode for the object. |
[in] | bUndo | Add undo to value changed (need to manage start and end externally). |
Bool IsQuaternionRotationMode | ( | ) | const |
Checks if Object Rotation is interpolated in Quaternion Mode.
Bool SynchronizeVectorTrackKeys | ( | Int32 | vectorTrackID, |
Bool | bUndo, | ||
BaseTime | startRange = BaseTime(-108000, 1) , |
||
BaseTime | endRange = BaseTime(108000, 1) |
||
) |
Makes sure that the track Curves component are synchronized (keys on each component). If a component track is found, the other track component will be synchronized.
[in] | vectorTrackID | ID of the Vector Track to synchronize. |
[in] | bUndo | Add undo to value changed (need to manage start and end externally). |
[in] | startRange | Optional start operation at given time. |
[in] | endRange | Optional end operation at given time. |
Bool FindBestEulerAngle | ( | Int32 | rotationTrackID, |
Bool | bAdjustTangent, | ||
Bool | bUndo, | ||
BaseTime | startRange = BaseTime(-108000, 1) , |
||
BaseTime | endRange = BaseTime(108000, 1) |
||
) |
Tries to find the best Euler Angle according to the previous key. The Object must have keys on each component.
[in] | rotationTrackID | Rotation Track ID to manage (relative, global, absolute, frozen). |
[in] | bAdjustTangent | Try to adjust the tangent with new value, if false auto is used. |
[in] | bUndo | Add undo to value changed (need to manage start and end externally). |
[in] | startRange | Optional start operation at given time. |
[in] | endRange | Optional end operation at given time. |
Bool EvaluateSynchronizedRotation | ( | const BaseTime & | time, |
ANIMATEFLAGS | flags, | ||
Vector * | resultRotation = nullptr |
||
) |
Forces an evaluation of all rotation tracks and consider Quaternion interpolation. This will directly update attribute values if no vector is specified for resultRotation.
[in] | time | Evaluation time. |
[in] | flags | The animate flags: ANIMATEFLAGS |
[in] | resultRotation | Optionally store result in Vector instead of updating attributes. |
Returns each component track for the given DescID.
[in] | id | ID of desired vector. |
[out] | xfound | X Track of Vector if found. |
[out] | yfound | Y Track of Vector if found. |
[out] | zfound | Z Track of Vector if found. |
UInt64 GetGUID | ( | ) | const |
Gets a unique ID for any object in a document.
Works for generated objects in a cache (e.g. clones generated by a MoGraph cloner) and also for 'real' objects in the document (GetUniqueIP() does not do this).
Checks if a highlight handle has been hit.
Returns the handle ID previously given by ObjectData::DetectHandle(). The handle can then be drawn in the highlight mode.
[in] | bd | The base draw for the operation. The caller owns the pointed base draw. |
SplineObject* GetRealSpline | ( | ) |
Gets a real spline representation of a primitive spline object.
This can for example be used to calculate the length of a spline.
If the object is a real spline it returns this
. Otherwise nullptr.
*this
instead. const SplineObject* GetRealSpline | ( | ) | const |
Gets the object's visibility value. The range of values are 0.0 <= visibility <= 1.0.
The object's visibility depends upon its parent, if it has no visibility track this will return the parent's visibility which is passed.
[in] | parent | The parent object's visibility. |
Bool SearchHierarchy | ( | const BaseObject * | op | ) | const |
Checks if the object is a child of op.
[in] | op | The object to search within his hierarchy. |
BaseObject* GetOrigin | ( | Bool | safe | ) |
Private.
const BaseObject* GetOrigin | ( | Bool | safe | ) | const |
Private.
void SetOrigin | ( | BaseObject * | origin | ) |
Private.
BaseObject* GetTopOrigin | ( | Bool | parent, |
Bool | safe | ||
) | const |
Private.
BaseObject* GetEditObject | ( | BaseObject ** | psds, |
DISPLAYEDITSTATE | state, | ||
Bool | safetey = true |
||
) | const |
Private.
void RemoveFromCache | ( | Bool | clearParentObject = true | ) |
Private.
DRAWRESULT ObjDraw | ( | DRAWPASS | drawpass, |
BaseDraw * | bd, | ||
BaseDrawHelp * | bh | ||
) |
Private.
maxon::Tuple<Bool, maxon::HashInt> GetObjectDrawHash | ( | Int32 | type | ) | const |
Private.
void GetDrawStateData | ( | void * | state | ) | const |
Private.
const Matrix& GetDeformMatrix | ( | ) | const |
Gets the deformation matrix.
void SetDeformMatrix | ( | const Matrix & | dm | ) |
Sets the deformation of the local matrix.
[in] | dm | The matrix that deforms the local matrix. |
void ClearDeformMatrix | ( | ) |
Clears the deformation of the local matrix.
const Matrix& GetUndeformedMl | ( | ) | const |
Gets the undeformed local matrix.
const Matrix& GetUndeformedMlInverse | ( | ) | const |
Gets the inverse of the undeformed local matrix. It does not recompute it if the undeformed local matrix is unchanged since last call.
Matrix GetUndeformedMg | ( | ) | const |
Gets the global matrix without any matrix deformation applied in the hierarchy.
Bool HasDeformMatrix | ( | ) | const |
Returns true if the object has a deform matrix.