dylancyclone / vmf2obj Goto Github PK
View Code? Open in Web Editor NEWConvert source-engine VMF files into OBJ files with materials (including brushes, displacements, entities, and models)
License: MIT License
Convert source-engine VMF files into OBJ files with materials (including brushes, displacements, entities, and models)
License: MIT License
Log:
Starting VMF2OBJ conversion v2.0.0
[1/5] Reading VPK file(s) and custom content...
[2/5] Reading geometry...
SEVERE: Fatal error: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 1554 path $.solids[0].sides[0].null
When i open the file, it simply opens the command prompt for a splitsecond before closing itself. Ive tried running it through java.exe, javaw.exe to no avail. Is there a fix for this?
Trying to convert some old Gmod maps to OBJ - Stripped out all ents, just brushes left. No fatal errors returned - The OBJ I'm getting is only empty verts?
Is this a common problem? Apologies if I'm missing something obvious
edit; fixed by stripping the original VMF of all its textures - not an ideal solution but I didn't need them in this instance
Is there a way to have your tool get the values from the configuration files of hammer? I really want to convert a "model" I made with hammer but cannot seem to get this to work. I don't know which pak files I used and while I made sure to update the paths for the hl2 pak files, that did not work. There's a LOT of .pak files in the Counter-Strike directory.
Any and all help would be greatly appreciated. Fyx#5710 on discord
Right now the application goes through the process of decompiling, converting, and processing every prop regardless of if it has already been converted. If the application were to temporarily store the prop data and reuse it every time the prop was reused in the map, the application could be sped up probably by a good amount
Currently there doesn't seem to be any support for using VPKs that belong to third party source games, like Dark Messiah and Vampire: The Masquerade. Using those VPK's gives an
SEVERE: Error while loading vpk file: Invalid signature
error.
Any chance that support for these would be added in down the line?
Hi, I've been trying to convert de_dust2 from CS:GO and have run into a few issues. (Converted using -t)
Dark areas show backfaces in the mesh
Thanks for this great tool!
[1/5] Reading VPK file(s) and custom content...
SEVERE: Fatal error: java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 10
Running the command java -jar VMF2OBJ.jar gladoschamber.vmf output "D:\Steam\steamapps\common\Portal 2\portal2\pak01_dir.vpk" -t
outputs the following:
Exception: java.lang.NullPointerException
[1/5] Reading VPK file(s)...
Exception in thread "main" java.lang.NullPointerException
at java.io.File.<init>(Unknown Source)
at com.lathrum.VMF2OBJ.App.main(App.java:389)
"SEVERE: Fatal error: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 42084 path $.solids[0].sides[0].null"
I honestly do not know why this issue is happening as I have put all correct VPK's and every time I convert a portal 2 map, this error shows up
To help, the map, I am trying to convert is "sp_a1_wakeup.vmf"
below this is what the Log says.
If a brush used multiple materials, it is possible for the .obj file to switch back and forth between the materials multiple times. For optimization, it would be nice to sort the faces so that only one usemtl
needs to be used per material per object.
For example:
usemtl tools/toolsnodraw
f 1/1 2/2 3/3 4/4
usemtl tools/toolstrigger
f 5/5 6/6 7/7 8/8
usemtl tools/toolsnodraw
f 9/9 10/10 11/11 12/12
could be optimized to:
usemtl tools/toolsnodraw
f 1/1 2/2 3/3 4/4
f 9/9 10/10 11/11 12/12
usemtl tools/toolstrigger
f 5/5 6/6 7/7 8/8
The map is Chapter 6 Beyond the Seal, .bsp file is sp_a3_03
The errors that appear in the progress
[info] Unequal amount of areaporal entities and areaportal brushes. Falling back to 'Manual' method
[info] No occluders to reallocate...
[warning] EntitySource: funct_areaportal entity links to a non existing areaportal, skipping...
And error that appear in Errors & Warnings
[warning] EntitySource: funct_areaportal entity links to a non existing areaportal, skipping...
Similar to #1 and #2, but with a margin of error. The program already merges vertices if they are exact duplicates of each other, but for more complicated geometry there could be rounding errors that make the vertices technically slightly different, but effectively the same. It would be a good optimization and improvement if the extra vertices were merged together. The struggle with this is making sure any faces that use the collapsed vertex texture are redirected to the one that was kept.
When im trying to convert a custom map that i made into obj i get this error
SEVERE: Fatal error: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 1626 path $.solids[0].sides[0].null
Im using hl2_textures_dir, hl2_pak_dir and hl2_misc_dir vpks.
Any help pls?
hi
when im trying to convert my vmf to obj this error showing to me
Starting VMF2OBJ conversion v2.0.0
[1/5] Reading VPK file(s) and custom content...
[2/5] Reading geometry...
SEVERE: Fatal error: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 4260 path $.solids[0].sides[0].null
sorry for my bad english
When I try to convert a gmod map, for whatever reason on the 4th step it freezes on 6% because it can't find arcade.smd
Processing entities... 6% [> ] 263/4247 (0:00:02 / 0:00:30) 131.5/sSEVERE: Fatal error: java.nio.file.NoSuchFileException: C:\Users\Owner\AppData\Local\Temp\vmf2objtemp\models\arcade.smd
upon looking in the temp folder, arcade.smd is inside models/gta iv/ however, when i copy and paste it out of the folder, I get a different error:
Processing entities... 6% [> ] 263/4247 (0:00:02 / 0:00:30) 131.5/sWARNING: Failed to find modelName
SEVERE: Fatal error: java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 0
If there are duplicate vertex textures, they can be combined/collapsed into one so that the data is not repeated. The struggle with this is making sure any faces that use the collapsed vertex texture are redirected to the one that was kept.
I am trying to convert a Garry's Mod map but I keep getting this fatal error.
The map is RP City Life by Meech.
Here's the log:
SEVERE: Failed to extract tools, do you have permissions?
SEVERE: java.io.FileNotFoundException: D:\Documents\Git\VMF2OBJ\target\VMF2OBJ-2.0.0-jar-with-dependencies.jar (The system cannot find the path specified)
Starting VMF2OBJ conversion v2.0.1
[1/5] Reading VPK file(s) and custom content...
[2/5] Reading geometry...
[3/5] Writing brushes...
Writing Brushes... 0% [> ] 1/8475 (0:00:00 / 0:00:25) ?/sSEVERE: Failed to extract material: de_train/train_cementwear_01
SEVERE: java.lang.NullPointerException
SEVERE: Fatal error: java.lang.ArrayIndexOutOfBoundsException: -1
Writing Brushes... 0% [> ] 2/8475 (0:00:01 / 1:11:23) 2.0/s
The map porting works pretty good so far, but one thing I would really like to see are overlays/decals.
A solution to get them into a simple OBJ would be to create a plane with the texture on it, similar to how it's done with this blender addon https://github.com/lasa01/io_import_vmf/blob/master/io_import_vmf/import_vmf.py
Sometimes, the orientation of displacements is incorrect. I'm having trouble tracking down the source of the issue, but it seems to occur more often in decompiled maps compared to "raw" vmf maps built in hammer. See an example here: https://youtu.be/3CgoCSRIGqI?t=90
According to the VDC, there is an attribute of displacements called startposition
that is supposed to indicate the bottom left corner of the displacement, but unless I'm missing something, this value doesn't seem to be spitting out useful information. (and bottom-left corner relative to what? )
https://developer.valvesoftware.com/wiki/Valve_Map_Format#Dispinfo
The annoying part is that the overall dimensions of the converted displacement are correct, it's just the order in which the vertices are loaded that is incorrect. This isn't a problem for square displacements since the converted result can easily be mirrored into position, but rectangular displacements are a little more difficult to fix quickly.
Command - java -jar .\VMF2OBJ.jar .\de_dust2.vmf .\output "F:\SteamLibrary\steamapps\common\Counter-Strike Source\cstrike\cstrike_pak_dir.vpk;F:\SteamLibrary\steamapps\common\Counter-Strike Source\hl2\hl2_misc_dir.vpk;F:\SteamLibrary\steamapps\common\Counter-Strike Source\hl2\hl2_sound_misc_dir.vpk;F:\SteamLibrary\steamapps\common\Counter-Strike Source\hl2\hl2_sound_vo_english_dir.vpk;F:\SteamLibrary\steamapps\common\Counter-Strike Source\hl2\hl2_textures_dir.vpk"
Exception in thread "main" java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeHi(Unknown Source)
at java.util.TimSort.mergeAt(Unknown Source)
at java.util.TimSort.mergeForceCollapse(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.ArrayList.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at com.lathrum.VMF2OBJ.dataStructure.map.Side.completeSide(Side.java:71)
at com.lathrum.VMF2OBJ.dataStructure.map.VMF.parseSolids(VMF.java:311)
at com.lathrum.VMF2OBJ.App.main(App.java:502)
Since a lot of people use gameinfo.txt so that hammer can find their external resources, it would be helpful for the program to do the same
Hello,
I try to convert the 'testchmb_a_00_d.vmf' file from Portal 1.
I'm on v2.0 on macOS.
Here's a capture of the home tool
I placed 'models' folder at the same folder of the jar.
It the same for material.
I attached the full log : log.txt
I spend one hour one that. Any solution ? Caused by macOS ?
Note : I used the Windows version of Portal from Steam (download from CrossOver and saved to my desktop). I extracted the .vmf from the /portal/maps/testchmb_a_00_d.bsp with 'bspsrc'
To the users or developers out there, how were you able to make the Jar file?
I followed the tutorial below but I'm missing something:
- Start Command Prompt.
- Navigate to the folder that holds your class files:
C:\>cd \mywork
- Set path to include JDK’s bin. For example:
C:\mywork> path c:\Program Files\Java\jdk1.7.0_25\bin;%path%
- Compile your class(es):
C:\mywork> javac *.java
- Create a manifest file
manifest.txt with, for example, this content:
Manifest-Version: 1.0
Created-By: 1.8.0_171 (Oracle Corporation) #your jdk version
Main-Class: mainPackage.MainClass
- Create the jar file:
C:\mywork> jar cvfm Craps.jar manifest.txt *.class
However I can't get past the create-classes step:
When I type:
javac .\src\main\java\com\lathrum\VMF2OBJ\*.java
I get 100 errors:
Thank you for your time.
Heya, i might be just stupid, but how do i actually run this java extension?
Double clicking on it does nothing, do i need some kind of program to run it other than java?
lots of love
I tried to convert a map that I made for gmod using the default materials but the program was unable to find a ton of the materials
Upon looking further I found the materials but they aren't packaged into a vpk and adding it as a folder doesn't work either, it still can't find it
I know that nobody is updating this program or helping people with issues anymore, but any help would be appreciated
Thanks!
Here's the log in case it helps:
Starting VMF2OBJ conversion v2.0.0
[1/5] Reading VPK file(s) and custom content...
[2/5] Reading geometry...
[3/5] Writing brushes...
Missing Material: concrete/concretefloor008a
Missing Material: plaster/plasterwall044b
Missing Material: props/carpetfloor004a
Missing Material: plaster/plasterwall044b
Missing Material: props/carpetfloor004a
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: props/carpetfloor004a
Missing Material: glass/glasswindow001b
Missing Material: glass/glasswindow001b
Missing Material: glass/glasswindow001b
Missing Material: tile/tilefloor003a
Missing Material: concrete/concretefloor016a
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: glass/glasswindow001b
Missing Material: brick/brickwall052b
Missing Material: brick/brickwall052b
Missing Material: brick/brickwall052b
Missing Material: brick/brickwall052b
Missing Material: glass/glasswindow001b
Missing Material: brick/brickwall052b
Missing Material: glass/glasswindow001b
Missing Material: brick/brickwall052b
Missing Material: glass/glasswindow001b
Missing Material: brick/brickwall052b
Missing Material: glass/glasswindow001b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: glass/glasswindow001b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: props/carpetfloor004a
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: brick/brickwall052b
Missing Material: brick/brickwall052b
Missing Material: brick/brickwall052b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: glass/glasswindow001b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: props/carpetfloor004a
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: concrete/concretefloor016a
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Missing Material: brick/brickwall052b
Missing Material: plaster/plasterwall044b
Writing Brushes... 100% [===================] 216/216 (0:00:03 / 0:00:00) 72.0/s
[4/5] Processing entities...
Processing entities... 100% [======================] 2/2 (0:00:00 / 0:00:00) ?/s
[5/5] Cleaning up...
Conversion complete! Output can be found at: C:\Users\Cassie Cat\Downloads
Now that the thing is confirmed to work, we ought to clean it up a bit. Ex: We have a gson that we imported but the only time it's ever used is in code that's commented out.
I also suggest we change all the public static final variables at the top to private variables and create some getters/setters for them since having them open like that causes security issues
Hi I'm trying to convert a tf2 map that I made into obj but I keep getting this error.
Starting VMF2OBJ conversion v2.0.0-rc.3 [1/5] Reading VPK file(s) and custom content... [2/5] Reading geometry... SEVERE: Fatal error: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 24570 path $.solids[0].sides[0].null
VMF2OBJ version is 2.0.0-rc.3
Here is the vmf
mvm_swirl_event_rc1.zip
There are some custom models used in this map however I dont think this is the problem.
I can't find any documentation on this so I opened an issue. Basically I added a custom texture to Hammer by putting vmf and vtf files in materials/custom of tf2. It works just fine in Hammer. But once I try to run this program, it says Missing Material. I tried adding those textures by the folder, by making a vpk, and by a folder of the raw png files. How do I add these custom textures?
Not sure what happened here. I've decompiled all the maps from portal 2 using bspsrc and have had moderate success however things keep cropping up and one in particular is really annoying due to it failing to give me any output at all.
These errors include:
SEVERE: Fatal error: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 2564665 path $.entities[414].ACH.A3_DOORS"[6]
When i'm converting sp_a3_transition01.bsp
as well as several errors in other maps like
Failed to parse Material: nature/water_bottomless_pit_01
Missing Material: concrete/concrete_bts_ceiling001a_noportal
Failed to parse Material: plastic/plasticwall001b
Prop has no model? prop_testchamber_door
Failed to parse Material: circle_shield_main
It's more likely to be my fault than the tools however i'm not really sure how to solve any of these. If anyone else has encountered these and fixed them please let me know how.
I have Java installed, but running the GUI version of the .jar file just does nothing. Is there anything I can do to fix?
Similar to #1, If there are duplicate vertex normals, they can be combined/collapsed into one so that the data is not repeated. The struggle with this is making sure any faces that use the collapsed vertex normal are redirected to the one that was kept.
I got the following error while trying to convert a de_Dust2 CSGO map.
Processing entities... 16% [=> ] 603/3751 (0:00:01 / 0:00:05) 603.0/sSEVERE: Fatal error: java.nio.file.NoSuchFileException: C:\Users\Devo\AppData\Local\Temp\vmf2objtemp\models\props\autocombine\de_dust2\dust_window_frame_.smd
The tool did create a folder called autocombine, while the VMF uses the path autocombine2.
dust_window_frame_.smd is also a weird name, there shouldn't be any file called like that since there is a missing word after the frame_.
Python: Traceback (most recent call last):
File "C:\Users\freeb\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\io_import_vmf_init_.py", line 748, in execute
importer.load(self.filepath, context, self.map_data_path)
File "C:\Users\freeb\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\io_import_vmf\import_vmf.py", line 140, in load
vmf = vmfpy.VMF(open(file_path, encoding="utf-8"), self.vmf_fs)
File "C:\Users\freeb\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\io_import_vmf\deps\vmfpy_init.py", line 721, in init
self.editorversion: Optional[int] = self.parse_int_str("editorversion", versioninfo)
File "C:\Users\freeb\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\io_import_vmf\deps\vmfpy_init.py", line 77, in _parse_int_str
value = self.parse_str(name, vdict)
File "C:\Users\freeb\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\io_import_vmf\deps\vmfpy_init.py", line 66, in _parse_str
raise VMFParseException(f"{full_name} doesn't exist", self._context)
vmfpy.VMFParseException: VMF parsing failed: editorversion doesn't exist
location: :-1
I am trying to convert a map to obj, but it seems to throw an exception. I have tried to not include entities but it seems will remove all map entities
Map I am trying to convert: https://steamcommunity.com/sharedfiles/filedetails/?id=1908300524 (A danger zone map combines multiple CSGO maps)
Command line: java -Xmx 16GB -jar vmf2obj.jar .\dz_csgoworld_v2_2d.vmf .\export "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\pak01_dir.vpk" -e "[INSERT PATH HERE]\dz_csgoworld_v2_d"
Attempting to run this on Linux produces some errors and a never-ending progress bar.
If I include external paths it fails to convert VTF files and dies:
Starting VMF2OBJ conversion v1.1.3
[1/5] Reading VPK file(s)...
[2/5] Reading geometry...
[3/5] Writing brushes...
Writing Brushes... 0% [> ] 1/1151 (0:00:00 / 0:00:00) ?/sFailed to extract material: sunabouzu/th_wall02
java.io.IOException: Cannot run program "/tmp/vmf2objtemp/VTFCmd.exe": error=13, Permission denied
Failed to extract bump material: sunabouzu/th_walln
java.io.IOException: Cannot run program "/tmp/vmf2objtemp/VTFCmd.exe": error=13, Permission denied
Missing Material: metal/metalwall061f
Missing Material: tools/toolsnodraw
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.base/java.util.Objects.checkIndex(Objects.java:359)
at java.base/java.util.ArrayList.get(ArrayList.java:427)
at com.lathrum.VMF2OBJ.App.main(App.java:750)
Writing Brushes... 0% [> ] 2/1151 (0:00:56 / 8:56:34) 0/s^C
If I don't include external paths and just include the Garry's Mod VPK file, it gets through the brushes stage and dies on the entities stage
[...]
Missing Material: tools/toolsnodraw
Missing Material: tools/toolsnodraw
Missing Material: sunabouzu/bathroom_sign01
Missing Material: sunabouzu/sound_dampen
Missing Material: tools/toolsnodraw
Writing Brushes... 100% [======================] 1151/1151 (0:00:10 / 0:00:00) 115.1/s
[4/5] Processing entities...
Processing entities... 0% [> ] 1/1075 (0:00:00 / 0:00:00) ?/sException in thread "main" java.io.IOException: Cannot run program "/tmp/vmf2objtemp/CrowbarCommandLineDecomp.exe": error=13, Permission denied
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at java.base/java.lang.Runtime.exec(Runtime.java:594)
at java.base/java.lang.Runtime.exec(Runtime.java:453)
at com.lathrum.VMF2OBJ.App.main(App.java:978)
Caused by: java.io.IOException: error=13, Permission denied
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
... 4 more
Processing entities... 0% [> ] 1/1075 (0:00:31 / 9:15:13) 0/s^C
Starting VMF2OBJ conversion v1.1.3
[1/5] Reading VPK file(s)...
[2/5] Reading geometry...
Exception in thread "main" com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 2641 path $.solids[0].sides[0].null
at com.google.gson.Gson.fromJson(Gson.java:942)
at com.google.gson.Gson.fromJson(Gson.java:892)
at com.google.gson.Gson.fromJson(Gson.java:841)
at com.google.gson.Gson.fromJson(Gson.java:813)
at com.lathrum.VMF2OBJ.dataStructure.map.VMF.parseVMF(VMF.java:243)
at com.lathrum.VMF2OBJ.App.main(App.java:510)
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 2641 path $.solids[0].sides[0].null
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1568)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:491)
at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:414)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
at com.google.gson.Gson.fromJson(Gson.java:927)
... 5 more
I am confused on how you import custom materials and models without VPK. As it seems its possible based on your writing in the description. Yet i cannot figure it out. Am I missing something key?
If I try to add an external content path (tried both a folder containing materials/models/etc. and the materials folder itself) the program simply displays the help menu without any errors.
I exported a custom map of mine, It manages to come out on its side (On its Y-Axis). The Models and Materials came out okay though. I exported an HL2 Background Map to see the same thing was happening. I wouldn't really consider this an issue because I can flip it manually, But a different issue arises. "Displacement Rotation/Orientation Not Right". The displacements become jumbled when it comes to how it rotated on its Z-Axis. They were exported almost perfectly, With the main problem being the rotation. The whole structure of the map was built around the displacements and the way it curved to make a walkable path when everything was aligned correctly. May also be the displacements not actually exporting right in general.
Displacements and some misc map info need some work when it comes to how they export. I know you've still been trying to tackle these weird issues so I hope you can maybe use this info.
This isn't the worst issue, All things considered, I'm hella impressed it worked good as it did. I'll be honest and say I'm pretty dumb, If I'm just spitting out blank info- Please point me in the right direction. All of these can be tweaked manually at least. In the meantime, I'll optimize the displacements in Hammer and or Blender to hopefully get the map I want ready for some animation work. I'm really weirded out by this, But I can hope you can maybe optimize the program.
I'm also willing to give more info, And or debug some things if ya want
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.