PgrSpineRenderer allows you to take the index files generated by pgr-assets and render that prefab into an actual videos. This renderer will account for the different way the files could be loaded, ordering of the various spine layers that build up a single PGR prefab, and implements some Unity-specific concepts (such as the BoneFollower) to get near-parity to the animations used in-game. Furthermore, in the same spirit as the rest of Huaxu's asset tools, this renderer is designed to be able to skip work that has not changed, allowing me to incrementally update the game's assets without having to re-render everything every update.
While the animations rendered might not be perfect right now, they are in the realm of "good enough".
# Simple usage: render one video
PgrSpineRenderer "path/to/index.json"PgrSpineRenderer
Description:
Renders the animations of the specified index files to video.
Animations will be written to the `render` directory in the same directory as the index file,
with each animation being a separate video.
Each animation also gets a `{animation}.webp` poster image of its first frame,
for use as a placeholder while the video loads.
Symbolic links to the default animation will be created as `_default.{ext}` and
`_default.webp`, allowing for easy access to the default animation without knowing the name.
When multiple index files are specified, they will be rendered in parallel,
depending on the number of threads specified.
By default the renderer will render to VP9 (webm) at 30fps.
Usage:
PgrSpineRenderer <indexes>... [options]
Arguments:
<indexes> The index files for the spines to render
Options:
--fps <fps> The frames per second of the output video [default: 30]
-c, --codec <H264|H264NV|VP9> The codec to use for the output videos. Defaults to 'vp9'
[default: VP9]
--encode-threads, --et <encode-threads> The number of threads to use for encoding. Might be capped by
hardware limits (nvenc) [default: 1]
--render-threads, --rt <render-threads> The number of threads to use for rendering [default: 1]
-s, --scale <scale> Supersampling factor: frames are rendered at this multiple
of the output size [default: 2]
-f, --force Force rendering even if the index file has not changed
--version Show version information
-?, -h, --help Show help and usage informationRenders produced before poster images existed have videos but no .webp files. To backfill an
existing render tree without re-rendering anything:
./scripts/backfill-keyframes.sh <root-dir>
It walks the tree for render directories and pulls frame 0 out of each .vp9.webm. Pass -n for a
dry run, or set FORCE=1 to overwrite posters that already exist. Only vp9 is used as a source,
because it is the default codec, so it is the one reliably present in a render tree, and it keeps
alpha. Directories rendered as h264 only are skipped with a warning.