Absolutely! Here’s a unique and original Blender Python script that creates a beautiful, abstract "floating glass orbs in a glowing mist" scene. This script uses Blender’s Python API (bpy) and is designed for Blender 3.x.
What it does:
- Creates a ground plane with a glowing mist material.
- Generates several glassy orbs floating above the plane, each with a unique color and position.
- Sets up soft lighting and a camera for a pleasing composition.
Blender Python Script: Floating Glass Orbs in Glowing Mist
import bpy
import random
import math
# Clear existing objects
bpy.ops.wm.read_factory_settings(use_empty=True)
# Set render engine to Cycles for better glass/mist rendering
bpy.context.scene.render.engine = 'CYCLES'
bpy.context.scene.cycles.device = 'GPU'
# Create ground plane
bpy.ops.mesh.primitive_plane_add(size=20, location=(0, 0, 0))
ground = bpy.context.active_object
ground.name = "Ground"
# Create glowing mist material for ground
mist_mat = bpy.data.materials.new(name="GlowingMist")
mist_mat.use_nodes = True
nodes = mist_mat.node_tree.nodes
links = mist_mat.node_tree.links
# Clear default nodes
for node in nodes:
nodes.remove(node)
# Add nodes for mist
output = nodes.new(type='ShaderNodeOutputMaterial')
emission = nodes.new(type='ShaderNodeEmission')
emission.inputs['Color'].default_value = (0.6, 0.8, 1.0, 1) # Soft blue
emission.inputs['Strength'].default_value = 2.0
transp = nodes.new(type='ShaderNodeBsdfTransparent')
mix = nodes.new(type='ShaderNodeMixShader')
mix.inputs['Fac'].default_value = 0.7
links.new(emission.outputs[0], mix.inputs[2])
links.new(transp.outputs[0], mix.inputs[1])
links.new(mix.outputs[0], output.inputs[0])
ground.data.materials.append(mist_mat)
# Create glass orbs
num_orbs = 12
for i in range(num_orbs):
# Random position
x = random.uniform(-6, 6)
y = random.uniform(-6, 6)
z = random.uniform(1.5, 4.5)
radius = random.uniform(0.5, 1.2)
bpy.ops.mesh.primitive_uv_sphere_add(radius=radius, location=(x, y, z))
orb = bpy.context.active_object
orb.name = f"GlassOrb_{i}"
# Glass material
glass_mat = bpy.data.materials.new(name=f"GlassMat_{i}")
glass_mat.use_nodes = True
nodes = glass_mat.node_tree.nodes
links = glass_mat.node_tree.links
# Clear default nodes
for node in nodes:
nodes.remove(node)
# Add nodes for glass
output = nodes.new(type='ShaderNodeOutputMaterial')
glass = nodes.new(type='ShaderNodeBsdfGlass')
glass.inputs['IOR'].default_value = 1.45
# Random pastel color
hue = random.random()
color = [0, 0, 0, 1]
color[0], color[1], color[2] = [c for c in bpy.types.ColorRamp.bl_rna.properties['color_mode'].enum_items['RGB'].name]
color = list(bpy.types.ColorRamp.bl_rna.properties['color_mode'].enum_items['RGB'].name)
color = [0.5 + 0.5 * math.sin(hue * 2 * math.pi + i) for i in range(3)] + [1]
glass.inputs['Color'].default_value = color
links.new(glass.outputs[0], output.inputs[0])
orb.data.materials.append(glass_mat)
# Add a soft area light
bpy.ops.object.light_add(type='AREA', location=(0, 0, 8))
light = bpy.context.active_object
light.data.energy = 2000
light.data.size = 8
light.data.color = (0.8, 0.9, 1.0)
# Add a camera
bpy.ops.object.camera_add(location=(0, -14, 6), rotation=(math.radians(70), 0, 0))
cam = bpy.context.active_object
bpy.context.scene.camera = cam
# Optional: Add subtle volumetric mist to the world
world = bpy.context.scene.world
world.use_nodes = True
wnodes = world.node_tree.nodes
wlinks = world.node_tree.links
# Add volume scatter
vol_scatter = wnodes.new(type='ShaderNodeVolumeScatter')
vol_scatter.inputs['Color'].default_value = (0.6, 0.8, 1.0, 1)
vol_scatter.inputs['Density'].default_value = 0.03
wlinks.new(vol_scatter.outputs[0], wnodes['World Output'].inputs['Volume'])
print("Scene created: Floating Glass Orbs in Glowing Mist!")
How to Use
- Open Blender (3.x recommended).
- Open a new Text Editor window.
- Paste the script above.
- Click "Run Script".
You’ll see a beautiful, original scene with floating glass orbs in a glowing mist, ready to render!
Feel free to tweak the parameters (number of orbs, colors, mist strength, etc.) for your own unique vision! If you want a different style or theme, just ask!