c4d.modules.render.VolumeData
¶
c4d.modules.render.
VolumeData
¶
VolumeData.GetObjCount()
VolumeData.GetSkyCount()
VolumeData.GetCurrentCPU()
VolumeData.GetCPUCount()
VolumeData.CalcVisibleLight()
VolumeData.GetRS()
VolumeData.GetWeights()
VolumeData.GetSmoothedNormal()
VolumeData.GetXY()
VolumeData.SetXY()
VolumeData.CalcFgBg()
VolumeData.GetLightFalloff()
c4d.modules.render.BaseVolumeData
VolumeData.
GetObjCount
(
)
¶
Returns the overall number of objects.
Return type: | int |
---|---|
Returns: | The total number of objects. |
VolumeData.
GetSkyCount
(
)
¶
Returns the number of skies.
Return type: | int |
---|---|
Returns: | The number of skies. |
VolumeData.
GetCurrentCPU
(
)
¶
Returns the current CPU on which the shader is executed.
Return type: | int |
---|---|
Returns: | The running CPU id. |
VolumeData.
GetCPUCount
(
)
¶
Returns the CPU count the renderer is utilizing.
Note
The value returned here can differ from the global
GeGetCPUCount()
as the renderer can utilize a different number of CPUs than are available.
Return type: | int |
---|---|
Returns: | The number of CPUs. |
VolumeData.
OutOfMemory
(
)
¶
Notify Cinema 4D that a (severe) out-of-memory condition occured. Cinema 4D will stop as soon as possible, but there is no guarantee when exactly. It is possible that your shader could still be called several times, so it has to be programmed to handle this and to be crash-proof.
VolumeData.
SkipRenderProcess
(
)
¶
Skips the render process. (Useful for custom renderers.)
VolumeData.
ScreenToCamera
(
p
)
¶
Transform screen to camera coordinates. During QTVR rendering same point is returned.
Parameters: | p ( c4d.Vector ) – The screen coordinate. |
---|---|
Return type: | c4d.Vector |
Returns: | The camera coordinate. |
VolumeData.
CameraToScreen
(
p
)
¶
Transform camera to screen coordinates. During QTVR rendering same point is returned.
Parameters: | p ( c4d.Vector ) – The camera coordinate. |
---|---|
Return type: | c4d.Vector |
Returns: | The screen coordinate. |
VolumeData.
StatusSetText
(
str
)
¶
Set the status bar text during initialization of your shader or videopost effect. If an empty string is passed the status bar will be cleared.
Parameters: | str ( str ) – The status text to display. |
---|
VolumeData.
StatusSetBar
(
percentage
)
¶
Set the progress bar during initialization of your shader or videopost effect.
Note
The value passed will only be displayed if it is bigger than the previous one. To reset the bar call StatusSetText (“”).
VolumeData.
StatusSetSpinMode
(
on
)
¶
Set the render progress bar spinning. Use this to indicate that your plugin is still processing even if the progress bar is not increasing.
Parameters: | on ( bool ) – True to set the progress bar spinning, False to stop it. |
---|
VolumeData.
GetLightCount
(
)
¶
Returns the overall number of lights.
Return type: | int |
---|---|
Returns: | The number of lights. |
VolumeData.
GetLight
(
index
)
¶
Get the given lightsource.
Parameters: | index ( int ) – The index of the light source to return. |
---|---|
Return type: | ptr |
Returns: | The light source. |
VolumeData.
CalcArea
(
light
,
nodiffuse
,
nospecular
,
specular_exponent
,
ray_vector
,
p
,
bumpn
,
orign
,
raybits
)
¶
If you code custom illumination models (e.g. different specular function) you can do this for standard lightsources easily. For area lights you’ll usually want to fall back to the default illumination model though, as otherwise you’d have to rebuild the sample code of area lights!
Parameters: |
|
||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||||
Returns: |
The diffuse and specular components. |
VolumeData.
CalcShadow
(
l
,
p
,
bumpn
,
phongn
,
orign
,
rayv
,
transparency
,
hitid
,
raybits
)
¶
Compute a shadow.
Parameters: |
|
||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||||
Returns: |
The returned shadow value. If there is no shadow, 0.0 will be returned. 1.0 is the maximum shadow value for each component. |
VolumeData.
IlluminanceAnyPoint
(
p
,
flags
,
raybits
)
¶
Calculates the light intensity for a given point p . This routine can calculate the illumination for any point in space and is widely used for transparent volumetric shaders (gases, clouds etc.).
Parameters: |
|
||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||||||||||||||
Returns: |
The returned color. Note The returned color components can exceed values of 1.0! |
VolumeData.
IlluminateSurfacePoint
(
)
¶
This function is used for custom illumination models. You can calculate the intensity of incoming light for a given light and surface point.
Parameters: |
|
||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||||||||||||||
Returns: |
True if the light illuminates the objects surface point. |
VolumeData.
CalcVisibleLight
(
ray
,
maxdist
)
¶
Returns the mixed color of all visible lights on a given ray span.
Parameters: |
|
---|---|
Return type: | |
Returns: |
The mixed color of the lights and a value indicating if some light sources have a dust effect (!= 0 in this case). |
VolumeData.
GetRS
(
hitid
,
p
)
¶
Calculates the R/S parameters for a point.
If you want to calculate weighted data (e.g. based upon a color for each polygon point) you can do this the following way:
r, s = GetRS(hitid, p) result = [color a] * (1.0-r-s) + [color d]*r + [color c]*s
Parameters: |
|
---|---|
Return type: |
tuple(bool, float, float) |
Returns: |
|
VolumeData.
GetWeights
(
hitid
,
p
)
¶
Returns barycentric coordinates for a point on the surface of a polygon. Cinema 4D uses enhanced interpolation routines for quadrangles, so you’ll get a higher quality using it instead of considering a quadrangle as two triangles. The routine works for any type of polygon, including triangles and non-coplanar quadrangles.
The function returns a tuple with the weight factors for the global polygon with ID
hitid
at
p
. Works similar to
GetRS()
, but has a higher quality.
Parameters: |
|
---|---|
Return type: |
tuple(float, float, float, float) |
Returns: |
A tuple with the respective weight factors for points A, B, C and D. |
VolumeData.
GetSmoothedNormal
(
hitid
,
p
)
¶
Returns the phong normal for a point.
Parameters: |
|
---|---|
Return type: | |
Returns: |
The phong normal. |
VolumeData.
GetXY
(
)
¶
Returns the current X/Y pixel position in render resolution. Render resolution is the screen resolution multiplied by ‘scale’.
Return type: | tuple(int, int, int) |
---|---|
Returns: |
The X, Y pixel positions and render scale.
Note X/scale and Y/scale is the screen position. |
VolumeData.
SetXY
(
x
,
y
)
¶
Sets the current X/Y pixel position in render resolution. Render resolution is the screen resolution multiplied by ‘scale’.
Note
X/scale and Y/scale is the screen position.
Note
Some Shaders use the screen pixel position. Plugins (like the Baker for instance) can change this position without having to render an image.
Parameters: |
|
---|
VolumeData.
CalcFgBg
(
foreground
,
x
,
y
,
subx
,
suby
)
¶
Calculates the foreground or background color and alpha at ( x , y ).
Parameters: |
|
---|---|
Return type: |
tuple(
|
Returns: |
The background/foreground color and alpha. |
VolumeData.
GetLightFalloff
(
)
¶
Calculate the light falloff function (light intensity for a distance).
Parameters: |
|
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
float |
||||||||||||||
Returns: |
The light falloff. |
VolumeData.
GetRay
(
x
,
y
,
ray
)
¶
Generate the view ray for a position.
This function does not set
Ray.pp
[0..2],
Ray.vv
[0..2],
Ray.transport
and
Ray.ior
.
Parameters: |
|
---|
VolumeData.
GetVideoPost
(
nth
)
¶
Returns the n-th video post effect for this render process.
Return type: | c4d.BaseList2D |
---|---|
Returns: | The video post, or None if the index is too large. |
VolumeData.
FindVideoPost
(
id
)
¶
Returns a video post effect for this render process by ID.
Parameters: | id ( int ) – The video post effect ID. |
---|---|
Return type: | c4d.BaseList2D |
Returns: | The found video post, or None if it doesn’t exist. |
VolumeData.
Init
(
from
)
¶
Initializes this
VolumeData
object with the data from the
from
object. Only the most essential parts are copied over, including the render instance.
Parameters: | from ( c4d.modules.render.VolumeData ) – Source object. |
---|
VolumeData.
CopyTo
(
dst
)
¶
Copy this to another
VolumeData
.
Parameters: | dst ( c4d.modules.render.VolumeData ) – The destination VolumeData. |
---|