# Tool documentation

## Tags manager location

\
The utility widget is available as scripted actor action entry, you just need to right click on an actor(s) :arrow\_right: Scripted actor actions :arrow\_right: Open Tag Manager

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image.png" alt="" height="981" width="1019"><figcaption></figcaption></figure>

\
By default, the tool will not find any available library and will ask you if you want to create one:

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-1.png" alt="" height="373" width="640"><figcaption></figcaption></figure>

\
You can create it by clicking on ![](https://1258810894-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyBwCoiki2fXp3dSMiTWB%2Fuploads%2F2BmfkKTrFqXnTRBbhQ7P%2Fimage.png?alt=media\&token=724b1bee-7533-401a-b21c-f495cb0b8f3b).

{% hint style="info" %}
You can save the library anywhere in your content browser
{% endhint %}



{% hint style="info" %}
You can create manually a library by creating a new DataAsset of type "BP\_TagLibrary\_Base" \
\
<img src="https://1258810894-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyBwCoiki2fXp3dSMiTWB%2Fuploads%2FIFRV8m6dlS9nl4TTJ46N%2Fimage.png?alt=media&#x26;token=d9a28ef8-c586-49ea-af07-db12220f5945" alt="" data-size="original">\
![](https://1258810894-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyBwCoiki2fXp3dSMiTWB%2Fuploads%2F7nNsLcnejgxipwAE72Xt%2Fimage.png?alt=media\&token=c7a3e6c4-a401-47ed-ae83-41ed8678510b)
{% endhint %}

## Library and tags creation

Once the library is created, you can add your tags and set their options.

Here are the options for the library and its tags:

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-5.png" alt="" height="576" width="640"><figcaption></figcaption></figure>

### **Library options**

**Tag Prefix**: (optional) A string prefix which will be prepend to any tag value of the library.\
\
**Description:** (optional) A string that describe the library, it will be displayed as a tooltip on the drop down menu of the libraries selection.\
\
**Tags:** The list of tags to be assigned in that library.\
\
**Hidden:** If True, the library will be hidden from the selection menu. (Unless “Show hidden” is checked)\
\
**Deprecated:** Will turn all the tags of the library to deprecated ( see tag options bellow for more infos ).\
\
**Enable Library Callback:** Enable the callback which will be run on any of the tags assignation / removal of this library.\
\
**Library BPCallback:** (optional) The callback blueprint to be executed. It must be of type _BP\_TagCallback\_Base_ more on that bellow.\
\


<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-25.png" alt="" height="313" width="674"><figcaption><p>A tag and its options</p></figcaption></figure>

### **Tag Options**

**Tag:** The actual tag value ( the string which will be used as tag ), library prefix might be added.\
\
**TagDescription:** (optional) The description of the tag, will be displayed as tooltip.\
\
**Deprecated:** Will turn the tag deprecated, that means it will still be shown in the list of tags, and can be removed from actors, but not added.\
\
**EnableLibraryCallback:** If True and a library callback is set, then it will be executed, otherwise the library callback will be skipped for that tag.\
\
**EnableTagCallback:** If True, it will execute the callback ( if any ) set on that tag. The tag callback will be executed _**after**_ the library callback ( if any ).\
\
**BPCallback:** (optional) The callback blueprint to be executed. It must be of type _BP\_TagCallback\_Base_ more on that bellow.\
\
**Hidden:** If True, the tag will be hidden from the tags list. (Unless “Show hidden” is checked)

{% hint style="warning" %}
After a library creation, you have to force refresh the tool state by clicking the refresh button:

![](https://1258810894-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyBwCoiki2fXp3dSMiTWB%2Fuploads%2F2CuHXfjuOaO4ZoAgljsL%2Fimage.png?alt=media\&token=b7181e2c-04b1-40f8-a01b-bb825befd17f)
{% endhint %}

***

Example of a tag library and how it will be displayed:\


<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-27-540x1024.png" alt="" height="1024" width="540"><figcaption><p>A tag library data</p></figcaption></figure>

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-28.png" alt="" height="488" width="643"><figcaption><p>The library displayed in the UI</p></figcaption></figure>

***

## Assign / remove tags

To assign or remove a tag, you just need to select one or multiple actors and click on the entry, it will turn green:

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-29-1024x487.png" alt="" height="487" width="1024"><figcaption></figcaption></figure>

\
The remove a tag, just click again on the tag entry.

If you select multiple actors, and a tag is partially assigned, then it will appear with dark strips:\


<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-38.png" alt="" height="52" width="453"><figcaption></figcaption></figure>

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-31-1024x398.png" alt="" height="398" width="1024"><figcaption></figcaption></figure>

\
\=> If you click on a partially assigned tag like that, it will be assigned to the missing actor(s).

The refresh of the state of the tag entries (are they assigned or not on the current selected actors), can be done automatically, or manually with this option:\


<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-32.png" alt="" height="211" width="651"><figcaption></figcaption></figure>

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-33.png" alt="" height="177" width="647"><figcaption></figcaption></figure>

{% hint style="warning" %}
Auto refresh can slow down a bit the editor on massive selection.
{% endhint %}

| ![](http://cgtoolbox.com/wp-content/uploads/2024/07/image-34.png) | <p><br>You can also select the actors which have this tag assigned, on the whole level.<br></p>                                                              |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ![](http://cgtoolbox.com/wp-content/uploads/2024/07/image-35.png) | <p><br>The right icon allow you to copy the tag’s value in the clipboard (Python plugin is necessary to see the icon, enabled by default on UE 5.4).<br></p> |

_Tag entry icons_

***

## Callbacks

\
On tag assignation or removal, a callback can be executed. To do that, you have to create an editor utility blueprint which derives from the class: _BP\_TagCallback\_Base_.

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-16.png" alt="" height="393" width="798"><figcaption></figcaption></figure>

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-17.png" alt="" height="520" width="774"><figcaption></figcaption></figure>

Or using this icon direclty from the tag options:

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-36.png" alt="" height="322" width="785"><figcaption></figcaption></figure>

\
In this blueprint, you have to override the method you need, either “OnTagAssigned” or “OnTagRemoved” ( or both ):

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-18.png" alt="" height="444" width="779"><figcaption></figcaption></figure>

\
The function has three inputs:

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-19.png" alt="" height="198" width="211"><figcaption></figcaption></figure>

**Tag:** The struct of the tag with all its infos ( name, prefix, callback etc. )\
\
**TagLibrary:** The library the assigned or removed tag was stored in.\
\
**Actors:** An array of UActor, the actors affected by the tag assignation or removal.

You can create any post process you need, for instance here, lets assign “Is Editor Only Actor” checkbox on the tag assignation:\


<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-20-1024x389.png" alt="" height="389" width="1024"><figcaption></figcaption></figure>

\
Now in the library, let’s assign that BP callback to the tag “PCG\_Biome”:\


<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-21-804x1024.png" alt="" height="1024" width="804"><figcaption></figcaption></figure>

\
If you now save and refresh the tags widget, when you assign the tag “PCG\_Biome” to an actor, you should see this in the output log:\


<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-22.png" alt="" height="126" width="1015"><figcaption></figcaption></figure>

\
And indeed the flag will be set accordingly:\


<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-23.png" alt="" height="567" width="682"><figcaption></figcaption></figure>

A callback can be set at library level as well, this one will be executed **before** any tag callback.

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/07/image-37.png" alt="" height="970" width="857"><figcaption></figcaption></figure>

***
