This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com
This class represents a Cinema 4D window and cannot be instantiated.
The base class of many other classes.
The parameter data for id.
| Return type: | any |
|---|---|
| Returns: | The data, depends on id. Can be None. |
Used in the Extended GL mode. This mode is not documented. See c4d_gl.h for definitions:
dimension = bd.GetFrameScreen()
#dimension["cl"], dimension["ct"], dimension["cr"], dimension["cb"]
| Return type: | dict of int |
|---|---|
| Returns: | The dimension. |
Indicates if the camera link is enabled.
| Return type: | bool |
|---|---|
| Returns: | True if a scene camera is used and False is the editor camera is used. |
Sets a new scene camera. If op is None, the editor camera is used.
| Parameters: |
|
|---|
Returns the current scene camera from the passed document, or None if no scene camera is used.
| Parameter: | doc (BaseDocument) – The document to get the scene camera from. |
|---|---|
| Return type: | BaseObject |
| Returns: | The scene camera or None. |
Returns the editor camera.
| Return type: | BaseObject |
|---|---|
| Returns: | The scene camera, cannot be None. |
Returns the current edit state.
| Return type: | int |
||||
|---|---|---|---|---|---|
| Returns: | The bit:
|
Returns the current display filter.
| Return type: | int |
||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns: | The bit:
|
Check ifs the view of the passed Document is open.
| Parameter: | doc (BaseDocument) – The document. |
|---|---|
| Return type: | int |
| Returns: | True if the view is open. |
Used to render into a framebuffer with different resolution than the editor view.
| Parameters: |
|
|---|
Used to render into a framebuffer with different resolution than the editor view.
| Parameters: |
|
|---|
Used after rendering into a framebuffer with different resolution than the editor view.
| Parameters: |
|
|---|
Adds the object op to DRAWPASS_XRAY. For example:
class MyObject(plugins.ObjectData):
def Draw(self, op, drawpass, bd, bh):
ok = False #initialize
if drawpass==plugins.DRAWPASS_OBJECT:
bd.AddToPostBass(op, bh)
ok = True
elif drawpass==plugins.DRAWPASS_XRAY:
ok = True
return ok
The object in this example is drawn both in regular and X-ray pass.
| Parameters: |
|
|---|---|
| Return type: | bool |
| Returns: | True on success. |
Returns the wireframe color in editor for the specified object. Some types of objects have certain colors. For polygon objects the main color is taken into account.
| Parameters: |
|
|---|---|
| Return type: | |
| Returns: | The color. |
Makes sure that a color has at least 15% difference to the background color.
| Parameter: | col (Vector) – The original color. |
|---|---|
| Return type: | Vector |
| Returns: | The new color, adjusted if needed. |
Indicates if the current display mode has a Z-buffer. For example 2D wireframe has no Z-buffer.
| Return type: | bool |
|---|---|
| Returns: | True if the current display mode uses a Z-buffer, otherwise False. |
Returns the current transparency value for polygons. The range is 0 to 255, where 255 is 100% transparent.
| Return type: | int |
|---|---|
| Returns: | The transparency. |
Sets the transparency value for following polygons. The range is 0 to 255, where 255 is 100% transparent.
| Parameter: | trans (int) – The transparency. |
|---|
Returns True if the screen point (x,y) is within a hit range of the world point p, i.e. if the screen point is close to the world points projection on the screen.
| Parameters: |
|
|---|---|
| Return type: | bool |
| Returns: | True if the point is within range, otherwise False. |
A quick shading algorithm that only takes the angle to the camera and a default light into account. You pass a point and a normal in world space and get back the intensity. Can be combined with BaseDraw.Polygon3D() to draw simple shaded polygons.
| Parameters: | |
|---|---|
| Return type: | float |
| Returns: | The intensity of the light. Between 0 and 1. |
Draws a one-pixel point in the current pen color at p. The coordinates must be in screen space.
| Parameter: | p (Vector) – The position of the point. |
|---|
Draws a line in the current pen color between p1 and p2. The coordinates must be in screen space.
| Parameters: |
|---|
Draws a standard handle (orange dot) at p. The coordinates must be in screen space.
| Parameters: |
|
|---|
Draws a circle in the current pen color with a radius of rad and the center at (mx, my). The coordinates must be in screen space.
| Parameters: |
|
|---|
Note
When you use this method, please pass the arg names for backward compatibility. The order and count of arguments might change.
A faster way to draw lots of lines from camera space. The line is defined by the coordinates p1 and p2.
| Parameters: |
|
|---|
Draws a one-pixel point in the current pen color at p. The coordinates must be in world space.
| Parameter: | p (Vector) – The position of the point. |
|---|
Draws a line in the current pen color between p1 and p2. The coordinates must be in world space.
| Parameters: |
|
|---|
Draws a line in the current pen color between p1 and p2. The coordinates must be in world space.
| Parameters: |
|
|---|
Draws a handle dot. You can set the color with BaseDraw.set_pen().
| Parameters: |
|
|---|
Draws an ellipse in the current pen color. The ellipse is specified by the matrix m, where m.v1 and m.v2 are the axis vectors and m.off is the center position. (m.v3 isn’t used.) The coordinates must be in world space.
| Parameter: | m (Matrix) – A matrix describing the circle. |
|---|
Draws a Box in 3D. The eight points of the box are defined as:
p = (None) * 8
p[0] = m * Vector(-size, -size, -size)
p[1] = m * Vector( size, -size, -size)
p[2] = m * Vector( size, -size, size)
p[3] = m * Vector(-size, -size, size)
p[4] = m * Vector(-size, size, -size)
p[5] = m * Vector( size, size, -size)
p[6] = m * Vector( size, size, size)
p[7] = m * Vector(-size, size, size)
| Parameters: |
|
|---|
Draws a manually shaded triangle or quadrangle. The corner points are given as an list of Vectors in p, and the corner colors as a corresponding list of Vectors in f. If quad is False there should be three elements in each list, otherwise four. The colors are interpolated between the corners. Example:
p = ( c4d.Vector(0,0,0), c4d.Vector(100,0,0), c4d.Vector(50,100,0) )
f = ( c4d.Vector(1,0,0), c4d.Vector(0,0,1), c4d.Vector(0,1,0) )
bd.Polygon3D(p, f, False)
| Parameters: |
|---|
Sets the current Z buffer offset. Use this to for example draw lines over shaded polygons in front of the screen. A higher offset value means a higher draw priority in the Z buffer. For example: Shaded Polygon(0); Unselected Edges(2); Selected Edges(4)
| Parameter: | offset (int) – The new Z buffer offset. |
|---|
Sets the transformation matrix to screen coordinates, i.e. from (0, 0) to (width, height).
Note
This function only affects the new draw functions below it, i.e. LineNew(), LineStrip(), DrawHandle(), DrawPoly(), DrawTexture(), CircleNew(), Box3DNew(), PolygonNew() and DrawSphere().
Sets the transformation matrix to the camera system.
Note
This function only affects the new draw functions below it, i.e. LineNew(), LineStrip(), DrawHandle(), DrawPoly(), DrawTexture(), CircleNew(), Box3DNew(), PolygonNew() and DrawSphere().
raws a standard handle (orange dot) at vp.
| Parameters: |
|
|---|
Draws an ellipse in the current pen color. The ellipse is specified by the matrix m, where m.v1 and m.v2 are the axis vectors and m.off is the center position. (m.v3 isn’t used.).
Note
The coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix().
Draws a box. The eight points of the box are defined as:
p = (None) * 8
p[0] = m * Vector(-size, -size, -size)
p[1] = m * Vector( size, -size, -size)
p[2] = m * Vector( size, -size, size)
p[3] = m * Vector(-size, -size, size)
p[4] = m * Vector(-size, size, -size)
p[5] = m * Vector( size, size, -size)
p[6] = m * Vector( size, size, size)
p[7] = m * Vector(-size, size, size)
To get arbitrary cubic forms, set size to 0.5 and multiply the vectors in the matrix by the length.
Note
The coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix().
| Parameters: |
|---|
Draws a sphere at position off with size specified by the size vector in each direction and color specified by col.
Note
The coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix().
| Parameters: |
|---|
Sets the lighting used by the draw functions.
| Parameter: | mode (int) – The light mode.
|
|---|
Called before a change is made to the view to add the old setting to the undo buffer for the view. (This undo buffer is separate from the normal undo buffer.)
Performs an undo operation in the view. This is the same as the user selecting Undo View from within CINEMA 4D.
Sets draw parameters.
| Parameters: |
|
|---|
Get draw parameters.
| Parameter: | id (int) – Parameter ID.
|
|||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: | any | |||||||||||||||
| Returns: | Depends on id. |
Checks for thread breaks in the draw.
| Return type: | bool: |
|---|---|
| Returns: | True if if a stopping condition has occurred, otherwise False. |
Get the EditorWindow of the BaseDraw.
| Return type: | EditorWindow |
|---|---|
| Returns: | The editor window. |
Set a texture used by the vertex buffer.
| Parameters: |
|
|---|