#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 (void) |
BaseObject * | GetPred (void) |
BaseObject * | GetUp (void) |
BaseObject * | GetDown (void) |
BaseObject * | GetDownLast (void) |
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 (void) 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) |
Bounding Box | |
Vector | GetMp (void) |
Vector | GetRad (void) |
void | GetDimension (Vector &mp, Vector &rad) |
Editor/Render/Deform Mode | |
Int32 | GetEditorMode (void) const |
Int32 | GetEditorModeH (void) const |
void | SetEditorMode (Int32 mode) |
Int32 | GetRenderMode (void) const |
Int32 | GetRenderModeH (void) const |
void | SetRenderMode (Int32 mode) |
Bool | GetDeformMode (void) const |
void | SetDeformMode (Bool mode) |
Int32 | GetRealDeformMode (void) const |
void | SetRealDeformMode (Int32 mode) |
Unique IP | |
Int32 | GetUniqueIP (void) |
void | SetUniqueIP (Int32 ip) |
Tag | |
BaseTag * | GetFirstTag (void) |
BaseTag * | GetLastTag (void) |
BaseTag * | GetTag (Int32 type, Int32 nr=0) |
const maxon::BaseArray< BaseTag * > * | GetTagsOfType (Int32 type) const |
const maxon::BaseArray< BaseTag * > * | GetTagsWithFlags (Int32 flags) const |
const void * | GetTagDataR (Int32 type, Int32 nr=0) const |
void * | GetTagDataW (Int32 type, Int32 nr=0) |
Int32 | GetTagDataCount (Int32 type) 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) |
Cache | |
BaseObject * | GetCache (HierarchyHelp *hh=nullptr) |
BaseObject * | GetDeformCache (void) |
LineObject * | GetIsoparm (void) |
void | SetIsoparm (LineObject *l) |
BaseObject * | GetCacheParent (void) const |
BaseObject * | GetCacheTopParent (void) const |
Phong | |
Bool | SetPhong (Bool on, Bool anglelimit, Float angle) |
Dirty | |
Bool | IsDirty (DIRTYFLAGS flags) |
void | SetDirty (DIRTYFLAGS flags) |
Bool | CheckCache (HierarchyHelp *hh) |
void | Touch (void) |
Color Properties | |
void | GetColorProperties (ObjectColorProperties *prop) |
void | SetColorProperties (ObjectColorProperties *prop) |
Modeling Axis | |
const Matrix & | GetModelingAxis (BaseDocument *doc) |
void | SetModelingAxis (const Matrix &m) |
Hierarchy Clone | |
BaseObject * | GetAndCheckHierarchyClone (HierarchyHelp *hh, BaseObject *op, HIERARCHYCLONEFLAGS flags, Bool *dirty, AliasTrans *trans, Int childCount, maxon::BaseArray< BaseObject * > *children) |
BaseObject * | GetAndCheckHierarchyClone (HierarchyHelp *hh, BaseObject *op, HIERARCHYCLONEFLAGS flags, Bool *dirty, AliasTrans *trans, Bool allchildren) |
BaseObject * | GetHierarchyClone (HierarchyHelp *hh, BaseObject *op, HIERARCHYCLONEFLAGS flags, Bool *dirty, AliasTrans *trans) |
BaseObject * | GetHierarchyClone (HierarchyHelp *hh, BaseObject *op, HIERARCHYCLONEFLAGS flags, Bool *dirty, AliasTrans *trans, DIRTYFLAGS dirtyflags) |
Dependence List | |
void | NewDependenceList (void) |
Bool | CompareDependenceList (void) |
void | AddDependence (HierarchyHelp *hh, BaseObject *op) |
void | AddDependence (HierarchyHelp *hh, BaseObject *op, DIRTYFLAGS dirtyflags) |
void | TouchDependenceList (void) |
Rotation Order | |
void | SetRotationOrder (ROTATIONORDER order) |
ROTATIONORDER | GetRotationOrder (void) const |
Synchronized Rotation Mode | |
void | SetQuaternionRotationMode (Bool active, Bool bUndo) |
Bool | IsQuaternionRotationMode (void) |
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 () |
Int32 | GetHighlightHandle (BaseDraw *bd) |
SplineObject * | GetRealSpline (void) |
Float | GetVisibility (Float parent) |
Bool | SearchHierarchy (BaseObject *op) |
Private | |
BaseObject * | GetOrigin (Bool safe) |
void | SetOrigin (BaseObject *origin) |
BaseObject * | GetTopOrigin (Bool parent, Bool safe) |
BaseObject * | GetEditObject (BaseObject **psds, DISPLAYEDITSTATE state, Bool safetey=true) |
void | RemoveFromCache (void) |
DRAWRESULT | ObjDraw (DRAWPASS drawpass, BaseDraw *bd, BaseDrawHelp *bh) |
|
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 | ( | void | ) |
Gets the next object in the list. Convenience version of GeListNode::GetNext().
BaseObject* GetPred | ( | void | ) |
Gets the previous object in the list. Convenience version of GeListNode::GetPred().
BaseObject* GetUp | ( | void | ) |
Gets the parent object of the list node. Convenience version of GeListNode::GetUp().
BaseObject* GetDown | ( | void | ) |
Gets the first child object of the list node. Convenience version of GeListNode::GetDown().
BaseObject* GetDownLast | ( | void | ) |
Gets the last child base object of the list node. Convenience version of GeListNode::GetDownLast().
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 | ( | void | ) | 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 | ( | void | ) | 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 | ) |
Copies the object's matrix to another object.
[in,out] | dst | The destination object to copy the matrix to. |
Vector GetMp | ( | void | ) |
Gets the object's bounding box center in local space.
Vector GetRad | ( | void | ) |
Gets the object's bounding box radius (x/y/z).
GetDimension description.
[out] | mp | center of the object |
[out] | rad | radius of the object |
Int32 GetEditorMode | ( | void | ) | const |
Gets the mode of the editor dot for the object.
Int32 GetEditorModeH | ( | void | ) | 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 | ( | void | ) | const |
Gets the mode of the render dot for the object.
Int32 GetRenderModeH | ( | void | ) | 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 | ( | void | ) | 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 | ( | void | ) | 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 | ( | void | ) |
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 | ( | void | ) |
Gets the first tag associated with the object.
BaseTag* GetLastTag | ( | void | ) |
Gets the last tag associated with the object.
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. |
const maxon::BaseArray<BaseTag*>* 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 |
const maxon::BaseArray<BaseTag*>* GetTagsWithFlags | ( | Int32 | flags | ) | const |
Gets an array of tags with certain flags associated with the object.
[in] | flags | The flags 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 |
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 | ||
) |
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 | ( | HierarchyHelp * | hh = nullptr | ) |
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.
[in] | hh | A hierarchy help, usually passed from the calling method parameters, for example ObjectData::GetVirtualObjects(). The caller owns the pointed hierarchy help. Usually nullptr. Only for some special cases a hierarchy help must be passed. |
BaseObject* GetDeformCache | ( | void | ) |
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 | ( | void | ) |
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 | ( | void | ) | const |
A cache/deform object has no GetUp() link. Instead this method can be called to detect the cache building parent.
BaseObject* GetCacheTopParent | ( | void | ) | 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 | ) |
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 | ( | HierarchyHelp * | hh | ) |
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 | ( | void | ) |
Marks object to be used by generator. Automatically resets dirty values for use with IsDirty().
void GetColorProperties | ( | ObjectColorProperties * | prop | ) |
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. |
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 | ( | HierarchyHelp * | hh, |
BaseObject * | op, | ||
HIERARCHYCLONEFLAGS | flags, | ||
Bool * | dirty, | ||
AliasTrans * | trans, | ||
Int | childCount, | ||
maxon::BaseArray< BaseObject * > * | children | ||
) |
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 a nullptr). Note that this array gets filled only in the dirty case. |
BaseObject* GetAndCheckHierarchyClone | ( | 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 | ( | 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 | ( | 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 | ( | void | ) |
Starts a new dependence list. Enables to keep track of changes made to any children.
Bool CompareDependenceList | ( | void | ) |
Compares if anything in the dependence list has changed.
void AddDependence | ( | HierarchyHelp * | hh, |
BaseObject * | op | ||
) |
Adds a child object to the dependence list.
Usually op is a child object used by a generator object.
[in] | hh | Usually passed from a calling method, for example from ObjectData::GetVirtualObjects(). The caller owns the pointed hierarchy help. |
[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 | ( | HierarchyHelp * | hh, |
BaseObject * | op, | ||
DIRTYFLAGS | dirtyflags | ||
) |
Adds a child object to the dependence list. This version accepts dirtyflags parameter.
[in] | hh | Usually passed from a calling method, for example from ObjectData::GetVirtualObjects(). The caller owns the pointed hierarchy help. |
[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 | ( | void | ) |
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 | ( | void | ) | 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 | ( | void | ) |
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 | ( | ) |
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 | ( | void | ) |
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. 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 | ( | BaseObject * | op | ) |
Checks if the object is a child of op.
[in] | op | The object to search within his hierarchy. |
BaseObject* GetOrigin | ( | Bool | safe | ) |
Private.
void SetOrigin | ( | BaseObject * | origin | ) |
Private.
BaseObject* GetTopOrigin | ( | Bool | parent, |
Bool | safe | ||
) |
Private.
BaseObject* GetEditObject | ( | BaseObject ** | psds, |
DISPLAYEDITSTATE | state, | ||
Bool | safetey = true |
||
) |
Private.
void RemoveFromCache | ( | void | ) |
Private.
DRAWRESULT ObjDraw | ( | DRAWPASS | drawpass, |
BaseDraw * | bd, | ||
BaseDrawHelp * | bh | ||
) |
Private.