Black CraftDev

Docs/Meshes

Model Viewer

Show a material or a model on a lit stage you can orbit, then render it out as an icon, a silhouette or a sheet of animation frames.

EditionPro only · launching soonMenuTools›BlackCraft›Hexbench›Meshes›Model ViewerClassModelViewerWindow

A lit stage for checking a material or model, typically after running the Map Generator, Channel Packer or Batch Material Creator. Does the normal map read? Is the smoothness doing anything? Does it tile? The same stage can render to a file for icons and previews.

Open it with Tools›BlackCraft›Hexbench›Meshes›Model Viewer, or right-click an asset and choose BlackCraft > Open in Model Viewer.

The stage switches (Turntable, Animate, Grid, Gizmo, Handles, Stats) are repeated on the toolbar. When the window is narrow, the ones that do not fit move into an overflow menu.

Loading something

Drop a Material, Mesh or Prefab on the Target area; models and scene objects count as prefabs here. You can also browse with the picker. The kind dropdown only affects browsing, because Unity's picker lists one type at a time. From Selection takes whatever is selected in the Project window.

KindWhat happens
MaterialShown on the shape picked below
MeshReplaces the shape, with a slot per submesh
PrefabIts renderers are drawn, with a slot for each

A prefab is read, not instantiated, so none of its scripts run. Only LOD0 is drawn, and skinned meshes stay in bind pose until a clip plays.

The Mesh Auditor, Mesh Extractor and Batch Material Creator can all send a target here, and the overflow menu passes a mesh or prefab on to the UV Editor. New stages take their starting values from the Model Viewer settings asset.

Moving the view

GestureWhat it does
Drag, clear of the subjectOrbit
Alt-drag, anywhereOrbit
Middle-dragPan
ScrollZoom
Double-click or FrameFrame the subject

The axis gizmo has a ball per axis (X red, Y green, Z blue); click one to look down that axis. View jumps to Front, Side or Top and toggles Orthographic. Iso is a toggle for a true orthographic isometric view, and turning it off puts back the view you had before. Until you move the camera yourself, the view keeps fitting the pane.

Placing the subject

Placement offsets the subject from its authored transform. Drag the gizmo's arrows to move it and its rings to rotate it, or type values in. Rotations are about the subject's centre, in world axes. Reset Placement puts it back, and Show Gizmo hides the handles. Each move is a single undo step, and so are changes to the target, slots and lamps.

Shape and materials

When a material is loaded, Shape chooses what it is shown on. The default sphere is generated, and you can raise Subdivisions for smooth metals. UV Tiling is baked into a copy of the shape, which keeps the material asset untouched. A mesh or prefab supplies its own geometry, so only Scale applies.

Loading a mesh or prefab adds a Materials fold with a row for each renderer submesh. An empty row keeps the original material. Rows are keyed by renderer path and submesh, so reimporting cannot shift an assignment to the wrong part.

Shader hooks

A project can register an IStageMeshHook with StageMeshHooks to draw a part with its own mesh copy, for shaders that need data the asset does not have. The asset itself is not written.

Shaders can read the placed subject's world-space box from the globals _StageSubjectMin and _StageSubjectMax, whose w is 1 while the viewer has set them. That is useful for effects spanning the whole model. During a render, _StagePixelScale holds rendered pixels per pane pixel (it is 1 otherwise), so a material sized in pixels can divide it out and export at the size shown in the pane.

Lighting

Load Preset has Studio, Key Only, Soft Box, Rim, Top Down and Outdoor. To share a rig of your own, name it and press Save, and it goes into the settings asset. Editing a loaded rig leaves the preset as it was.

Each lamp has Yaw, Pitch, Distance (measured in subject radii), Follow Camera, and a Kind of directional, point or spot. Show Handles puts draggable markers on the stage. Markers on the far side are drawn hollow, and hovering a lamp shows its range or cone.

Background, floor and environment

Background can be a gradient (the default), transparent, a solid colour, or a texture set to fit, fill, stretch or tile. Transparent shows as a checkerboard in the pane. The background is part of the scene, so it appears in renders.

Floor adds a fading ground plane with X and Z marked. Ambient and Reflection control light that does not come from the lamps. Metals need a reflection cubemap; without one they render nearly black.

Post processing

Post Processing works on the finished picture, both in the pane and in renders, on any pipeline.

Bloom makes pixels brighter than Threshold glow, and with a threshold above 1 only HDR colours bloom. Spread is relative to the picture, so a render of any size matches the pane. In a transparent render the glow keeps its own alpha. Tone Mapping offers Neutral or ACES, with Exposure in stops. Vignette darkens the edges in whatever colour you pick.

Handles and the floor are drawn in the scene, which means the pane shows them through the effects. Renders leave the handles out.

Statistics

Stats shows counts for the stage. It counts submesh draws, which are not the same as draw calls, because build-time batching is invisible to a preview.

Rendering

Render writes the stage to a file at any size. Size is a preset or custom, and Supersample smooths edges, stepping down automatically if the render would be too large.

Transparent takes alpha from a separate coverage pass, because pipelines write arbitrary alpha on opaque surfaces. Materials in the transparent queue keep their blended alpha when the pipeline returns it. Mode: Silhouette renders a flat-colour shape, and Respect Alpha Clip keeps cut-out materials cut out. Format can be PNG, JPG (no alpha), TGA or EXR.

Renders match the pane's colours in both linear and gamma projects. Each file is imported and pinged in the Project window.

Animation

Animate poses a temporary copy of the target, with its scripts removed before it activates. The copy is deleted when you turn Animate off. Clip lists the controller's states and the model's clips, and Custom Clip accepts any clip. The transport has step, play, Loop, a time slider, speed and a frame counter. The view frames everything the clip reaches. Humanoid clips need a humanoid avatar.

Batch

Batch renders a matching set of images from a single recipe. Build the list with Add, From Selection and Clear, then Render All writes one file per target. Frame Each refits the camera for every target; turn it off to keep their relative sizes. Frames, Columns and Layout render a clip either as one sheet or as numbered files, and a note shows the sheet size before you render.

Limits

There are no shadows, because URP does not render them for preview cameras. Colour temperature depends on a project graphics setting, which is on under URP. Shaders that read globals set by a game system, such as sky or weather, will look different here since those globals are unset.

previewviewerstageorbitlightsrigbackgroundflooriconrendersilhouetteanimationbatchsprite sheet