> ## Documentation Index
> Fetch the complete documentation index at: https://docs.summerengine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Capture_paint_view (Painted 25d world skill)

> capture_paint_view.gd from the Painted 25d world skill in the Summer Engine skill library. Build a 2D or 2.5D game as a painted world: a 3D blockout under one fixed camera, an AI paint-over projected onto it, sprite characters.

> [!NOTE]
>
> Part of the [`painted-25d-world` skill](/skills/painted-25d-world). The skill links here when your agent needs the detail.

```gdscript capture_paint_view.gd theme={null}
extends Node
## Renders a location's plain, lit blockout through its PaintCamera into a PNG of an exact size, then quits.
## Make a scene with only this node, set `level` (the world scene) and `camera_path`, and play it. The PNG is the
## structure image for the paint-over. Keep size at the painting's aspect (16:9). Needs a rendering run (the
## editor's play, or a windowed run); a --headless run renders nothing.

@export var level: PackedScene
@export var size := Vector2i(2048, 1152)
@export var out_path := "res://painted/blockout.png"
## The location's paint camera inside `level`.
@export var camera_path := "Village/PaintCamera"

func _ready() -> void:
	var vp := SubViewport.new()
	vp.size = size
	vp.render_target_update_mode = SubViewport.UPDATE_ALWAYS
	vp.own_world_3d = true
	add_child(vp)
	var lvl := level.instantiate()
	# no painting: painted_world.gd then shows the plain blockout, lit, through the paint camera
	for node in lvl.find_children("*", "Node3D", true, false):
		if "paint" in node:
			node.paint = null
	vp.add_child(lvl)
	await get_tree().process_frame
	(lvl.get_node(camera_path) as Camera3D).make_current()
	for i in 4:
		await RenderingServer.frame_post_draw
	var img := vp.get_texture().get_image()
	img.save_png(out_path)
	print("PAINT_VIEW_SAVED ", ProjectSettings.globalize_path(out_path), " ", img.get_size())
	get_tree().quit()
```

***

Source: [`library/skills/painted-25d-world/_building-blocks/capture_paint_view.gd`](https://github.com/SummerEngine/summer/blob/main/library/skills/painted-25d-world/_building-blocks/capture_paint_view.gd), rendered from `summer-engine@4.5.0` on npm.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.