Blender Pixel Perfect Python Extensions and Asset Library
Created by Luke Stilson 2022


2D Tools

composition panel
The Composition Panel within 2D Tools simply controls the current scene render resolution. The Select Camera button selects the camera associated with the current Scene (if one exists)

For best results, set the composition size (or scene render resolution) before adding 2D layers in the panel below. If this is changed after adding 2D layers, they will not be an accurate pixel size (the panel will prompt you if this occurs and provide a method to fix)
2D tools panel
The Solids panel is contextual based on selected objects (see below), and contains functionality for creating planes as pixel-based 2D shapes relative to the Composition size.
The Make Camera 2D button sets the camera's transform to (0,0,10), faces the camera in the -Z direction, sets the camera to Orthographic, and sets the camera's Orthographic size to 10. If no camera exists in Scene, this button creates a new camera with the settings mentioned.

For 2D layer size to be pixel-accurate, the camera must be orthographic, but can be any scale.
The camera faces -Z as to make the X axis left to right, the Y axis up and down, and the Z axis as depth

The Add Layer button creates a new plane and applies a geometry node modifier "bpx_geo" to control the size of the plane in pixes relative to the canvas size. By default, this plane is added at the size of 1024x1024 pixels. When Selected, the user can manipulate the pixel size via the expanded panel shown below.

There is no need to alter the values of the geometry node inputs outside of the 2D Tools panel
2D tools panel expanded
When a 2D layer is selected, additional options populate the panel. Set the pixel-size width and height of the layer here.

The Match Cam Size button sets the 2D Layer's size to match the Canvas Size (render resolution).

Each 2D Layer, when added via the New Layer button, will appear with a unique material, allowing for an image texture to be added. This texture is visible in this panel, and able to be changed.

The Match Texture Size button applies the image's resolution to the selected 2D layer (allowing for quick reference images as planes)

Any material can be applied to the 2D Layer, but functionality to add a texture will only be visible when the default material (bpx_defaultMat) is active on the selected 2D Layer

If canvas size (render resolution) or camera size (orthographic camera scale) is changed after adding 2D Layers, an error message will appear in the panel, with a button "Fix Pixel Size". Select each 2D layer individually, and click this button for each to make the pixel dimensions of the layer accurate to the render size.