Repository navigation
16. Tools
ℹ️ Early Access Feature
This feature is on an early access period and can heavily change during its development depending on the feedback we receive from the community.
The Flipbook Extractor Tool is a tool similar to the Sprite Extractor Tool that comes with Paper2D, from where you can extract individual sprites based on some metrics given.
This tool adds some extra features on top of that, giving you the option to extract one or more groups of sprites from a texture and bundle them up as flipbooks, as well as the option to set up the extracted flipbooks as animation sequences and add them to an animation source.
In order to open the flipbook extractor, find a Texture 2D asset in your project and right click on it. Look for the "PaperZD Actions" menu and click on "Extract Flipbook", this will open the extractor tool with the selected texture.
To extract ore or more flipbooks you need to add the configuration on the Flipbooks settings, which will determine the amount of flipbooks to extract.
On each of them you can configure multiple parameters to apply to the extracted flipbook and sprites, but the most important will be in the "Extraction" section where you can specify the size of each sprite, amount of sprites and margin or paddings.
Once you setup the setting with your required configuration, you will be able to see some outlining and relevant information in the left panel, which will give you information about how the sprite and flipbooks are going to be extracted, where each square represents one individual sprite, the top left number represents the ID of the flipbook and the top right number represents the ID of the sprite within the flipbook.
After you have all your flipbooks set up, you can assign them to one or more animation sequences that will get created when extracting.
First, you will need to enable the "Create Animation Sequence" in the Animation settings as well as adding one element in the "Animation Sequence Settings" per animation sequence that you would like to create. You must either set a reference to an already existin animation source asset file in "Animation Source" or enable "Create Animation Source" to create one when extracting.
Lastly, in the "Animation" section inside each flipbook configuration you can specify the "Animation Sequence ID" (where the ID comes from the index number on the array from the "Animation Sequence Settings") to the sequence you would like the flipbook to be added to. Alternatively, you can leave it to -1 if you would like to create one animation sequence per flipbook extracted.
In addition, you can specify the direction of the flipbook within the animation sequence by specifying the "Animation Sequence Direction Index". This index determines the clockwise order of each flipbook. You can leave it as -1 if you want the tool to automatically set it up (only if multiple flipbooks are assigned to the same animation sequence). E.g. In an animation sequence with 4 directions: 0 = Up, 1 = Right, 2 = Down, 3 = Left.
With this tool you will be able to create as many flipbooks and animation sequences as you wish and extract and set them up with a simple click of a button.
The settings for the background colour and outlines of the visualization tool.
- Viewport Texture Tint: Apply a tint to the texture in the viewport to improve outline visibility in this editor.
- Background Color: The viewport background color.
The naming templates of the generated files.
- Flipbook Naming Template: The base name of all the flipbook asset files that will be created when extracting.
- Sprite Naming Template: The base name of all the sprite asset files that will be created when extracting.
- Animation Sequence Naming Template: The base name of all the animation sequence asset files that will be created when extracting.
- Animation Source Naming Template: The base name of the animation source asset file that will be created when extracting.
- Animation Blueprint Naming Template: The base name of the animation blueprint asset file that will be created when extracting.
The animation settings for generating PaperZD assets.
- Animation Source: A reference to the animation source asset to use when creating an animation blueprint and the animation sequences.
- Create Animation Blueprint: If an animation blueprint asset should be created when extracting the flipbooks (it will use the animation source (if specified) or the newly created animation source (if enabled)).
- Create Animation Source: If an animation source should be created when extracting the flipbooks (it will be used by the newly created animation blueprint and animation sequences if enabled).
- Create Animation Sequence: If animation sequences should be created when extracting the flipbooks.
-
Animation Sequence Settings: The configuration for the animation sequences created. Add one setting per sequence you would like to create.
- ID: (hidden) The identifier of this configuration (the id is the index on the array).
- Category: The category set for the animation sequence.
- Animation Sequence Naming Template: The naming template used for the animation sequence where {0} will get replaced by the "Animation Sequence Naming Template".
The settings for each flipbook that will be extracted by the tool. Add one setting per flipbook that you would like to extract.
-
Coloring:
- Outline Color: The color used for the flipbook outline in the visualization tool.
-
Naming:
- Flipbook Naming Template: The name of the flipbook that will be created. {0} will get replaced by the generic flipbook name {1} will get replaced by the flipbook number.
- Flipbook Naming Start Index: The number to start naming flipbooks with.
- Sprite Naming Template: The name of the sprite that will be created. {0} will get replaced by the generic sprite name {1} will get replaced by the sprite number.
- Sprite Naming Start Index: The number to start naming sprites with.
- Anim Sequence Naming Template: The name of the anim sequence that will be created. {0} will get replaced by the generic anim sequence name {1} will get replaced by the sprite number.
-
Flipbook:
- Frames Per Second: The flipbook speed.
-
Sprite:
- Pivot Mode: The pivot mode that will be set for the extracted sprites.
- Custom Pivot Mode Reference: The pivot point to use as a base for the custom pivot point (only if custom pivot mode is specified). Set it to "Custom" to not use any pivot mode as a reference.
- Custom Pivot Point: The relative value to add on top of the base pivot point (unless "Custom" is set in "Custom Pivot Mode Reference").
-
Animation:
- Animation Sequence ID: The ID of the animation sequence to use from the extracted flipbook (Must match with the "Animation" > "Animation Sequence Settings" > "ID") (Leave to -1 to have separate animation sequences).
- Animation Sequence Direction Index: The direction index of the animation sequence clockwise (leave it to -1 to auto pick) (E.g. In an animation sequence of 4 directions: 0 = up, 1 = right, 2 = down, 3 = left).
-
Extraction:
- Cell Width: The width of each sprite.
- Cell Height: The height of each sprite.
- Num Cells X: Number of cells extracted horizontally. Can be used to limit the number of sprites extracted. Set to 0 to extract all sprites.
- Num Cells Y: Number of cells extracted vertically. Can be used to limit the number of sprites extracted. Set to 0 to extract all sprites.
- Margin X: Margin from the left of the texture to the first sprite.
- Margin Y: Margin from the top of the texture to the first sprite.
- Spacing X: Horizontal spacing between sprites.
- Spacing Y: Vertical spacing between sprites.
In order to make repetitive extraction easy, we added the extraction presset feature, which allows to save the current extraction settings to be used again later on. These settings will get saved into the PaperZD Project Settings.
To save a preset, set up the settings you want to save and then specify the preset name in "New Preset" and click "Save". If you want to modify an already existing preset, write the name of the existing preset in "New Preset" and click "Save".
To delete a previously saved preset, select the preset from the dropdown menu in "Saved Pressets" and click "Delete".
To apply a previously saved preset, select the preset from the dropdown menu in "Saved Presets" and click "Apply".