Skip to content

Instantly share code, notes, and snippets.

View xDShot's full-sized avatar

xDShot

  • Digital Hell
View GitHub Profile
@xDShot
xDShot / hsv2rgb.vmt
Last active October 12, 2020 18:16
Source HSV to RGB material proxy
"VertexLitGeneric"
{
$baseTexture "models/shadow_warrior/sword/reskins/z45_rgb"
$bumpmap "models/shadow_warrior/sword/katana_energetic_n"
$blendtintbybasealpha 1
$color "[1 .3 0]"
// BEGIN OF HSV2RGB
$Hue 1.00
//
snd_buildsoundcachefordirectory ../xdsoundmods/
//quit
#!/bin/sh
for i in *.mp3; do
echo $i
bsname=$(basename "$i" .mp3)
echo $bsname
cp "$i" "_tmp.mp3"
ffmpeg -y -i "_tmp.mp3" "_tmp.wav"
rm "_tmp.mp3"
mv "_tmp.wav" "$bsname.wav"
import bpy
side_identifier = "_X_"
finger_identifier = "_FingerN"
chainlinks = {}
chainlinks["body"] = ( "ValveBiped.Bip01", "ValveBiped.Bip01_Pelvis", "ValveBiped.Bip01_Spine", "ValveBiped.Bip01_Spine1", "ValveBiped.Bip01_Spine2", "ValveBiped.Bip01_Spine4" )
chainlinks["arms"] = ( "ValveBiped.Bip01_X_Clavicle", "ValveBiped.Bip01_X_UpperArm", "ValveBiped.Bip01_X_Forearm", "ValveBiped.Bip01_X_Hand" )
chainlinks["fingers"] = ( "ValveBiped.Bip01_X_FingerN", "ValveBiped.Bip01_X_FingerN1", "ValveBiped.Bip01_X_FingerN2" )
# TODO: legs, pelvis+neck+head
#
_PKGNAME_OVERRIDE="source-frustrating"
_LOCAL_OPTIMIZED="true"
_GCC_FLAGS="-march=native -pipe -O2 -ftree-vectorize"
_LD_FLAGS="-march=native -pipe -O2 -ftree-vectorize"
_protonify="false"
_use_faudio="false"
_FS_bypass_compositor="false"
@xDShot
xDShot / hwm-to-facs.lua
Created April 10, 2020 12:17
Alright, I've found a workaround. You just need to run this script with dmxedit from SourceFilmmaker. Create lua-file in any folder, put the code below (don't forger to change names of the files), put dmx mesh with hwm flexes in the same folder and .pre preset file and any dmx that contains l4d2 facs controllers.
Load( "./christie_head_rel.dmx", "relative" ); -- our dmx model with hwm flexes
print("We have loaded that crap. What we got for now:");
ListDeltas( );
CreateDeltasFromPresets( "./game_presets.pre", true ); -- 'true' purges all HWM flexes.
ImportComboRules( "./mechanic_model_merged.dmx", true, true ); -- any dmx that contains l4d2 facs controllers. First 'true' replaces the current rules with those from the file. Second 'true' purges any delta states which are no longer referred to by any combination rule or control.
ResetState( );
print( "And what we got now:" );
ListDeltas( );
for i in *.smd; do sed -i 's/\" 0.00/\" -1/g' $i; sed -i 's/-../0.00/g' $i; done
#!/bin/bash
ffmpeg -y -i $1_bump.dds $1_bump.png
gmic $1_bump.png f "[A,B,G,R]" o $1_normal.png
#multiply red channel's each pixels by 0.707
gmic $1_normal.png f "[R*0.707,G,B,A]" o $1_normal.png
#Value invert output’s green channel
gmic $1_normal.png f "[R,255-G,B,A]" o $1_normal.png
#Curve level output’s blue channel with input 0 and output 128 (basically, need to make pixels values scaled to 128-255 range)
#!/bin/bash
ffmpeg -y -i $1 -i $2 -filter_complex alphamerge $3
#!/bin/bash
export WINEBIN=/opt/wine-tkg-git-source-frustrating-4.11.r0.g07afb240a8/bin/wine
export WINEDEBUG=-all
export WINEPREFIX=~/wineprefixes/sourcesdk/
export GAMEDIR=/seagate/SteamLibrary/steamapps/common/SourceFilmmaker/game/
export STUDIOMDL=$GAMEDIR/bin/studiomdl.exe
export VPROJECT=$GAMEDIR/usermod/
$WINEBIN $STUDIOMDL $@