Follow me to the Inheritance diagramm.
Returns the active document of CINEMA 4D.
Return type: | BaseDocument |
---|---|
Returns: | The actve document. |
Get the first document in the list of documents within CINEMA.
Return type: | BaseDocument |
---|---|
Returns: | The first document. |
Set doc as active document in CINEMA 4D.
Parameters: | doc (BaseDocument) – The document. |
---|
Saves the document to a file.
Parameters: |
|
||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||||||||||||||||||||||||||||
Returns: |
True if successful, otherwise False. |
Renders the document to a bitmap. You need to initialize the image with the size of the renderdata:
import c4d
from c4d import bitmaps, documents
doc = documents.GetActiveDocument()
rd = doc.GetActiveRenderData().GetData()
bmp = bitmaps.BaseBitmap()
#Initialize the bitmap with the result size.
#The resolution must match with the output size of the render settings.
bmp.Init(x=320, y=240, depth=24)
documents.RenderDocument(doc, rd, bmp, c4d.RENDERFLAGS_EXTERNAL)
bitmaps.ShowBitmap(bmp)
Parameters: |
|
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
int |
||||||||||||||||
Returns: |
The result:
|
Merges two documents
Parameters: |
|
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||||||||||||
Returns: |
True if successful, otherwise False. |
Loads a file into CINEMA 4D (file, image, ...) and opens it.
Parameters: |
name (or MemoryFileStruct) –
The file to load. Changed in version R13.051: It is now possible to pass a memory file. |
---|
Remove and free all resources of this document.
Parameters: | doc (BaseDocument) – The document to free. |
---|
Insert a document into the CINEMA editor list of documents.
Parameters: | doc (BaseDocument) – The document to insert. |
---|
Similar to LoadFile() but this time the document isn’t put into the editors list of documents and you have control over the document.
Parameters: |
|
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||
Returns: |
Document that was loaded, or None if it failed. |
Close all open documents in CINEMA 4D.
Return type: | bool |
---|---|
Returns: | True on success, otherwise False |
Controls the time of the active document doc. Unlike BaseDocument.SetTime() it handles running animation.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True on success, otherwise False |
Controls the animation in the active document doc.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True on success, otherwise False |
Used for modeling tools with GUI input. Applies the last modeling undo so that new values of the modeling tool can be applied. An example from the edge cut code:
from c4d import documents, plugins
class TestTool(plugins.ToolData):
def MouseInput(self, doc, data, draw, win, msg):
if not doc: return False
if doc.GetMode() == documents.Medges:
active = p.GetActiveObjects(True)
#undo step before
documents.InteractiveModeling_Restart(doc)
self.ModelingEdgeCut(active, c4d.MODIFY_EDGESELECTION, data, doc, win, msg, True)
c4d.EventAdd()
return True
Parameters: | doc (BaseDocument) – The document. |
---|---|
Return type: | bool |
Returns: | True if successful, otherwise False. |
A helper routine to copy the objects t_objects of document doc to a new document (returned). All materials associated are also copied over and the links are corrected.
Parameters: |
|
---|---|
Return type: | |
Returns: |
The document containing the isolated objects. |
Stop the external renderer.
Return type: | bool |
---|---|
Returns: | True if the rendering has been canceled, otherwise False. |
Get the batch render instance.
Return type: | BatchRender |
---|---|
Returns: | The batch render. |
New in version R13.016.
Returns the first timeline marker of the document.
Parameters: | doc (BaseDocument) – The document. |
---|---|
Return type: | BaseList2D |
Returns: | The first timeline marker. |
New in version R13.016.
Inserts a timeline marker into the document at a given time. Optionally an insertion point pPred in the timeline marker list can be specified, giving the marker before the wanted insertion point.
Parameters: |
|
---|---|
Return type: | |
Returns: |
The added timeline marker, or None if insertion failed. |