#include <c4d_basedocument.h>
Public Types | |
typedef BaseList2D | SUPER |
![]() | |
typedef GeListNode | SUPER |
![]() | |
typedef PrivateChunk | SUPER |
Protected Member Functions | |
void | CopyToPresetSettings (const CKey &fromKey) |
void | RestoreFromPresetSettings (CKey &toKey) const |
![]() | |
void | SetID (Int32 id) |
virtual Int32 | GetInstanceType () const |
Protected Attributes | |
CDefaultKey | cdefaultkey |
CDefaultKey | cCustomkey |
![]() | |
Int32 | m_id |
RootShader | mp_rootshader |
RootShader | mp_rootshader_hidden |
RootShader | root_shader_repository |
Int32 | l_bitfeld |
RootCTrack | mp_rootctrack |
RootPluginNode | root_override |
NotifyList * | notify_events |
DescIdStore * | keyframestore |
DescIdStore * | propstore |
BaseContainer | m_bc |
NodeData * | m_data |
![]() | |
GeAliasGoal | m_xgoal |
UInt32 | m_bits [4] |
RootList2D * | t_rootlist_parent |
RootList2D * | m_children |
BaseDocument * | parent_doc |
void * | unknownData |
Int | unknownDataSize |
Int32 | unknownDataLevel |
Int32 | pluginID |
Private Member Functions | |
virtual Bool | GetDParameter (const DescID &id, GeData &data) |
virtual Bool | SetDParameter (const DescID &id, const GeData &data) |
virtual Bool | CopyToX (PrivateChunk *dst, COPYFLAGS flags, AliasTrans *trn) |
ViewPanel * | GetFirstViewPanel () |
void | ClearDocument () |
Friends | |
class | CKey |
class | CCurve |
class | PrivateChunk |
BaseDocument * | LoadDocument (const Filename &name, SCENEFILTER loadflags) |
Constructor/Destructor | |
BaseDocument () | |
virtual | ~BaseDocument () |
Allocation/Free | |
virtual Int32 | GetType () const |
static BaseDocument * | Alloc () |
static void | Free (BaseDocument *&v) |
Navigation | |
BaseDocument * | GetNext () |
BaseDocument * | GetPred () |
Cloning | |
virtual BaseList2D * | GetClone (COPYFLAGS flags, AliasTrans *trans) |
Create from/to Cinema 4D | |
virtual Bool | CreateSceneFromC4D () |
virtual Bool | CreateSceneToC4D (Bool selectedOnly) |
virtual Bool | CreateObjectFromC4D (BaseObject *obj) |
virtual Bool | CreateLayerFromC4D (LayerObject *lay) |
Get First Object/Material/RenderData/Layer | |
BaseObject * | GetFirstObject () |
BaseMaterial * | GetFirstMaterial () |
RenderData * | GetFirstRenderData () |
BaseSceneHook * | GetFirstSceneHook () |
BaseSceneHook * | FindSceneHook (Int32 id) |
LayerObject * | GetFirstLayer () |
Insert Object/Material/RenderData/Layer | |
Bool | InsertObject (BaseObject *op, BaseObject *parent, BaseObject *pred=nullptr) |
Bool | InsertMaterial (BaseMaterial *mat, BaseMaterial *pred=nullptr) |
Bool | InsertRenderData (RenderData *rd, RenderData *parent, RenderData *pred=nullptr) |
Bool | InsertRenderDataLast (RenderData *rd) |
Bool | InsertLayer (LayerObject *pLay, LayerObject *parent, LayerObject *pred=nullptr) |
Get/Set RenderData | |
RenderData * | GetActiveRenderData () const |
void | SetActiveRenderData (RenderData *rd) |
Time/Mode/Action/Fps | |
const BaseTime & | GetTime () const |
void | SetTime (const BaseTime &new_time) |
Int32 | GetMode () const |
void | SetMode (Int32 m) |
Int32 | GetAction () const |
void | SetAction (Int32 a) |
Int32 | GetFps () |
void | SetFps (Int32 fps) |
Editor Views | |
BaseDraw * | GetActiveBaseDraw () |
BaseDraw * | GetRenderBaseDraw () |
BaseDraw * | GetBaseDraw (Int32 num) |
Int32 | GetBaseDrawCount () |
void | GetDefaultClippingPlanes (Float &near, Float &far, const GeData *d=nullptr) |
Cineware SDK Convenience Methods | |
BaseObject * | GetSceneCamera () |
Bool | SetSceneCamera (BaseObject *opCam) |
BaseObject * | CreateSky () |
Miscellaneous | |
virtual Bool | Execute () |
BaseBitmap & | GetDocPreviewBitmap () |
Bool | GetDefaultKey (CKey *pKey, Bool &bOverdub) const |
void | SetDefaultKey (CKey *pKey, Bool bOverdub) |
Int32 | GetLastAction () const |
AxisState * | GetState () |
Bool | HasCaches () |
TakeData * | GetTakeData () |
Private | |
virtual BaseDocument * | GetDocument () const |
virtual Bool | HandleSubChunk (HyperFile *hf, Int32 id, Int32 level) |
virtual Bool | Write (HyperFile *hf) |
Contains the complete description of a Cinema 4D document.
typedef BaseList2D SUPER |
BaseDocument | ( | ) |
Default constructor.
|
virtual |
Default destructor.
|
virtual |
Reimplemented from BaseList2D.
Reimplemented from BaseList2D.
Reimplemented from BaseList2D.
|
privatevirtual |
Reimplemented from BaseList2D.
|
private |
|
private |
|
protected |
|
protected |
|
static |
Allocates a document. Destroy the allocated document with Free().
|
static |
Destructs documents allocated with Alloc().
[in,out] | v | The document to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
|
virtual |
Gets the object type for a document.
Reimplemented from BaseList2D.
BaseDocument* GetNext | ( | ) |
Gets the next document in the list. Convenience version of BaseList2D::GetNext() returning a pointer to a BaseDocument.
BaseDocument* GetPred | ( | ) |
Gets the previous document in the list. Convenience version of GeListNode::GetPred() returning a pointer to a BaseDocument.
|
virtual |
Gets a clone/copy of the document.
[in] | flags | Flags for the clone. |
[in] | trans | An alias translator for the operation. Can be nullptr. The caller owns the pointed object. |
Reimplemented from BaseList2D.
|
virtual |
Creates a scene from a Cinema 4D file in the external application.
The method goes through the scene structure (objects, material, layer) and build the scene, it calls the execute function of the Alien classes.
|
virtual |
Must be overloaded by the user.
Creates a Cinema 4D file from the external application. The user should go through the external scene structure (objects, materials, layers) and build the Cinema 4D document.
[in] | selectedOnly | Pass true to export the selection only, otherwise false. |
|
virtual |
Private.
|
virtual |
Private.
BaseObject* GetFirstObject | ( | ) |
Gets the first object of the document. The objects in the document can be looped through with BaseObject::GetNext(), BaseObject::GetPred(), BaseObject::GetDown() etc.
BaseMaterial* GetFirstMaterial | ( | ) |
Gets the first material of the document. The other materials in the document can be be looped through with BaseMaterial::GetNext() and BaseMaterial::GetPred().
RenderData* GetFirstRenderData | ( | ) |
Gets the first render data/settings of the document. The other render settings in the document can be looped trough with RenderData::GetNext(), RenderData::GetPred(), RenderData::GetDown() etc.
BaseSceneHook* GetFirstSceneHook | ( | ) |
Gets the first scene hook of the document. The other scene hooks in the document can be looped trough with BaseSceneHook::GetNext() and BaseSceneHook::GetPred().
BaseSceneHook* FindSceneHook | ( | Int32 | id | ) |
Finds a scene hook by ID.
[in] | id | The scene hook ID. |
LayerObject* GetFirstLayer | ( | ) |
Gets the first layer in the document. The other layers in the document can be looped trough with LayerObject::GetNext(), LayerObject::GetPred(), LayerObject::GetDown() etc.
Bool InsertObject | ( | BaseObject * | op, |
BaseObject * | parent, | ||
BaseObject * | pred = nullptr |
||
) |
Inserts the object into the document's object hierarchy.
Optionally the insertion position can either be specified by the parent parameter, inserting the object as the first child of the specified parent, or by the pred parameter, inserting the object below the specified pred object.
If neither is given, the object is inserted at the top of the hierarchy.
[in] | op | The object to insert into the document. The document takes over the ownership of the pointed object. |
[in] | parent | An optional parent object in the document to insert the object as a child of. Can be nullptr. The caller owns the pointed object. |
[in] | pred | An optional object in the document to use as insertion point. The caller owns the pointed object. |
Bool InsertMaterial | ( | BaseMaterial * | mat, |
BaseMaterial * | pred = nullptr |
||
) |
Inserts the material into the document's material list.
Optionally the insertion position can be specified by the pred parameter, giving the material before (just to the left of) the wanted position. Otherwise the material is inserted at the first position in the list.
[in] | mat | The material to insert into the document. The document takes over the ownership of the pointed material. |
[in] | pred | An optional material in the document to use as insertion point. The caller owns the pointed material. |
Bool InsertRenderData | ( | RenderData * | rd, |
RenderData * | parent, | ||
RenderData * | pred = nullptr |
||
) |
Inserts the render data into the document's render settings hierarchy.
Optionally the insertion position can either be specified by the parent parameter, inserting the render data as the first child of the specified parent, or by the pred parameter, inserting the render data below the specified pred render data.
If neither is given, the render data is inserted at the top of the hierarchy.
[in] | rd | The render data to insert. The document takes over the ownership of the pointed render data. |
[in] | parent | An optional parent to insert the render data as a child of. The caller owns the pointed render data. |
[in] | pred | An optional render data of the document to use as insertion point. The caller owns the pointed render data. |
Bool InsertRenderDataLast | ( | RenderData * | rd | ) |
Inserts the render data as last child into the document's render data list.
[in] | rd | The render data to insert. The document takes over the ownership of the pointed render data. |
Bool InsertLayer | ( | LayerObject * | pLay, |
LayerObject * | parent, | ||
LayerObject * | pred = nullptr |
||
) |
Inserts the layer into the document's layer list.
The insertion position can either be specified by the parent parameter, inserting the layer as the first child of the specified parent, or by the pred parameter, inserting the layer below the specified pred layer.
If neither is given, the layer is inserted at the top of the hierarchy.
[in] | pLay | The layer to insert. The document takes over the ownership of the pointed object. |
[in] | parent | An optional parent to insert the layer as a child of. The caller owns the pointed layer. |
[in] | pred | An optional layer of the document to use as insertion point. The caller owns the pointed layer. |
RenderData* GetActiveRenderData | ( | ) | const |
Gets the active render data for the document. These are the settings used for rendering the document.
void SetActiveRenderData | ( | RenderData * | rd | ) |
Sets the active render data for the document. These are the settings used for rendering the document.
[in] | rd | The render data/settings to make active. Must be in the document already. The document owns the pointed render data. |
const BaseTime& GetTime | ( | ) | const |
void SetTime | ( | const BaseTime & | new_time | ) |
Sets the current time for the document's Timeline.
[in] | new_time | The new current time of the Timeline. |
Int32 GetMode | ( | ) | const |
Gets the main editor mode.
void SetMode | ( | Int32 | m | ) |
Sets the main editor mode.
[in] | m | The main editor mode. |
Int32 GetAction | ( | ) | const |
Gets the current action tool in the editor.
void SetAction | ( | Int32 | a | ) |
Sets the current action tool in the editor.
[in] | a | The new action tool: ID_MODELING_MOVE, ID_MODELING_SCALE, ID_MODELING_ROTATE etc. |
Int32 GetFps | ( | ) |
Gets the number of Frames per Second (FPS).
void SetFps | ( | Int32 | fps | ) |
Sets the number of Frames per Second (FPS).
[in] | fps | The new number of Frames per Second. |
BaseDraw* GetActiveBaseDraw | ( | ) |
Gets the activate view in the editor.
BaseDraw* GetRenderBaseDraw | ( | ) |
Gets the view the user has chosen as Render View in the editor (see View menu in Cinema 4D).
Gets the BaseDraw from one of the editor views.
[in] | num | If there are multiple views this selects the view. 0 <= num < GetBaseDrawCount() |
Int32 GetBaseDrawCount | ( | ) |
Gets the number of views in the editor.
Gets the default near and far clipping planes values from a clipping preset or from the document clipping preset.
[out] | near | Assigned the default near clipping plane value. |
[out] | far | Assigned the default far clipping plane value. |
[in] | d | Pass a clipping preset ID to get the near/far values for this preset instead of the values from the document preset. See DOCUMENT_CLIPPING_PRESET enum in parameter_ids\ddoc.h. |
BaseObject* GetSceneCamera | ( | ) |
Gets the current scene camera.
Bool SetSceneCamera | ( | BaseObject * | opCam | ) |
Sets a new scene camera. If opCam is nullptr, the editor camera is used.
[in] | opCam | The new scene camera. If nullptr, the editor camera is used. The caller owns the pointed camera. |
BaseObject* CreateSky | ( | ) |
Creates a Physical Sky object within the document and returns it. Basically the same as calling the Physical Sky command in Cinema 4D.
Example:
Adding sky shader object.
|
virtual |
Overload this for self defined Alien document classes. Called when Cineware SDK loads a document. Example:
BaseBitmap& GetDocPreviewBitmap | ( | ) |
Gets the preview bitmap for the document.
This is the same as the preview bitmap of the Windows Explorer / OS X Finder thumbnails.
Gets the document's default keying settings.
[in] | pKey | Assigned the default keying settings. Cineware SDK owns the pointed key. |
[in] | bOverdub | Assigned the document's default overdub. |
Sets the document's default keying settings.
[in] | pKey | The new default keying settings. Cineware SDK owns the pointed key. |
[in] | bOverdub | The new document's default overdub. If a keyframe already exists, the existing keyframe's interpolation type will be maintained when a new keyframe is recorded (only the Value Key will be overwritten). |
Int32 GetLastAction | ( | ) | const |
Private.
AxisState* GetState | ( | ) |
Gets the state of the Axis locks and the World/Object coordinate switch.
Bool HasCaches | ( | ) |
Checks if the scene has a polygonal object cache.
Cinema 4D has a special safe flag in the document preferences where a polygonal object cache can be saved in every file.
TakeData* GetTakeData | ( | ) |
Gets the take data for the document.
|
virtual |
Private.
Private.
Reimplemented from BaseList2D.
Private.
Reimplemented from BaseList2D.
|
friend |
|
friend |
|
friend |
|
friend |
Loads a document.
[in] | name | File to load the document from.The caller owns the pointed document. |
[in] | loadflags | Flags for the load. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
protected |