EffectFormat and ThreeDFormat — Aspose.Slides FOSS for Python API Reference

Aspose.Slides FOSS provides two separate format objects for advanced shape styling: EffectFormat for 2D visual effects and ThreeDFormat for three-dimensional appearance.

Package: aspose.slides_foss

Both are accessed from any Shape object:

ef = shape.effect_format     # EffectFormat
tdf = shape.three_d_format   # ThreeDFormat

EffectFormat

EffectFormat controls effects rendered in the same plane as the slide: drop shadows, glows, soft edges, blurs, and reflections.

Properties

PropertyTypeDescription
is_no_effectsboolTrue when no effects are active.
outer_shadow_effectOuterShadow | NoneDrop shadow outside the shape boundary. None until enable_outer_shadow_effect() is called.
inner_shadow_effectInnerShadow | NoneShadow cast inside the shape boundary. None until enabled.
glow_effectGlow | NoneColored glow around the shape edge. None until enable_glow_effect() is called.
blur_effectBlur | NoneGaussian blur of the shape. None until set_blur_effect() is called.
soft_edge_effectSoftEdge | NoneFeathered edge fade. None until enable_soft_edge_effect() is called.
reflection_effectReflection | NoneMirror reflection below the shape. None until enabled.

Enable / Disable Methods

MethodDescription
enable_outer_shadow_effect()Create and attach an OuterShadow with default settings.
disable_outer_shadow_effect()Remove the outer shadow.
enable_glow_effect()Create and attach a Glow with default settings.
disable_glow_effect()Remove the glow.
enable_soft_edge_effect()Create and attach a SoftEdge.
disable_soft_edge_effect()Remove the soft edge.
set_blur_effect(radius, grow)Apply a Gaussian blur. radius is in points; grow (bool) controls whether the blur area expands the shape bounds.

OuterShadow Properties

PropertyTypeDescription
blur_radiusfloatShadow softness in points. Larger = softer edge.
directionfloatShadow angle in degrees (0 = right, 90 = down, 315 = upper-left).
distancefloatOffset distance in points between shape and shadow center.
shadow_colorColorFormatShadow color with alpha. Use Color.from_argb(alpha, r, g, b) for semi-transparent shadows.

Glow Properties

PropertyTypeDescription
radiusfloatGlow spread radius in points.
colorColorFormatGlow color.

SoftEdge Properties

PropertyTypeDescription
radiusfloatFeather radius in points.

Blur Properties

PropertyTypeDescription
radiusfloatBlur radius in points.

ThreeDFormat

ThreeDFormat gives a flat shape a three-dimensional appearance by defining bevel, camera perspective, light source, material, and extrusion depth.

Properties

PropertyTypeDescription
bevel_topShapeBevelBevel applied to the top (front) face of the shape.
bevel_bottomShapeBevelBevel applied to the bottom (back) face.
cameraCameraCamera position/projection for the 3D view.
light_rigLightRigLight source preset and direction.
materialMaterialPresetTypeSurface material appearance (e.g., METAL, PLASTIC, MATTE).
depthfloatExtrusion depth in points.
contour_widthfloatWidth of the shape contour/edge highlight in points.
contour_colorColorFormatColor of the contour.

ShapeBevel Properties

PropertyTypeDescription
bevel_typeBevelPresetTypeBevel shape preset (e.g., CIRCLE, RELAXED_INSET, COOL_SLANT, DIVOT, HARD_EDGE, SLOPE, CONVEX).
widthfloatHorizontal bevel size in points.
heightfloatVertical bevel size in points.

Camera Properties

PropertyTypeDescription
camera_typeCameraPresetTypePreset camera position (e.g., PERSPECTIVE_ABOVE, ISOMETRIC_LEFT_UP, ORTHOGRAPHIC_FRONT).

LightRig Properties

PropertyTypeDescription
light_typeLightRigPresetTypeLight preset (e.g., BALANCED, THREE_PT, SOFT, HARSH, FLOOD).
directionLightingDirectionDirection the light comes from (e.g., TOP, BOTTOM, LEFT, RIGHT, TOP_LEFT).

MaterialPresetType Values

ValueAppearance
STANDARDDefault matte-like surface
WARMWarm tonal surface
COOLCool tonal surface
PLASTICSmooth plastic sheen
METALMetallic reflective surface
MATTEFlat non-reflective
WIREFRAMEWireframe outline only

Usage Examples

Outer Drop Shadow

from aspose.slides_foss import ShapeType
from aspose.slides_foss.drawing import Color
import aspose.slides_foss as slides
from aspose.slides_foss.export import SaveFormat

with slides.Presentation() as prs:
    shape = prs.slides[0].shapes.add_auto_shape(ShapeType.RECTANGLE, 100, 100, 250, 100)
    ef = shape.effect_format
    ef.enable_outer_shadow_effect()
    ef.outer_shadow_effect.blur_radius = 10
    ef.outer_shadow_effect.direction = 315   # upper-left shadow
    ef.outer_shadow_effect.distance = 8
    ef.outer_shadow_effect.shadow_color.color = Color.from_argb(128, 0, 0, 0)
    prs.save("shadow.pptx", SaveFormat.PPTX)

Gold Glow Effect

from aspose.slides_foss import ShapeType
from aspose.slides_foss.drawing import Color
import aspose.slides_foss as slides
from aspose.slides_foss.export import SaveFormat

with slides.Presentation() as prs:
    shape = prs.slides[0].shapes.add_auto_shape(ShapeType.ELLIPSE, 100, 100, 200, 200)
    ef = shape.effect_format
    ef.enable_glow_effect()
    ef.glow_effect.radius = 15
    ef.glow_effect.color.color = Color.gold
    prs.save("glow.pptx", SaveFormat.PPTX)

Soft Edge Fade

from aspose.slides_foss import ShapeType
import aspose.slides_foss as slides
from aspose.slides_foss.export import SaveFormat

with slides.Presentation() as prs:
    shape = prs.slides[0].shapes.add_auto_shape(ShapeType.RECTANGLE, 100, 100, 300, 150)
    ef = shape.effect_format
    ef.enable_soft_edge_effect()
    ef.soft_edge_effect.radius = 12
    prs.save("soft-edge.pptx", SaveFormat.PPTX)

3D Bevel with Metal Material

from aspose.slides_foss import (
    ShapeType, BevelPresetType, CameraPresetType,
    LightRigPresetType, LightingDirection, MaterialPresetType,
)
import aspose.slides_foss as slides
from aspose.slides_foss.export import SaveFormat

with slides.Presentation() as prs:
    shape = prs.slides[0].shapes.add_auto_shape(ShapeType.RECTANGLE, 100, 100, 200, 100)
    tdf = shape.three_d_format
    tdf.bevel_top.bevel_type = BevelPresetType.CIRCLE
    tdf.bevel_top.width = 10
    tdf.bevel_top.height = 5
    tdf.camera.camera_type = CameraPresetType.PERSPECTIVE_ABOVE
    tdf.light_rig.light_type = LightRigPresetType.BALANCED
    tdf.light_rig.direction = LightingDirection.TOP
    tdf.material = MaterialPresetType.METAL
    tdf.depth = 20
    prs.save("3d-bevel.pptx", SaveFormat.PPTX)

Combining Effects

from aspose.slides_foss import ShapeType
from aspose.slides_foss.drawing import Color
import aspose.slides_foss as slides
from aspose.slides_foss.export import SaveFormat

with slides.Presentation() as prs:
    shape = prs.slides[0].shapes.add_auto_shape(ShapeType.ROUNDED_RECTANGLE, 100, 100, 280, 120)
    ef = shape.effect_format

    # Add both shadow and glow simultaneously
    ef.enable_outer_shadow_effect()
    ef.outer_shadow_effect.blur_radius = 8
    ef.outer_shadow_effect.direction = 270  # downward shadow
    ef.outer_shadow_effect.distance = 5
    ef.outer_shadow_effect.shadow_color.color = Color.from_argb(100, 0, 0, 0)

    ef.enable_glow_effect()
    ef.glow_effect.radius = 8
    ef.glow_effect.color.color = Color.from_argb(180, 0, 120, 255)

    print(f"Has effects: {not ef.is_no_effects}")
    prs.save("combined-effects.pptx", SaveFormat.PPTX)

See Also