ItemAdditions: Dynamic Appearances
An item addition with dynamic appearances, and what you can do for this
Summary
Published: 29 Oct. 2023 by mana vortex Last documented update: Jul 05 2024 by mana vortex
This guide will cover a sub-case of Adding new itemsvia ArchiveXL (added in 1.13). Dynamic variants are both easier and more flexible. Unless you don't need different appearances, you will want to default to this approach.
Wait, this is not what I want!
If you want to understand how things work, check out the links during the rest of the guide.
You can find the technical documentation for dynamic variants on ArchiveXL's github.
If you want to create an Atelier store, see Your own Atelier Store
To quickly generate instances with up to two keys, check out W's generator (Codepen.IO)
Prerequisites
You need at least the following tools and versions (get the most recent):
WolvenKit >= 8.11.0 (you should have it installed and configured)
TweakXL >= 1.4.4
ArchiveXL >= 1.5.0
Red4ext >= 1.17.0
Cyber Engine Tweaks (for spawning items)
You define an appearance as dynamic by adding the DynamicAppearance tag to the visual tags in its root entity.
If you don't know what that means yet, read on — it will hopefully become clear soon.
How is this better than the old approach?
Skipping and skimming
This guide contains the minimal amount of fluff and will link background information rather than giving it. Any links will tell you what you're supposed to read.
For that reason, you shouldn't skip or skim unless the section tells you that it's optional.

That being said, make sure to check the Troubleshooting section if you run into issues, and to run File Validation ->On the entire projectto check for common mistake.
Step 0: Run the generator
If you haven't, go and create a Wolvenkit Project. I'll name mine
my_archive_xl_item,In the
File->Add files... menu, selectArchiveXL item

Fill out the wizard with your item's information. The created item will be set up for both body genders. For the example project, I'll create a t-shirt:

0.1: Import the icons
Import the auto-generated .png icon files (Import Tool -> Import All). They are just dummy icons, but they will help telling apart your shirts while you work on them.
Check Your own inventory preview icons for a guide on how to create the final thing. Most people do this at the end of their project, so you don't have to do it now.
Generated files
Depending on the options you picked, your project will now look similar to this:

What kind of guide is this? I don't want a basegame item copy!
Yes, but generating the exact item that you want is so complex that we couldn't possibly implement it. Proceed to the next section.
Step 1: Customizing the generated item
Since the generated files are almost certainly not what you need, this section will show you how to adjust the item.
The generated structure includes 4 meshes per body gender:

Safely changing mesh paths
During this section, you will edit the mesh_entity. This file contains multiple components, some of which are pulling in .mesh files by path.
In there, you need to adjust file paths, which have been generated as dynamic – meaning that they will look like this:
Since the default path starts with a * and has the Soft flag, ArchiveXL will resolve these placeholders at runtime to t1_079_pwa_tshirt__casual.mesh or t1_079_pma_tshirt__casual.mesh.
Instead of preserving the substitution, you can simply paste a non-dynamic path to one of your files (select it in the project browser, Copy relative path, paste it to the DepotPath box). After that, you can right-click the box, and select Convert to dynamic.
If you want to have only one body gender, check 1.2 below.
1.1 Changing the mesh count
Usually, you have either more or fewer meshes than you actually want to use.
Adjust the .mesh count
If you have more than you need: delete the files you don't want to use
If you need more: copy an existing file, then re-name it. Make sure to do this for both body genders.
Adjust the components
The item's individual parts are pulled in via mesh_entity (you can learn more about this on Dynamic appearances: Understanding the process).
In the editor panel on the left, find the components.
If you have deleted meshes, delete the corresponding components. If you have added extra entries, duplicate an existing component and change its name and DepotPath.
1.2 Renaming files and components
You do this inside the mesh_entity file.
Generated file names are based on the original item. You can rename these files, but you have to adjust the DepotPath entries in the mesh_entity afterwards (see Safely changing mesh paths for how to do that).
You can also change the component names in the mesh_entity to whatever you want – just keep in mind that the component prefixes are important for garment support and you should not remove them.
1.2 Removing a body gender
The easiest way to support only one body gender is to display an invisible item for the other. Do the following things:
Delete the meshes you don't want from the project browser
For each component in the
mesh_entity, adjust theDepotPathto be no longer dynamic (you can use the right-click menu)
As of now, the game will crash if the item is equipped by the unsupported body gender. Add a conditional appearance to prevent this:
Open the
.appfileFor each entry in the
appearancesarray, change thenamefield and add&gender=wor&gender=m
1.3 Body mod support
Thanks to ArchiveXL, body mod support has become trivial. Unfortunately, refitting has not become trivial and you will still have to do this in Blender (although the WKit Blender Plugin: AKL Autofitter can help).
To enable this feature, you only need to
change the
depotPathin your components to include the{body}placeholderre-name your mesh files to include the body's tag in their path (find a full list under Supporting mods)
Adjust the component mesh paths:
Change mesh file paths:
Re-name all your existing meshes by adding base_body to their paths. This must correspond to the {body} placeholder in the component path.
Example:
This mesh will be used if ArchiveXL can't detect any body-specific ones - so you only need to create extra meshes where refits are needed (usually boobs).
Refitting
For each refit you want to create,
copy the
_base_body.meshreplace the
_base_bodyin its path with the camelcase tag for the modded body (see Supporting mods)
Example:
Step 2: Connecting the decal (and understanding variants)
This section explains how to connect the t-shirt's logo. It will show you two ways to do this. If you don't have a logo, you are done with this part of the guide and can go to Step 3.
This section will teach you how to make use of the variant to switch out item parts via .yaml. As a reminder, this is our yaml:

DynamicAppearances makes everything after the ! available in the mesh entity under the key variant. By adding +, you can split the variant into parts. Expand the box below to see more examples, because this is where the magic lives.
By default, our _mesh.ent looks like this (because the generator re-uses CDPR's file structure)

As explained in earlier sections of the guide, these paths are already dynamic.
Now, let's get that decal connected.
Select the first deactivated component, and turn it on by expanding the
chunkMaskdropdown and checking a few of the boxes (e.g. the first 3).Select the second and third deactivated component, and delete them.
Based on the value of
secondaryfrom your yaml file (see the expandable above), we have the following values for variant.2:galaxysamuraiwitcher
In the mesh depot path, replace
samurai.meshwith{variant.2}.meshChange the
meshAppearancetosamurai(since the generator set that up for us)
Thanks to ArchiveXL's substitution, we only need one component to pick our choice from three .mesh files — based on the value for secondary in the yaml.
Exercise 1: Other options
Dynamic mesh picking based on yaml params saves a lot of duplication. However, the game will crash if you tell it to load a mesh that does not exist.
This is a problem, because if you enter semurai instead of samurai, the game will try to find (for female V)
manavortex\equipment\torso_inner\my_custom_shirt\meshes\t1_079_pwa_tshirt__casual_dec_semurai.mesh
and then crash because it can't.
This is generally bad, so which options do we have to prevent it?
An example of a real mod
I use both of these techniques in my University Outfit mod. Every mesh file contains several states of the same item, and I use partsOverrides to switch between them based on the yaml configuration.
For details, expand the box.
Step 3: What now?
You now have a working item that you can play around with. First thing is to create a full back-up of your project, because you will break things as you fuck around and find out.
More color variants: Check Adding an appearance
Body mod support: Go back to section 1.3 Body mod support
The diagram
Now let's look at what we just did and check the diagram. You'll see that the control files are almost identical to the vanilla variants, but that the rest of the files has gotten a lot more manageable:

And that's it! With this and the original guide, you should hopefully be able to add items to your heart's content!
Tools and utilities
Generating display names
I have written a Python script to auto-generate display names, you can find it on my github. If you don't know how to use this, check Running Python Scripts.
Creating preview icons
This problem is so common that it has its own wiki page: Your own inventory preview icons
Troubleshooting
Please see the original guide's Troubleshootingsection.
Last updated




