Closed nonunknown closed 3 years ago
Those are weird errors. Did you import into an empty blend file? Try changing this 'APPEND'
to 'NEW_ARMATURE'
: https://github.com/lasa01/io_import_vmf/blob/d53a6d1db2b5dfeb39903cdaa210d8970b5ff68f/io_import_vmf/import_qc.py#L64
Imported another map with the modified import_qc.py
Could also be that case sensitive file names are causing problems, though I'm not sure I can fix it if the problem is in BST. I can do some tests with my Linux laptop and try to reproduce the errors.
for map decompilation I use BspSource, but it doesnt throw any error!
I got a Nothing was imported by Blender Source Tools
error, and it seems like the problem is in your CrowbarX.
See here how it decompiles this model (from GarrysMod):
The switch.smd
file name has a full Windows path for some reason. If I had to guess, Crowbar probably has code that checks for absolute paths and converts them into relative paths, but on Linux it doesn't recognize Windows-style absolute paths.
ohhh this awesome, this means we can solve it!!!! I'll make the changes here!
@lasa01 Done! https://github.com/nonunknown/crowbarx/releases/tag/0.2
Can you please test and give any feedback?
use the command with -v in the end crowbar.exe "input" "output" -v
so we can see if some problem occurs!
I can try later. Is that release just for debugging? I can't see anything that could fix the issue.
If it is, you can also easily try it yourself by replacing the crowbar.dll in blender's scripts/addons/io_import_vmf/bin
. You can add the -v
argument in import_qc.py
, there is a function for getting the crowbar command to call near the top.
Also, if you specify a cache path in addon preferences, you can go there after an import and find the decompiled models with issues to see if there are other problems.
Well, I fixed it, because the .smd file was in there look ->
1%
1% Decompiling "tm_separatist.mdl" ...
1% Model version 49 detected.
1% Reading MDL file header ...
1% ... Reading MDL file header finished.
1% Checking for required files ...
1% ... All required files found.
1% Reading data ...
1% Reading MDL file ...
1% ... Reading MDL file finished.
1% Reading PHY file ...
1% ... Reading PHY file FAILED. (Probably unexpected format.)
1% Reading VTX file ...
1% ... Reading VTX file finished.
1% Reading VVD file ...
1% ... Reading VVD file finished.
1% ... Reading data finished.
1% Writing decompile-info files ...
1% tm_separatist DEC_LOG
1% tm_separatist VTX_LOG
1% tm_separatist VVD_LOG
1% tm_separatist PHY_LOG
1% ... Writing decompile-info files finished.
1% Writing data ...
1% QC file:
1% tm_separatist.qc
1% Reference mesh files:
1% tm_separatist.smd
1% LOD mesh files:
1% Physics mesh file:
1% tm_separatist_physics.smd
Creating Dir: /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/csgo/csgo_models/player/out/tm_separatist_anims
1% Bone animation files:
1% testIdle.smd
1% testWalkN.smd
1% ragdoll.smd
1% ... Writing data finished.
1% ... Decompiling "tm_separatist.mdl" finished.
... Decompiling with CrowbarX 0.2: "/run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/csgo/csgo_models/player/tm_separatist.mdl" finished.
I can try later. Is that release just for debugging? I can't see anything that could fix the issue.
If it is, you can also easily try it yourself by replacing the crowbar.dll in blender's
scripts/addons/io_import_vmf/bin
. You can add the-v
argument inimport_qc.py
, there is a function for getting the crowbar command to call near the top.Also, if you specify a cache path in addon preferences, you can go there after an import and find the decompiled models with issues to see if there are other problems.
I did this, and for some reason I found a pattern, with the map de_zenith's custom props this error doesnt happen, only with csgo's props like this make usa much from de_nuke
VERBOSE] Importing model models/de_zth/props/de_zth_rock_09_low...
[VERBOSE] Importing model models/de_zth/props/de_zth_rock_14...
[VERBOSE] Importing model models/de_zth/props/de_zth_rock_14_low...
[VERBOSE] Importing model models/props/de_nuke/hr_nuke/metal_crate_001/metal_crate_003_48_low...
[ERROR]: MODEL models/props/de_nuke/hr_nuke/metal_crate_001/metal_crate_003_48_low LOADING FAILED: Error importing models/props/de_nuke/hr_nuke/metal_crate_001/metal_crate_003_48_low: nothing was imported by Blender Source Tools
Traceback (most recent call last):
File "/home/nonunknown/.config/blender/2.93/scripts/addons/io_import_vmf/import_qc.py", line 372, in _load
fake_smd = FakeSmd.from_bst(SmdImporterWrapper.smd)
File "/home/nonunknown/.config/blender/2.93/scripts/addons/io_import_vmf/import_qc.py", line 54, in from_bst
raise Exception("nothing was imported by Blender Source Tools")
Exception: nothing was imported by Blender Source Tools
Still doesn't work. Here are logs:
dotnet crowbar.dll "models/dav0r/buttons/switch.mdl" "models/dav0r/buttons" -v
0% Decompiling with CrowbarX 0.2: "models/dav0r/buttons/switch.mdl" ...
1%
1% Decompiling "switch.mdl" ...
1% Model version 44 detected.
1% Reading MDL file header ...
1% ... Reading MDL file header finished.
1% Checking for required files ...
1% ... All required files found.
1% Reading data ...
1% Reading MDL file ...
1% ... Reading MDL file finished.
1% Reading PHY file ...
1% ... Reading PHY file FAILED. (Probably unexpected format.)
1% Reading VTX file ...
1% ... Reading VTX file finished.
1% Reading VVD file ...
1% ... Reading VVD file finished.
1% ... Reading data finished.
1% Writing decompile-info files ...
1% switch DEC_LOG
1% switch VTX_LOG
1% switch VVD_LOG
1% switch PHY_LOG
1% ... Writing decompile-info files finished.
1% Writing data ...
1% QC file:
1% switch.qc
1% Reference mesh files:
1% C:\Documents and Settings\Dave\Desktop\GMI Stuff\buttons\switch.smd
1% LOD mesh files:
1% Physics mesh file:
1% switch_physics.smd
1% Bone animation files:
1% Idle.smd
1% ... Writing data finished.
1% ... Decompiling "switch.mdl" finished.
... Decompiling with CrowbarX 0.2: "models/dav0r/buttons/switch.mdl" finished.
Also can you send logs with this change in import_qc.py
to print errors from BST:
try:
fake_smd = FakeSmd.from_bst(SmdImporterWrapper.smd)
except Exception as err:
+ print(log_capture.getvalue())
raise Exception(f"Error importing {name}: {err}")
if name.startswith("models/props/autocombine/"):
# cannot cache autocombine props, they have conflicting smd files
I think I know the problem, your plugin is using relative paths?
dotnet crowbar.dll "models/dav0r/buttons/switch.mdl" "models/dav0r/buttons" -v
Please try two tests for me:
Same issue with absolute paths (if you specify an absolute cache folder, the addon will use absolutely paths). Can't test this on Windows right now.
Are your errors because of the same thing? Can you send the contents of a folder with a decompiled model that fails for you so I can check if there's anything wrong?
from some topics above the:
[ERROR]: MODEL models/props/de_nuke/hr_nuke/metal_crate_001/metal_crate_003_48_low LOADING FAILED: Error importing models/props/de_nuke/hr_nuke/metal_crate_001/metal_crate_003_48_low: nothing was imported by Blender Source Tools
Yeah, that's essentially the same issue. Windows path separators \
are treated as a part of file names, while they should be part of the path.
Logs:
dotnet crowbar.dll /home/lasa/io_import_vmf_dev/models_decompile/models/props/de_nuke/hr_nuke/metal_crate_001/metal_crate_003_48_low.mdl /home/lasa/io_import_vmf_dev/models_decompile/models/props/de_nuke/hr_nuke/metal_crate_001/ -v
0% Decompiling with CrowbarX 0.2: "/home/lasa/io_import_vmf_dev/models_decompile/models/props/de_nuke/hr_nuke/metal_crate_001/metal_crate_003_48_low.mdl" ...
1%
1% Decompiling "metal_crate_003_48_low.mdl" ...
1% Model version 49 detected.
1% Reading MDL file header ...
1% ... Reading MDL file header finished.
1% Checking for required files ...
1% ... All required files found.
1% Reading data ...
1% Reading MDL file ...
1% ... Reading MDL file finished.
1% Reading PHY file ...
1% ... Reading PHY file FAILED. (Probably unexpected format.)
1% Reading VTX file ...
1% ... Reading VTX file finished.
1% Reading VVD file ...
1% ... Reading VVD file finished.
1% ... Reading data finished.
1% Writing decompile-info files ...
1% metal_crate_003_48_low DEC_LOG
1% metal_crate_003_48_low VTX_LOG
1% metal_crate_003_48_low VVD_LOG
1% metal_crate_003_48_low PHY_LOG
1% ... Writing decompile-info files finished.
1% Writing data ...
1% QC file:
1% metal_crate_003_48_low.qc
1% Reference mesh files:
1% parts\metal_crate_003_48_low.smd
1% LOD mesh files:
1% Physics mesh file:
1% metal_crate_003_48_low_physics.smd
1% Bone animation files:
1% idle.smd
1% ... Writing data finished.
1% ... Decompiling "metal_crate_003_48_low.mdl" finished.
... Decompiling with CrowbarX 0.2: "/home/lasa/io_import_vmf_dev/models_decompile/models/props/de_nuke/hr_nuke/metal_crate_001/metal_crate_003_48_low.mdl" finished.
Oh thanks dude I could find the problem in the code, now I need to know, in this case:
1% parts\metal_crate_003_48_low.smd
what should be done with the "parts", it has to be a new folder, or just trim it?
Probably a new folder, you can check what normal crowbar does to verify. It needs to match what's written in the qc file though.
Did you try it yourself? That looks like it won't work if the path contains more than one backslash. Best would be probably to replace backslashes with forward slash. Though then there's the issue with the drive letters in path, though that's probably not an issue.
yeah I imagined that situation let me solve it
I think better than this is impossible: https://github.com/nonunknown/crowbarx/releases/tag/0.3
@lasa01
ok I did some tests myself, and the error isnt resolved this makes me really sad, because I really dont know what is happening, because my local test works perfecltly, are you sure you dont need to change anything on your side?
ps: I did a test by removing the bin/ folder from the plugin's zip and it executes the imports even when all models fails to import! Also I cant see any crowbarX's logs being passed to the blender's terminal, this should be possible (makes easier to see what is happening)
I tested that and it seemed to fix the issue.
You probably didn't clear the cache folder, which made it reuse the previvously incorrectly decompiled models again, instead of decompiling them with the new fixed CrowbarX. Can you test again after removing all files inside the cache folder?
seirusly it fixed for you??? awesome to hear that, so I've cleared the cache folder and tried look:
I specifically tested that model in the log and it works. Are you sure you are using the updated CrowbarX?
Also, are there any obvious issues in the cache folder where the decompiled models are?
are testing using your plugin, or testing crowbarx alone? Because alone works for me as well!
I tested using the model importer in the addon to import the .mdl. Can you test that with the metal_railing_001_256?
how I'm supposed to do that
It's in File -> Import -> Source Engine Model (enhanced) (.qc/.mdl), just select the .mdl with it (not .qc).
Result:
[ERROR]: MODEL metal_railing_001_256 LOADING FAILED: Error importing metal_railing_001_256: nothing was imported by Blender Source Tools
Python: Traceback (most recent call last):
File "/home/nonunknown/.config/blender/2.93/scripts/addons/io_import_vmf/__init__.py", line 1123, in execute
qc_importer.get(name, context.collection, context)
File "/home/nonunknown/.config/blender/2.93/scripts/addons/io_import_vmf/import_qc.py", line 405, in get
return self.get_smd(name, collection, context).a
File "/home/nonunknown/.config/blender/2.93/scripts/addons/io_import_vmf/import_qc.py", line 391, in get_smd
raise Exception(f"model {name} hasn't been imported")
Exception: model metal_railing_001_256 hasn't been imported
Can you send a screenshot of the decompiled model in the cache folder?
QC FILE:
// Created by CrowbarX 0.1
$modelname "props\de_nuke\hr_nuke\metal_railing_001\metal_railing_001_256.mdl"
$staticprop
$bodygroup "Body"
{
studio "parts\metal_railing_001_256.smd"
}
$surfaceprop "metal"
$contents "solid"
$illumposition 0 -127.75 21
$cdmaterials "models\props\de_nuke\hr_nuke\metal_railing_001\"
$texturegroup "skinfamilies"
{
{ "metal_railing_001" }
{ "metal_railing_001b" }
}
$cbox 0 0 0 0 0 0
$bbox -1.5 -1.25 -0.25 257.25 1.25 42.25
$definebone "static_prop" "" 0 0 0 0 0 0 0 0 0 0 0 0
$sequence "idle" {
"metal_railing_001_256_anims/idle.smd"
activity "act_idle" 1
fadein 0.2
fadeout 0.2
fps 30
}
$keyvalues
{
qc_path
{
"value" "models\props\de_nuke\hr_nuke\metal_railing_001\metal_railing_001_256.qc"
}
}
The smd file doesn't exist. Definitely an issue with CrowbarX, but weird that it works for me.
I tested using the crowbar X heres the result:
cmd: ./crowbar "/home/nonunknown/Documentos/temp/metal_railing_001_256.mdl" "/home/nonunknown/Documentos/temp/out"
output:
0% Decompiling with CrowbarX 0.3: "/home/nonunknown/Documentos/temp/metal_railing_001_256.mdl" ...
1%
1% Decompiling "metal_railing_001_256.mdl" ...
1% Model version 49 detected.
1% Reading MDL file header ...
1% ... Reading MDL file header finished.
1% Checking for required files ...
1% ... All required files found.
1% Reading data ...
1% Reading MDL file ...
1% ... Reading MDL file finished.
1% Reading PHY file ...
1% ... Reading PHY file FAILED. (Probably unexpected format.)
1% Reading VTX file ...
1% ... Reading VTX file finished.
1% Reading VVD file ...
1% ... Reading VVD file finished.
1% ... Reading data finished.
1% Writing data ...
1% QC file:
1% metal_railing_001_256.qc
1% Reference mesh files:
1% metal_railing_001_256.smd
1% LOD mesh files:
1% Physics mesh file:
1% metal_railing_001_256_physics.smd
1% Bone animation files:
1% idle.smd
1% ... Writing data finished.
1% ... Decompiling "metal_railing_001_256.mdl" finished.
... Decompiling with CrowbarX 0.3: "/home/nonunknown/Documentos/temp/metal_railing_001_256.mdl" finished.
files:
PS: Generating the .smd file only worked when all these files was in the same folder:
having only the .mdl one did not generated the .smd
I added more logging to this build.
Can you try to import the map again with a clean cache folder, enable "Verbose" from the import options and send the logs here.
You definitely used wrong CrowbarX version before. Maybe you ran install.sh after updating CrowbarX, that would overwrite CrowbarX with the older version.
Anyway, I will make a release now that it works.
Screenshots![image](https://user-images.githubusercontent.com/58845030/125297154-60965400-e2fd-11eb-842e-7ca10ed0b93a.png)
This is the resulting de_overpass which is very cool :D
Expected behavior Import all props related to the map
Related files de_overpass.zip
Logs
Details (please complete the following information):