Sub topic 12
Rendering a Preview and Exporting
This chapter assumes you can navigate Blender, select objects, switch between Object Mode and Edit Mode, and use modifiers. It also assumes the prop is centered near the world origin and has been checked against the reference images.
A preview render is a controlled test of the model. It reveals proportion problems, shading artifacts, missing bevels, and materials that looked correct in the viewport but fail under lighting. Exporting then creates a file for another application while preserving the editable Blender file.
Preparing the scene for a preview
Before rendering, make a clean copy of the working file. Save the .blend file with a useful name such as prop_preview_v01.blend. Keep modifiers available in this file so you can continue editing.
Check these items:
- Hide reference image objects from the render if they are not part of the prop.
- Make sure the camera can see the entire model.
- Confirm that the active camera is aimed at the prop.
- Add a ground plane if the prop needs a visible contact shadow.
- Use simple materials with clear differences between metal, plastic, glass, and painted surfaces.
- Check that smooth shading and sharp edges produce clean highlights.
- Apply object scale when appropriate. A scale of
(1, 1, 1)makes bevel widths and texture sizes easier to predict.
A three-point lighting setup is useful for a first preview. A large key light defines the main form, a weaker fill light reduces black areas, and a rim light separates the prop from the background.
import bpy
from mathutils import Vector
scene = bpy.context.scene
scene.render.engine = 'BLENDER_EEVEE_NEXT'
scene.render.resolution_x = 800
scene.render.resolution_y = 800
scene.render.resolution_percentage = 100
scene.render.image_settings.file_format = 'PNG'
scene.render.filepath = "//renders/prop_preview.png"
# Use a neutral world background.
scene.world.color = (0.04, 0.04, 0.04)
# Create or reuse a camera.
camera = bpy.data.objects.get("Preview Camera")
if camera is None:
camera_data = bpy.data.cameras.new("Preview Camera")
camera = bpy.data.objects.new("Preview Camera", camera_data)
bpy.context.collection.objects.link(camera)
camera.location = (3.5, -4.5, 2.8)
target = Vector((0.0, 0.0, 1.0))
camera.rotation_euler = (target - camera.location).to_track_quat('-Z', 'Y').to_euler()
camera.data.lens = 55
scene.camera = camera
# Create a broad key light.
light_data = bpy.data.lights.get("Preview Key")
if light_data is None:
light_data = bpy.data.lights.new("Preview Key", type='AREA')
key = bpy.data.objects.get("Preview Key")
if key is None:
key = bpy.data.objects.new("Preview Key", light_data)
bpy.context.collection.objects.link(key)
key.location = (2.5, -3.0, 4.5)
key.data.energy = 700
key.data.shape = 'DISK'
key.data.size = 3.0
key.rotation_euler = (target - key.location).to_track_quat('-Z', 'Y').to_euler()
bpy.ops.render.render(write_still=True)The double slash in the output path means that Blender saves the image relative to the current .blend file. Create the renders folder first if your Blender version does not create missing folders automatically.
Reading the preview
Inspect the image at 100% size. Look for:
- Silhouettes that disagree with the front, side, or top references.
- Bevels that are too wide or too small to catch a highlight.
- Boolean openings with dark interiors or visible cutter artifacts.
- Flat surfaces that show unwanted gradients.
- Floating parts, intersections, and gaps.
- Materials that do not communicate their intended physical type.
Fix the model and render again. Do not use lighting to hide a proportion error. Lighting should make a correct model easier to inspect.
Exporting the prop
Save the editable Blender file before exporting. For a general-purpose asset, glTF Binary (.glb) is a practical choice because it stores geometry, materials, and textures in one file. Export only the intended objects by selecting them first.
| Export format | Useful for | Main concern |
|---|---|---|
| GLB | Real-time viewers and many game engines | Verify material and texture support |
| FBX | Some game and animation pipelines | Export settings vary by application |
| OBJ | Basic geometry exchange | Materials, modifiers, and object structure are limited |
Apply modifiers only when the receiving application requires baked geometry. First duplicate the object or keep the original .blend file so the non-destructive version remains editable.
import bpy
# Select the finished prop before running this script.
bpy.ops.export_scene.gltf(
filepath="//exports/prop_final.glb",
export_format='GLB',
use_selection=True
)
bpy.ops.wm.save_as_mainfile(filepath="//prop_final.blend")Open the exported file in a separate viewer or a new Blender scene. Check the scale, orientation, mesh visibility, materials, UVs, and Boolean openings. An export that succeeds without an error can still contain missing textures or incorrect transforms.
Exercise
Why should you inspect an exported GLB in a separate viewer instead of relying only on Blender's export message?
Show answer
The export operation can finish successfully while the result still has missing textures, wrong scale, incorrect orientation, or unsupported material settings.