# Female Renaming
## Female Traits
**NOTE: Unique includes counting the shared traits!**
| Category | Unique Traits | Female Only | Blender Count |
| -------------------- |:-------------:|:-----------:| :---: |
| Body | 1 | 1 | 1 |
| Brace | 115 | 79 | 79 |
| Clips and Kanzashi | 21 | 17 | 17 |
| Clothing | 297 | 293 | 294 |
| Earring | 53 | 32 | 32 |
| Eyes | 13 | 11 | 15 |
| Face Other | 34 | 21 | 21 |
| Glasses | 59 | 24 | 25 |
| Hair | 296 | 234 | 226 |
| Hair Accessory Other | 9 | 9 | 8 |
| Halos | 18 | 6 | 7 |
| Hats | 11 | 8 | 8 |
| Head | 87 | 43 | 43 |
| Head Accessory Other | 82 | 72 | 72 |
| Masks | 14 | 7 | 7 |
| Neck | 68 | 53 | 52 |
| Ribbons and Bows | 22 | 22 | 22 |
| Set | 77 | 73 | |
| Sigil | 121 | 84 | 84 |
| Special Other | 83 | 60 | 66 |
| Tail | 19 | 8 | 8 |
| Tattoo | 86 | 64 | 63 |
| Type | 28 | 12 | |
| Weapon | 80 | 45 | 45 |
| Weapon Brace | 22 | 12 | 12 |
| Wings | 45 | 28 | 29 |
---
## Get MESH filenames from blends (file a)
Print filenames for MESH objects in blend files, ignoring some that start with certain strings as separated by comma.
```python!
for i in *.blend; do blender -b --python scripts/print_meshes_blender.py -- -e "Feminine.*,BaseBody*,Body.*" -o out/$(basename "$i" .blend).txt "$i";done
```

If you notice filenames that shouldn't be there, we should add that as an exception. The blend files get ingested into the Unity pipeline which may confuse us later as to their relevance. Ideally we should have the exact number of files per each category in each blend as represented in the table.
## References for Filenames (file b)
These are the correct filenames that we're using in the project. The folders, thumbnails, reference images, glbs for each trait is named after this base mesh. The original and renamed filename are located in the `metadata` directory for reference. We mostly removed special characters.
There are 3 files in `metadata` that contain the correct filenames per each category: male / female / shared (both):
- female_traits.csv
- male_traits.csv
- shared_traits.csv
They contain the trait category and name separated by comma like so:
```
trait,name
BRACE,Arrow_Brace_Fallen_Angel
BRACE,Arrow_Brace_Holy
BRACE,Arrow_Brace_of_Flames
BRACE,Beams_of_Burning_Light_Brace
...
```
This script, `split_csv.sh`, will split this one csv into a txt file per each trait category that we use as **file b** when checking the blend filenames against the proper naming.
```bash!
#!/bin/bash
csv_file="female_traits.csv" # Replace with your CSV file path
# Read the CSV file line by line
awk -F',' 'NR > 1 { print $2 > $1 ".txt" }' "$csv_file"
```

## Compare Filenames in Blend to References
Example usage: `python3 compare_filenames_blender.py blend_filenames/Weapons_MasterFile.txt references/WEAPON.txt > Weapons.txt`
Example output
```
Unmatched files in Weapons blend:
Floating_Shuriken_Giant_Shuriken
Bolt_Action_Rifle_and_Chainsaw_1
Bolt_Action_Rifle_and_Chainsaw_2
Total unmatched files: 3 out of 45
```
Extra: The script to compare blend filenames to name scheme references:
```python!
import sys
def read_file(file_path):
with open(file_path, 'r') as f:
lines = f.readlines()
return {line.strip() for line in lines}
if __name__ == '__main__':
if len(sys.argv) != 3:
print("Usage: python compare_files.py <file_a_path> <file_b_path>")
sys.exit(1)
file_a_path = sys.argv[1]
file_b_path = sys.argv[2]
file_a_lines = read_file(file_a_path)
file_b_lines = read_file(file_b_path)
unmatched_blend = file_a_lines - file_b_lines
unmatched_file_b = [file_name for file_name in file_b_lines if file_name not in file_a_lines]
print("Unmatched files in blend:")
print()
for file_name in unmatched_blend:
print(file_name)
print()
print(f"Total unmatched files: {len(unmatched_blend)} out of {len(file_b_lines)}")
```
## Files
- https://github.com/M3-org/anata/tree/main/metadata/csv/filenames/female_blends These are the ones to fix in blender
- https://github.com/M3-org/anata/blob/main/metadata/csv/female_traits.csv Rename files in blender to these