andreaskeller96 / cs2-import-scripts

Modified variant of the CS2 import scripts to run with python3
32 stars 3 forks source link

Ignore import model/texture failures? #5

Open agaertner opened 1 month ago

agaertner commented 1 month ago

A certain model of mine fails because I believe it has ö ä ü in bone names.

Error log:

[...]
Writing 4 Animations:0..1..2..3..Done
Failed to create bone 'k÷rper'Failed to create bone 'fl³gel_rehtz'Failed to create bone 'fl³gel_links'Failed to create bone 'k÷rper01'Failed to create bone 'fl³gel_rehtz01'Failed to create bone 'fl³gel_links01'Failed to create bone 'k÷rper02'Failed to create bone 'fl³gel_rehtz02'Failed to create bone 'fl³gel_links02'Failed to create bone 'k÷rper03'Failed to create bone 'fl³gel_rehtz03'Failed to create bone 'fl³gel_links03'Failed to create bone 'k÷rper04'Failed to create bone 'fl³gel_rehtz04'Failed to create bone 'fl³gel_links04'Failed to create bone 'k÷rper05'Failed to create bone 'fl³gel_rehtz05'Failed to create bone 'fl³gel_links05'

---------------------------------------------------------
Encountered accessviolation.
Wrote minidump to cs_mdl_import_2024_0525_143731_0_accessviolation.mdmp
---------------------------------------------------------

Error running:
>>>cs_mdl_import -nop4  -i "F:\Program Files\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" -o "F:\Program Files\Steam\steamapps\common\Counter-Strike Global Offensive\content\csgo_addons\am_shoji" "models\pg_props\pg_park\pg_schmetterlinge.mdl"
Aborting

I have tried removing the model altogether but this results in the process just aborting (in hopes to just edit the erroring model out with the CS2 Editor.)

--------------------------------
- Running Command: cs_mdl_import -nop4  -i "F:\Program Files\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" -o "F:\Program Files\Steam\steamapps\common\Counter-Strike Global Offensive\content\csgo_addons\am_shoji" "models\pg_props\pg_park\pg_schmetterlinge.mdl"
--------------------------------
Creating device for graphics adapter 0 
No Input files found
Error running:
>>>cs_mdl_import -nop4  -i "F:\Program Files\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" -o "F:\Program Files\Steam\steamapps\common\Counter-Strike Global Offensive\content\csgo_addons\am_shoji" "models\pg_props\pg_park\pg_schmetterlinge.mdl"
Aborting

Is there any flag I can use to just ignore models which fail to import and continue with the rest? I do not have the original source files anymore (just the original *.vmf file). I could potentially edit the model out with the source 1 editor but I would like to avoid having to set it all up properly.

andreaskeller96 commented 1 month ago

Short of using a hex editor to find and replace the ä ö ü within the mdl file, I dont think it is easily done. The script could be extended to skip missing files before handing it to the cs_mdl_import exe but that would require searching for files from within python, which is currently not done.

agaertner commented 1 month ago

My friend who did the model fixed it. But there is another texture dependency that makes it fail. It is not one of my own textures. The error says skin5 texture not found. I looked at which model could cause this issue. I do have one model that had 8 skins but I am just using 0 and 2. I tried excluding that model but it won't work. I also assumed that it could be the jungle skybox but I removed that and it didn't work. I have given up for now. It would be best if it continued with the rest when it fails with a texture or skin reference so we at least get an editable cs2 file.