SBRenderPreset#
This class describes a render preset that contains various rendering settings. You can add multiple render preset nodes in a document, copy them, and apply them to set the global rendering settings accordingly.
The render preset has the following rendering settings which you can specify, including their parameters:
Screen-Space Ambient occlusion (SSAO): kernel size, strength, radius, randomization
Object-Space Ambient occlusion (OSAO): grid size, strength
Anti-aliasing: presets
Background: presets and background colors and image
Bloom effect: radius, threshold, strength
Depth-of-field: strenght, distance
Fog: strenght, near and far distances
Grid: spacing, thickness, radius, transparency
Lighting: parameters for first, second, and global lights
Pinhole effect: sharpness
Scale: minimum length, thickness
Shadows: preset, transparency, spread, offset
Silhouettes: color, transparency, thickness, distance threshold, fog attenuation
Structural model rendering options: atom and bond radii
# construct a render preset node
renderPreset = SBRenderPreset("Render preset")
# or create it based on the current rendering settings
#renderPreset = SAMSON.createRenderPreset()
# change the render preset properties
# make the operation undoable
with SAMSON.holding("Add render preset"):
SAMSON.hold(renderPreset)
# create a render preset node
renderPreset.create()
# add it to the active document
SAMSON.getActiveDocument().addChild(renderPreset)
You can then simply apply the render preset to change the rendering settings.
# make the operation undoable
with SAMSON.holding("Apply render preset"):
# apply a render preset
renderPreset.apply()
- class samson.SBRenderPreset(*args, **kwargs)#
Bases:
SBNodeThis class describes a render preset.
Overloaded function.
__init__(self: samson.SBRenderPreset) -> None
Constructs a render preset.
__init__(self: samson.SBRenderPreset, name: str) -> None
Constructs a render preset with the given name.
- class AntiAliasingPreset(self: samson.SBRenderPreset.AntiAliasingPreset, value: int)#
Bases:
pybind11_objectMembers:
BestSpeed : The anti-aliasing preset for the best speed (low quality)
BetterSpeed : The anti-aliasing preset for the better speed (medium quality)
HigherQuality : The anti-aliasing preset for the higher quality
HighestQuality : The anti-aliasing preset for the highest quality
Custom : A custom anti-aliasing preset
- BestSpeed = <AntiAliasingPreset.BestSpeed: 0>#
- BetterSpeed = <AntiAliasingPreset.BetterSpeed: 1>#
- Custom = <AntiAliasingPreset.Custom: 4>#
- HigherQuality = <AntiAliasingPreset.HigherQuality: 2>#
- HighestQuality = <AntiAliasingPreset.HighestQuality: 3>#
- property name#
- property value#
- class BackgroundImageMode(self: samson.SBRenderPreset.BackgroundImageMode, value: int)#
Bases:
pybind11_objectMembers:
ContainedInViewport : Background image is fully contained in the viewport
CoveringViewport : Background image is covering in the viewport
- ContainedInViewport = <BackgroundImageMode.ContainedInViewport: 0>#
- CoveringViewport = <BackgroundImageMode.CoveringViewport: 1>#
- property name#
- property value#
- class BackgroundType(self: samson.SBRenderPreset.BackgroundType, value: int)#
Bases:
pybind11_objectMembers:
Default : The default background
White : White background
Black : Black background
Custom : Custom background changing from top color to bottom color
Image : Image as a background
- Black = <BackgroundType.Black: 2>#
- Custom = <BackgroundType.Custom: 3>#
- Default = <BackgroundType.Default: 0>#
- Image = <BackgroundType.Image: 4>#
- White = <BackgroundType.White: 1>#
- property name#
- property value#
- class ClippingPreset(self: samson.SBRenderPreset.ClippingPreset, value: int)#
Bases:
pybind11_objectMembers:
FineHalftone : A fine halftone clipping preset (default)
CoarseHalftone : A coarse halftone clipping preset
LowFrequencyNoise : A low-frequency noise clipping preset
HighFrequencyNoise : A high-frequency noise clipping preset
Sharp : A sharp clipping preset
Custom : A custom clipping preset
- CoarseHalftone = <ClippingPreset.CoarseHalftone: 1>#
- Custom = <ClippingPreset.Custom: 5>#
- FineHalftone = <ClippingPreset.FineHalftone: 0>#
- HighFrequencyNoise = <ClippingPreset.HighFrequencyNoise: 3>#
- LowFrequencyNoise = <ClippingPreset.LowFrequencyNoise: 2>#
- Sharp = <ClippingPreset.Sharp: 4>#
- property name#
- property value#
- class LightingPreset(self: samson.SBRenderPreset.LightingPreset, value: int)#
Bases:
pybind11_objectMembers:
Default : The default 3D lighting preset
FlatLight : The flat lighting preset
Custom : A custom lighting preset
- Custom = <LightingPreset.Custom: 2>#
- Default = <LightingPreset.Default: 0>#
- FlatLight = <LightingPreset.FlatLight: 1>#
- property name#
- property value#
- class ShadowPreset(self: samson.SBRenderPreset.ShadowPreset, value: int)#
Bases:
pybind11_objectMembers:
LowQuality : Low quality shadows
MediumQuality : Medium quality shadows
HighQuality : High quality shadows
SoftShadow : Soft shadows (highest quality)
Custom : A custom shadow preset
- Custom = <ShadowPreset.Custom: 4>#
- HighQuality = <ShadowPreset.HighQuality: 2>#
- LowQuality = <ShadowPreset.LowQuality: 0>#
- MediumQuality = <ShadowPreset.MediumQuality: 1>#
- SoftShadow = <ShadowPreset.SoftShadow: 3>#
- property name#
- property value#
- apply(self: samson.SBRenderPreset) None#
Applies the render preset.
This function applies the render preset by setting the rendering preferences in the Main Preferences according to the render preset.
This function is undoable. It calls SAMSON.beginHolding and SAMSON.endHolding internally.
- clearBackgroundImageBase64(self: samson.SBRenderPreset) None#
Clears the background image.
- static getAntiAliasingPresetString(arg0: samson.SBRenderPreset.AntiAliasingPreset) str#
Returns a human-readable string representation of the anti-aliasing preset preset.
- getBackgroundBottomColor(self: samson.SBRenderPreset) samson.SBColor#
Returns the background bottom color.
- static getBackgroundImageModeString(arg0: samson.SBRenderPreset.BackgroundImageMode) str#
Returns a human-readable string representation of the background image mode mode.
- getBackgroundTopColor(self: samson.SBRenderPreset) samson.SBColor#
Returns the background top color.
- static getBackgroundTypeString(arg0: samson.SBRenderPreset.BackgroundType) str#
Returns a human-readable string representation of the background type type.
- getBondRadius(self: samson.SBRenderPreset) samson.SBQuantity.unitsSI#
Return the bond radius.
- static getClippingPresetString(arg0: samson.SBRenderPreset.ClippingPreset) str#
Returns a human-readable string representation of the clipping preset preset.
- getConstantAtomRadius(self: samson.SBRenderPreset) samson.SBQuantity.unitsSI#
Return the constant atom radius.
- static getDefaultBondRadius(arg0: samson.SBRenderPreset) samson.SBQuantity.unitsSI#
Return the default bond radius.
- static getDefaultConstantAtomRadius() samson.SBQuantity.unitsSI#
Return the default constant atom radius.
- static getDefaultDepthOfFieldDistance() samson.SBQuantity.unitsSI#
Return the default distance at which the depth-of-field effect begins.
- static getDefaultFirstLightColor() samson.SBColor#
Returns the first light’s default color.
- static getDefaultGridRadius() samson.SBQuantity.unitsSI#
Return the default grid radius.
- static getDefaultGridSpacing() samson.SBQuantity.unitsSI#
Return the default grid spacing.
- static getDefaultGridThickness() samson.SBQuantity.unitsSI#
Return the default grid thickness.
- static getDefaultSecondLightColor() samson.SBColor#
Returns the second light’s default color.
- static getDefaultShadowOffset() samson.SBQuantity.unitsSI#
Return the default offset between objects and their shadows.
- static getDefaultSilhouetteColor() samson.SBColor#
Returns the silhouette’s default color.
- static getDefaultSilhouetteDistanceThreshold() samson.SBQuantity.unitsSI#
Return the silhouette’s default distance threshold.
- getDepthOfFieldDistance(self: samson.SBRenderPreset) samson.SBQuantity.unitsSI#
Return the distance at which the depth-of-field effect begins.
- getFirstLightColor(self: samson.SBRenderPreset) samson.SBColor#
Returns the first light’s color.
- getGridRadius(self: samson.SBRenderPreset) samson.SBQuantity.unitsSI#
Return the grid radius.
- getGridSpacing(self: samson.SBRenderPreset) samson.SBQuantity.unitsSI#
Return the grid spacing.
- getGridThickness(self: samson.SBRenderPreset) samson.SBQuantity.unitsSI#
Return the grid thickness.
- static getLightingPresetString(arg0: samson.SBRenderPreset.LightingPreset) str#
Returns a human-readable string representation of the lighting preset preset.
- getNextRenderPreset(self: samson.SBRenderPreset) samson.SBRenderPreset#
Returns the next render preset.
- getPreviousRenderPreset(self: samson.SBRenderPreset) samson.SBRenderPreset#
Returns the previous render preset.
- getSecondLightColor(self: samson.SBRenderPreset) samson.SBColor#
Returns the second light’s color.
- getShadowOffset(self: samson.SBRenderPreset) samson.SBQuantity.unitsSI#
Return the offset between objects and their shadows.
- static getShadowPresetString(arg0: samson.SBRenderPreset.ShadowPreset) str#
Returns a human-readable string representation of the shadow preset preset.
- getSilhouetteColor(self: samson.SBRenderPreset) samson.SBColor#
Returns the silhouette color.
- getSilhouetteDistanceThreshold(self: samson.SBRenderPreset) samson.SBQuantity.unitsSI#
Return the silhouette distance threshold. A pixel is considered to be part of the silhouette if the difference between the depth of one of its neighbors and its own depth is larger than this parameter.
- hasBackgroundImageBase64(self: samson.SBRenderPreset) bool#
Returns whether a background image is set.
- setBackgroundBottomColor(self: samson.SBRenderPreset, color: samson.SBColor) None#
Sets the background bottom color.
- setBackgroundTopColor(self: samson.SBRenderPreset, color: samson.SBColor) None#
Sets the background top color.
- setBondRadius(self: samson.SBRenderPreset, arg0: samson.SBQuantity.unitsSI) None#
Set the bond radius.
- setConstantAtomRadius(self: samson.SBRenderPreset, arg0: samson.SBQuantity.unitsSI) None#
Set the constant atom radius.
- setDepthOfFieldDistance(self: samson.SBRenderPreset, arg0: samson.SBQuantity.unitsSI) None#
Set the distance at which the depth-of-field effect begins.
- setFirstLightColor(self: samson.SBRenderPreset, color: samson.SBColor) None#
Sets the first light’s color.
- setGridRadius(self: samson.SBRenderPreset, arg0: samson.SBQuantity.unitsSI) None#
Set the grid radius.
- setGridSpacing(self: samson.SBRenderPreset, arg0: samson.SBQuantity.unitsSI) None#
Set the grid spacing.
- setGridThickness(self: samson.SBRenderPreset, arg0: samson.SBQuantity.unitsSI) None#
Set the grid thickness.
- setSecondLightColor(self: samson.SBRenderPreset, color: samson.SBColor) None#
Sets the second light’s color.
- setShadowOffset(self: samson.SBRenderPreset, arg0: samson.SBQuantity.unitsSI) None#
Set the offset between objects and their shadows.
- setSilhouetteColor(self: samson.SBRenderPreset, color: samson.SBColor) None#
Sets the silhouette color.
- setSilhouetteDistanceThreshold(self: samson.SBRenderPreset, arg0: samson.SBQuantity.unitsSI) None#
Set the silhouette distance threshold. A pixel is considered to be part of the silhouette if the difference between the depth of one of its neighbors and its own depth is larger than this parameter.
- toString(self: samson.SBRenderPreset, offset: int = 0) str#
Returns a string representation of the render preset with the full information on all the options
- BestSpeed = <AntiAliasingPreset.BestSpeed: 0>#
- BetterSpeed = <AntiAliasingPreset.BetterSpeed: 1>#
- Black = <BackgroundType.Black: 2>#
- CoarseHalftone = <ClippingPreset.CoarseHalftone: 1>#
- ContainedInViewport = <BackgroundImageMode.ContainedInViewport: 0>#
- CoveringViewport = <BackgroundImageMode.CoveringViewport: 1>#
- Custom = <ShadowPreset.Custom: 4>#
- Default = <LightingPreset.Default: 0>#
- property FXAAFlag#
The Fast Approximate Anti-Aliasing (FXAA) slightly slows down rendering but greatly reduces aliasing artefacts (jagged edges).
- FineHalftone = <ClippingPreset.FineHalftone: 0>#
- FlatLight = <LightingPreset.FlatLight: 1>#
- HighFrequencyNoise = <ClippingPreset.HighFrequencyNoise: 3>#
- HighQuality = <ShadowPreset.HighQuality: 2>#
- HigherQuality = <AntiAliasingPreset.HigherQuality: 2>#
- HighestQuality = <AntiAliasingPreset.HighestQuality: 3>#
- Image = <BackgroundType.Image: 4>#
- LowFrequencyNoise = <ClippingPreset.LowFrequencyNoise: 2>#
- LowQuality = <ShadowPreset.LowQuality: 0>#
- MediumQuality = <ShadowPreset.MediumQuality: 1>#
- property OSAOFlag#
Whether the object-space ambient occlusion (OSAO) is on or off.
Ambient occlusion improves the perception of depth in molecules, by simulating the fact that deeper regions are less accessible to light and are thus darker.
Object-space ambient occlusion (OSAO) is more realistic, but slower. Adjust the strength (OSAOStrength) of the effect to make objects lighter or darker.
- property OSAOGridSize#
The precision of the ambient occlusion effect (higher is better and slower)
- property OSAOStrength#
The strength of the ambient occlusion term.
- property SSAOFlag#
Whether the screen-space ambient occlusion (SSAO) effect os on or off.
Ambient occlusion</b> improves the perception of depth in molecules, by simulating the fact that deeper regions are less accessible to light and are thus darker.
Screen-space ambient occlusion (SSAO) efficiently provides an approximate simulation, but is sensitive to the distance to the camera. Adjust the strength (SSAOStrength) of the effect to make objects lighter or darker.
- property SSAOKernelSize#
The kernel size influences the quality (higher is better and slower).
- property SSAORadius#
The size of the potentially occluding region. Larger radii emphasize larger structures.
- property SSAORandomization#
A randomization term to smooth the ambient occlusion effect.
- property SSAOStrength#
The strength of the ambient occlusion term.
- Sharp = <ClippingPreset.Sharp: 4>#
- SoftShadow = <ShadowPreset.SoftShadow: 3>#
- White = <BackgroundType.White: 1>#
- property ambientLight#
The global light’s ambient light.
- property antiAliasingMultisamplingFactor#
The multisampling factor of anti-aliasing (MSAA) determines how many pixels are actually computed for each rendered pixel (higher is better and slower).
- property antiAliasingPreset#
The anti-aliasing preset (better is slower).
- property atomRadiusRatioToVanDerWaalsRadius#
The default atom size proportional to Van der Waals radius.
- property backgroundImageBase64#
The background image in base64.
- property backgroundImageMode#
The background image mode.
- property backgroundType#
The background type.
- property bloomFlag#
The bloom rendering option produces highlights on the brightest parts of the image.
- property bloomRadius#
The bloom radius.
- property bloomStrength#
The bloom strength.
- property bloomThreshold#
The bloom threshold.
- property clippingBorderSize#
The clipping border size.
- property clippingHalftoneAmplitude#
The the wave amplitude of clipping.
- property clippingHalftoneFrequency#
The the wave frequency of clipping.
- property clippingNoiseAmplitude#
The the noise amplitude of clipping.
- property clippingNoiseFrequency#
The the noise frequency of clipping.
- property clippingPreset#
The clipping preset.
- property clippingTransitionSize#
The clipping transition size.
- property constantAtomRadiusFlag#
If True then render atoms with a constant atom radius, else render atoms with the atom size proportional to Van der Waals radius.
- defaultAmbientLight = 0.10000000149011612#
- defaultAtomRadiusRatioToVanDerWaalsRadius = 0.20000000298023224#
- defaultBloomRadius = 10#
- defaultBloomStrength = 1.0#
- defaultBloomThreshold = 0.8999999761581421#
- defaultDepthOfFieldStrength = 20.0#
- defaultFirstLightIntensity = 1.0#
- defaultFirstLightLatitude = 45#
- defaultFirstLightLongitude = -45#
- defaultFirstLightSpecularIntensity = 0.5#
- defaultFirstLightSpecularPower = 52.0#
- defaultFresnelIntensity = 0.550000011920929#
- defaultFresnelPower = 1.0#
- defaultGridTransparency = 50#
- defaultOSAOGridSize = 16#
- defaultOSAOStrength = 0.5#
- defaultPinholeSharpness = 1#
- defaultSSAOKernelSize = 4#
- defaultSSAORadius = 200.0#
- defaultSSAORandomization = 150.0#
- defaultSSAOStrength = 0.6499999761581421#
- defaultScalePasses = 100#
- defaultScaleThickness = 2#
- defaultSecondLightIntensity = 0.25#
- defaultSecondLightLatitude = -45#
- defaultSecondLightLongitude = 45#
- defaultSecondLightSpecularIntensity = 0.5#
- defaultSecondLightSpecularPower = 8.0#
- defaultShadowMultisamplingFactor = 2#
- defaultShadowResolution = 3#
- defaultShadowSpread = 9.999999747378752e-05#
- defaultShadowTransparency = 60#
- defaultSilhouetteThickness = 1#
- defaultSilhouetteTransparency = 20#
- property depthOfFieldFlag#
This effect simulates the depth-of-field effect produced by actual cameras (e.g. blurred distant objects). If enabled, when you zoom in the molecule its distant parts will be blurred.
- property depthOfFieldStrength#
The strength of the depth-of-field effect.
- property descriptionForInspector#
A text description shown in the Inspector.
- property firstLightIntensity#
The first light’s intensity.
- property firstLightLatitude#
The first light’s latitude.
- property firstLightLongitude#
The first light’s longitude.
- property firstLightSpecularIntensity#
The first light’s specular intensity. The intensity of the light reflection on surfaces. High values make surfaces look like plastic, while low values make surfaces look matte.<br><br>Changes from 0 to 1.
- property firstLightSpecularPower#
The first light’s specular power. The decay of specular reflection. High values produce sharper specular reflections and make materials look shinier.
- property fresnelIntensity#
The global light’s fresnel intensity. Fresnel intensity influences how much light is reflected at grazing angles (higher is stronger).
- property fresnelPower#
The global light’s fresnel power. Fresnel power influences how materials reflect light at grazing angles (lower decreases the influence of the angle).
- property gridFlag#
The grid can provide an indication of the objects sizes, and can help when constructing molecular systems.
- property gridTransparency#
The grid transparency.
- property isCustomBackground#
A convenience function that return true if the custom gradient background is chosen.
- property isImageBackground#
A convenience function that return true if the image background is chosen.
- property lightingPreset#
The lighting preset.
- property pinholeFlag#
The pinhole effect makes objects less visible when they are far from the center of the viewport.
- property pinholeSharpness#
The pinhole sharpness.
- property renderMultipleBondsFlag#
If True then render multiple bonds explicitly (default), else the order of a bond is represented by its thickness.
- property scaleFlag#
The scale, shown in the bottom right part of the viewport, provides an indication of the objects sizes in the plane of the camera, i.e. the plane containing the camera target.
- property scalePasses#
The scale’s minimum lengths, in pixels.
- property scaleThickness#
The scale thickness, in pixels.
- property secondLightIntensity#
The second light’s intensity.
- property secondLightLatitude#
The second light’s latitude.
- property secondLightLongitude#
The second light’s longitude.
- property secondLightSpecularIntensity#
The second light’s specular intensity. The intensity of the light reflection on surfaces. High values make surfaces look like plastic, while low values make surfaces look matte.<br><br>Changes from 0 to 1.
- property secondLightSpecularPower#
The second light’s specular power. The decay of specular reflection. High values produce sharper specular reflections and make materials look shinier.
- property shadowFlag#
Shadow are particularly helpful to improve the perception of relative positions.
Note: on old graphics card you may want to either disable shadow or choose the lowest preset.
- property shadowMultisamplingFactor#
The shadow’s multisampling factor (higher is better and slower).
- property shadowPreset#
The preset for rendering shadow (better is slower).
- property shadowResolution#
The resolution of shadow (higher is better and slower).
- property shadowSpread#
The spread of shadow (higher is softer).
- property shadowTransparency#
The shadow transparency.
- property silhouetteFlag#
Silhouettes make it easier to separate regions with different depths.
- property silhouetteFogAttenuationFlag#
Whether fog attenuates silhouettes of distant objects.
- property silhouetteThickness#
The silhouette thickness, in pixels.
- property silhouetteTransparency#
The silhouette transparency.