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 is used to extract information from a viewport about which objects and object elements are visible at which pixels. It is used internally for stuff like highlighting and modeling.
| Return type: | ViewportSelect |
|---|---|
| Returns: | A new viewport select object. |
Initializes the viewport information for multiple objects. This has to be done before the pixel information can be retrieved. You have to retrieve the width and height of the viewport manually:
frame = bd.GetFrame()
left = frame["left"]
right = frame["right"]
width = frame["width"]
height = frame["height"]
width = right - left + 1
height = bottom - top +1
| Parameters: |
|
|---|
Retrieves point information at the pixel position (x, y):
infopoint = viewportselect.GetPixelInfoPoint(x, y)
if not infopoint:
return
i = infopoint["i"] #int
z = infopoint["z"] #float
op = infopoint["op"] #c4dBaseObject
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | The retrieved pixel information or None if no information could be retrieved. |
Retrieves polygon information at the pixel position (x, y):
infopoint = viewportselect.GetPixelInfoPoint(x, y)
if not infopoint:
return
i = infopoint["i"] #int
z = infopoint["z"] #float
op = infopoint["op"] #c4dBaseObject
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | The retrieved pixel information or None if no information could be retrieved. |
Retrieves edge information at the pixel positio (x, y):
infopoint = viewportselect.GetPixelInfoPoint(x, y)
if not infopoint:
return
i = infopoint["i"] #int
z = infopoint["z"] #float
op = infopoint["op"] #c4dBaseObject
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | The retrieved pixel information or None if no information could be retrieved. |
Draws an XOR circle to the view bw at the pixel position (x, y). The radius is set by ViewportSelect.SetBrushRadius.
| Parameters: |
|
|---|
Sets the radius for ViewportSelect.Init.
| Parameter: | r (float) – The new radius in pixels. |
|---|
Deletes the pixel information at (x ,*y*) according to mask.
This is used for example in the live edge selection with “tolerant” deactivated to find out how many pixels of a certain edge was selected. If an edge is determined under the cursor, the pixel counter is decremented and the edge information is deleted afterwards.
| Parameters: |
|
|---|
Deletes the pixel information at (x ,*y*) according to mask.
This is used for example in the live edge selection with “tolerant” deactivated to find out how many pixels of a certain edge was selected. If an edge is determined under the cursor, the pixel counter is decremented and the edge information is deleted afterwards.
| Parameters: |
|
|---|---|
| Return type: | list |
| Returns: | Object list to fill or None on failure. |