kristiker / source1import Goto Github PK
View Code? Open in Web Editor NEWImport Source game content into Source 2
License: MIT License
Import Source game content into Source 2
License: MIT License
There are some hlvr-only checks that are valid for adj too. Example: layer1 on blend materials.
Was trying to convert materials, models, particles, sounds and scripts to Source 2 for S&BOX but it gave me the error that it couldn't find any .mdl files even though they are present in the files. Not really sure what's going wrong here but would appreciate it if you could let me know what to do. Thanks very much!
Half-Life: Alyx comes with watersplash_001a.vtex
vistasmoke...
etc. Add option to use these in particles since we can't do animated textures at the moment. Aka: Only create VTEX if it doesn't exist in base mod.
Drag an asset over the window to populate the in-path, filter, and options automatically.
Materials without detail, selfillum, etc should use simple shader.
Should be vr_complex.vfx
. Here is a file that has it wrong in the samples folder.
source1import/source2_adj_game/materials/ads/ad01.vmat
Lines 1 to 5 in b81a98f
When porting a bunch of tf2 models I realized the material is pitch black but when removing the dynamic expression that's auto-generated, it works. I don't know if there is a setting already to turn it off when porting but it would nice to have it instead of deleting it manually.
Use this tool to fix them https://github.com/rob5300/KV3ParticleUpdater
Only a few sky materials can be imported properly and a few textures can be converted:
Successfully converted material:
sky_borealis01
sky_day01_01
sky_day01_01_hdr
sky_day01_04
sky_day01_04_hdr
sky_day01_05
sky_day01_05_hdr
sky_day01_06
sky_day01_06_hdr
sky_day01_07
sky_day01_07_hdr
sky_day01_08
Physicssurfaceproperty2
How does .sound work?
they broke it
When exporting a vtf that has mipmaps to source2, source1import either exports all mipmaps as the same file, replacing the correct file everytime, or just exports the smallest mipmap. Major issue for map porting, plz fix.
This material could be converted to vr_monitor.vfx
with return $MonitorTexture
dynamic-exp.
"vertexlitgeneric"
{
"$basetexture" "_rt_camera1"
"$model" 1
"$selfillum" 1
"$selfillumtint" 2
"$bumpmap" "models/shared/n_flat"
"$nodecal" 1
"$envmap" "env_cubemap"
"$normalmapalphaenvmapmask" 1
"$envmaptint" 0.75
"$phong" "1"
"$phongexponent" 200
"$phongboost" "2.5"
"$phongfresnelranges" "[0.5 1 3]"
"VertexlitGeneric_HDR_DX9"
{
"Proxies"
{
"Sine"
{
"resultVar" "$selfillumtint[2]"
"sineperiod" 1
"sinemin" 0.4
"sinemax" 0.6
}
"Sine"
{
"resultVar" "$selfillumtint[1]"
"sineperiod" .01
"sinemin" 0.5
"sinemax" 0.7
}
"Sine"
{
"resultVar" "$selfillumtint[3]"
"sineperiod" .01
"sinemin" 0.7
"sinemax" 0.8
}
}
}
"VertexlitGeneric_DX9"
{
"Proxies"
{
"Sine"
{
"resultVar" "$selfillumtint[2]"
"sineperiod" 1
"sinemin" 0.7
"sinemax" 0.9
}
"Sine"
{
"resultVar" "$selfillumtint[1]"
"sineperiod" .01
"sinemin" 0.8
"sinemax" 1
}
"Sine"
{
"resultVar" "$selfillumtint[3]"
"sineperiod" .01
"sinemin" 1
"sinemax" 1.2
}
}
}
"vertexlitgeneric_dx8"
{
"$fallbackmaterial" "models/spire/broadcast/punk_monitor1_dx8"
}
}
I think animation parameters in complex and others work on the whole material (so all the maps). S1import currently only supports $frame (albedo).
source1import/utils/dev/.todo.txt
Lines 52 to 63 in 43d1009
In cs2 they are brighter, with the dark AO spots removed and with less colors. Brightness can be increased with vtex, so it is fast, but other manipulations need to go through PIL.
I only want to convert materials and models used by a single vmf. E.g. --filter map:cs_office.vmf
Most particles are animated so the converter barely produces anything useable.
Is it possible to convert animated vtf
to vtex
? Does Valve only use ready-made mks
files?
sky_dustbowl_01's side textures look like this:
but they get scaled to cover the whole square in the vmt
"sky"
{
"$hdrcompressedTexture" "skybox/sky_dustbowl_01_hdrside"
"$nofog" "1"
"$ignorez" "1"
"$basetexture" "skybox/sky_dustbowl_01side"
"$basetexturetransform" "center 0 0 scale 1 2 rotate 0 translate 0 0"
"%keywords" "tf"
}
vmat_prefab
is avaliable in latest dota 2. This new asset type defines base parameters that materials can inherit, similar to source 1 Patch. Difference is vmat_prefab
does not compile to vmat_c
. There is no documentation or any example usages.
source1import/utils/materials_import.py
Line 1350 in cfd49a2
This file in samples is a good example.
Materials included by map-specific patches not as much.
When converting sky textures, I get these messages:
Searching for .vmt files...
missing sky face: materials\skybox\legacy_faces\docks_hdrbk.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrdn.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrft.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrlf.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrrt.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrup.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrbk.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrdn.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrft.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrlf.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrrt.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrup.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrbk.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrdn.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrft.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrlf.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrrt.pfm
missing sky face: materials\skybox\legacy_faces\docks_hdrup.pfm
......
Collected face BK for sky_l4d_c4m4_hdr_cube.tga
Collected face DN for sky_l4d_c4m4_hdr_cube.tga
Collected face FT for sky_l4d_c4m4_hdr_cube.tga
Collected face LF for sky_l4d_c4m4_hdr_cube.tga
Collected face RT for sky_l4d_c4m4_hdr_cube.tga
Collected face UP for sky_l4d_c4m4_hdr_cube.tga
......
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrbk.pfm
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrdn.pfm
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrft.pfm
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrlf.pfm
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrrt.pfm
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrup.pfm
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrbk.pfm
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrdn.pfm
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrft.pfm
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrlf.pfm
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrrt.pfm
missing sky face: materials\skybox\legacy_faces\urbannightburning_ldrup.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrbk.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrdn.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrft.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrlf.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrrt.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrup.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrbk.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrdn.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrft.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrlf.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrrt.pfm
missing sky face: materials\skybox\legacy_faces\urbannightstorm_ldrup.pfm
By the way, these sky textures are from L4D2's HD Sky Textures mod.
A button that runs resourcecompiler on the imported stuff
The orange towers in de_dust2 look different with high gpu settings. S1Import does not prioritize higher order values and uses last key seen on file. Similar thing with _dx9 and hdr_dx9 blocks lacking a priority system.
// Sets the value when Shader Detail is High or higher
"GPU>=2?$color" "[ 1 0 0 ]" // Quoted parameter because of equal sign.
GPU<2 // Sets the values in the block if Shader Detail is below High.
{
$envmap env_cubemap
$color "[ 0 0 1 ]"
}
s1:
s2:
Post them here.
There is a scripts/postprocess.txt
file that could be split into .vpost
.
"post_process"
{
"low_health"
{
"localcontrast" "0.52"
"edgelocalcontrast" "0.0"
"vignettestart" "0.6"
"vignetteend" "1.0"
"vignetteblur" "0.05"
"fadetoblack" "0.0"
"depthblur_focaldist" "0.0"
"depthblur_strength" "0.0"
"screenblur_strength" "0.0"
"filmgrain_strength" "1.0"
}
}
So, the windows binary has been working flawlessly, except for the major exception of trying anything with maps, compiled or otherwise, python dependencies or otherwise. it all ends the same way:
anyone got a fix?
https://developer.valvesoftware.com/wiki/Subrect
Here is the material in samples:
There are tons of constants defined in srctools
source1import/utils/models_import.py
Lines 88 to 95 in 5801dc3
hlvr accepts it as-is (this is also unhandled)
File location: scripts/propdata.vdata
<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{7412167c-06e9-4698-aff2-e63eb59037e7} -->
{
generic_data_type = "prop_data"
Cardboard.Base =
{
_not_pickable = 1
dmg.bullets = 0.500000
dmg.club = 1.250000
dmg.explosive = 1.500000
}
Cardboard.Small =
{
dmg.bullets = 0.500000
dmg.club = 1.250000
dmg.explosive = 1.500000
_base = "Cardboard.Base"
health = 10
}
Cardboard.Medium =
{
dmg.bullets = 0.500000
dmg.club = 1.250000
dmg.explosive = 1.500000
_base = "Cardboard.Base"
health = 20
}
}
At least in S&Box, there is a "Enable Self-Shadow" feature, as far as I can tell, it solves most inconsistencies...
https://developer.valvesoftware.com/wiki/$ssbump
F_ENABLE_NORMAL_SELF_SHADOW 1
g_flLightRangeForSelfShadowNormals "1.000"
This is how I set mine to in order to properly display them, the default that sbox sets g_flLightRangeForSelfShadowNormals to is .707
$envmap my_custom_cubemap
if a vmt contains comments in russian, or possibly any other non latin character, it fails
Modeldoc accepts smd & fbx, and qc is easy to remap.
When enabled, materials don't compile due to bad escaping.
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.