This class represents a CINEMA 4D window and cannot be instantiated.
Get a new parameter object.
Parameters: | id (int) – A parameter ID. See the dbasedraw.h description file. |
---|---|
Return type: | any |
Returns: | The parameter data for id. The type depends on the id. |
Used in the Extended GL mode. This mode is not documented. See c4d_gl.h for definitions.
Return type: | dict{cl: int, ct: int, cr: int, cb: int, } |
---|---|
Returns: | A dict or None. |
Indicates if the camera link is enabled.
Return type: | bool |
---|---|
Returns: | True if a scene camera is used, and False if the editor camera is used. |
Sets a new scene camera. If op os None, the editor camera is used.
Parameters: |
|
---|
Returns the current scene camera from the passed document, or None if no scene camera is used.
Parameters: | doc (BaseDocument) – The document to get the scene camera from. |
---|---|
Return type: | BaseObject |
Returns: | The scene camera. |
Returns the editor camera.
Parameters: | doc (BaseDocument) – The document to get the editor camera from. |
---|---|
Return type: | BaseObject |
Returns: | The editor camera. |
Returns the current display filter. This is a bit field derived from the BASEDRAW_DISPLAYFILTER_* description flags in dbasedraw.res. To set the display filter you have to use the description flags with BaseList2D.__setitem__().
Return type: | int | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: |
A bit field with the following flags:
|
Get the edit state. This is a bit field derived from the BASEDRAW_DISPLAYFILTER_* description flags in dbasedraw.res. To set the display filter you have to use the description flags with BaseList2D.__setitem__().
Return type: | int | ||||||
---|---|---|---|---|---|---|---|
Returns: |
A bit field with the following flags:
|
Checks if the current tool can use the curent SDS/Deformed editing state.
Parameters: | doc (BaseDocument) – The current document. |
---|---|
Return type: | bool |
Returns: | True if the view is open, otherwise False. |
Used after rendering 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 to render into a framebuffer with different resolution than the editor view.
Parameters: |
|
---|
Adds the object op to DRAWPASS_XRAY. For example:
def Draw(self, op, drawpass, bd, bh):
if drawpass==c4d.DRAWPASS_OBJECT:
bd.AddToPostPass(op, bh)
ok=True
elif drawpass==c4d.DRAWPASS_XRAY:
ok=True
if ok==False: return c4d.DRAWRESULT_OK
Parameters: |
|
---|
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 object color. |
Makes sure that a color has at least 15% difference to the background color.
Parameters: | col (Vector) – The original vector. |
---|---|
Return type: | Vector |
Returns: | The new color, adjusted if needed. |
Sets the transparency value for following polygons. The range is 0 to 255, where 255 is 100% transparent. Use negative values for true transparencies and positive values for ‘dotted’ transparencies.
Parameters: | trans (int) – The transparency. |
---|
Returns the current transparency value for polygons. The range is 0 to 255, where 255 is 100% transparent. Negative values are true transparencies and positive values are ‘dotted’ transparencies.
Return type: | int |
---|---|
Returns: | 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 True. |
Sets the pen color for following drawing operations.
Parameters: |
---|
New in version R13.016.
Sets the drawn point size.
Parameters: | pointsize (float) – The new point size. |
---|
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 Polygon() to draw simple shaded polygons.
Parameters: | |
---|---|
Return type: |
float |
Returns: |
The intensity of the light. Between 0 and 1. |
New in version R13.016.
Converts colors from document color profile to viewport color profile.
Parameters: | c (Vector) – The color to convert (document). |
---|---|
Return type: | Vector |
Returns: | The converted color (viewport). |
New in version R13.016.
Converts colors from viewport color profile to document color profile.
Parameters: | c (Vector) – The color to convert (viewport). |
---|---|
Return type: | Vector |
Returns: | The converted color (document). |
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 (level 0)
- unselected edges (level 2)
- selected edges (level 4)
Note
This function only affects the new draw functions below it, i.e. DrawHandle(), DrawTexture(), DrawCircle(), DrawBox(), and DrawSphere().
Parameters: | offset (int) – The new Z buffer offset. |
---|
New in version R13.016.
Enables/disables writing to the depth buffer.
Parameters: | enable (bool) – True to enable depth buffer writing, otherwise False. |
---|
For internal use only.
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. DrawHandle(), DrawTexture(), DrawCircle(), DrawBox(), and DrawSphere().
Parameters: |
offset (int) –
Sets the current Z buffer offset. Use this to for example draw lines over shaded polygons in front of the screen. A higher zoffset value means a higher draw priority in the Z buffer. For example:
|
---|
Sets the transformation matrix to the camera system.
Note
This function only affects the new draw functions below it, i.e. DrawHandle(), DrawTexture(), DrawCircle(), DrawBox(), and DrawSphere().
Sets the transformation matrix to the given matrix mg. The matrix should transform coordinates passed to the draw functions into world coordinates.
Parameters: |
|
---|
Draws a one-pixel point in the current pen color at p. The coordinates must be in screen space.
Parameters: | p (Vector) – A 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: |
|
---|
Draws a line in the current pen color between p1 and p2. The coordinates must be in world space.
Parameters: |
---|
Draws a standard handle (orange dot) at vp. The coordinates must be in world space.
Parameters: |
|
---|
Draws an array of shaded points with individual colors. The shading is determined by SetLightList().
Note
The coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix().
Parameters: |
|
---|
Draws a colored and shaded texture polygon using the points in padr4, the colors in cadr, the normals in vnadr and the UV coordinates in uvadr. Only triangles and quadrangles are accepted. The colors are interpolated between the points and mutiplied with the texture color. The shading is determined by SetLightList().
Note
The coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix().
Parameters: |
|
---|
Draws a box. The eight points of the box are defined as:
p = (None)*8
p[0] = Vector(-size, -size, -size);
p[1] = Vector( size, -size, -size);
p[2] = Vector( size, -size, size);
p[3] = Vector(-size, -size, size);
p[4] = Vector(-size, size, -size);
p[5] = Vector( size, size, -size);
p[6] = Vector( size, size, size);
p[7] = 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 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.
Note
The coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix().
Parameters: | m (Matrix) – A matrix describing the circle. |
---|
Draws a manually shaded triangle or quadrangle. The corner points are given as a list of Vectors in p, and the corner colors as a corresponding list of Vectors in f. 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.DrawPolygon(p, f)
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: |
---|
Each DrawPolygon() puts the polygon into an internal array and draws the polygons when the array is full or an OpenGL state changes (e.g. the matrix). With this method you can force this operation.
Draws a polygon object into the view.
Parameters: |
|
---|
Draws a polygon object into the view.
Parameters: |
|
---|
Draw a scene into the framebuffer.
Parameters: | flags (int) – Private. |
---|---|
Return type: | bool |
Returns: | Success of drawing the scene. |
Private.
Return type: | bool |
---|---|
Returns: | True on success, otherwise False. |
Sets the lighting used by the draw functions.
Note
The coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix().
Parameters: |
mode –
|
||||||
---|---|---|---|---|---|---|---|
Return type: | bool | ||||||
Returns: | True on success, otherwise False. |
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.
Note
The coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix().
Parameters: |
|
---|
Gets draw parameters.
Parameters: | id (int) – Parameter ID. |
---|---|
Return type: | any |
Returns: | Depends on the parameter ID. |
Checks for thread breaks in the draw.
Return type: | bool |
---|---|
Returns: | True if a stopping condition has occurred, otherwise False. |
Get the editor window of the BaseDraw.
Return type: | EditorWindow |
---|---|
Returns: | The editor window of the base draw. |
Set a texture used by the vertex buffer.
Parameters: |
|
---|