Skip to content

Instantly share code, notes, and snippets.

View mdaguerre's full-sized avatar

Martin Daguerre mdaguerre

View GitHub Profile
@mdaguerre
mdaguerre / replace_materials.py
Created September 19, 2019 14:52
Replace materials in UE4 using Python
import unreal
def replace_material(original, replacement):
original_asset = unreal.EditorAssetLibrary.load_asset(original)
replacement_asset = unreal.EditorAssetLibrary.load_asset(replacement)
unreal.EditorAssetLibrary.consolidate_assets(
replacement_asset, [original_asset])
#replace_material(original_name, replacement_name)
replace_material('/Game/MyProject/Materials/Glass.Glass',
curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
echo "source ~/.git-completion.bash" >> ~/.bash_profile
#!/usr/bin/zsh
COMPRESSOR=$(whence -p yui-compressor)
[ -z $COMPRESSOR ] && exit 0;
function _compress {
local fname=$1:t
local dest_path=$1:h
local min_fname="$dest_path/${fname:r}.min.${fname:e}"
$COMPRESSOR $1 > $min_fname