This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pyenv cheat sheet | |
"pyenv" allows you to install and manage different versions of python on the same machine | |
"pyenv virtualenv" allows you to have and manage different package install environments | |
brew install pyenv pyenv-virtualenv | |
https://realpython.com/intro-to-pyenv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############### USER PARAMETERS ###################### | |
$frequency = 1; # 1.0, 4 | |
$irregularity = 0.075; # 0, 1 | |
$cornerSharpness = 30; # 1,50 | |
$groutWidth = 0.05; # 0,.5 | |
$groutSharpness = 0.5; # 0,1 | |
$numberOfRows = 20; # 10,30 | |
$rowSizeVariation = 0; #0 , 1 | |
$minNumberOfBricks = 10; #5,20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$noiseBigU = fbm([$u*8, $v*8,1],6,2,.75); | |
$u = $u + $noiseBigU*.005; | |
$noiseBigV = fbm([111+$u*8, 111+$v*8,0],6,2,.75); | |
$v = $v + $noiseBigV*.0025; | |
# number of horizontal bands | |
$vNum = 20; | |
# variation in width of horizontal bands | |
$vVar = 0.35; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Reference commands to do uv mapping with magick | |
# create a grad by making 'n' vertical bands of colors and blurring | |
echo "P2 4 1 255\n 137 195 125 255" | convert - -depth 16 -scale 151x50\! -blur 0x6 -resize 4096x1436\! +matte displace_map.tif | |
# use the grad to warp image | |
# note use of fx expression to make it resolution independent | |
inputImage=test.jpg | |
outputImage=testWarped.jpg | |
magick ${inputImage} -depth 16 displace_map.tif -virtual-pixel Gray -compose Displace -set option:compose:args '%[fx:w*.0855]x%[fx:0]' -composite -crop '%[fx:h*2]x%[fx:h]+%[fx:w*0.146]+%[fx:0]' ${inputImage} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This takes an image with an arbitrary aspect ratio and figures out the thickness of the border | |
# necessary to fit that image into an arbitrarily sized page while preserving the image's aspect ratio | |
# AKA: I'd like to center a randomly sized image into a standard (or also randomly) sized frame | |
# AKA: I want to put this image into this frame but I want an even border and I don't want to crop my image | |
imageWidth = 1080 | |
imageHeight = 1920 | |
pageWidth = 24 | |
pageHeight = 36 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# osX and linux | |
brew install pyenv | |
# osX install python deps | |
brew install openssl readline sqlite3 xz zlib tcl-tk | |
# debian/ubuntu python deps | |
sudo apt update; | |
sudo apt install build-essential libssl-dev zlib1g-dev \ | |
libbz2-dev libreadline-dev libsqlite3-dev curl \ | |
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX=$(basename $(pwd)) | |
pto_gen -o project.pto *jpg | |
echo ----- | |
echo cpfind | |
echo ----- | |
echo "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Users/thomas/miniconda3/bin/python3 | |
import os, sys, subprocess | |
srcDir = "pix" | |
images=os.listdir("./pix/") | |
images.sort() | |
images=[x for x in images if x.split(".")[-1:][0]=="jpg"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ffmpeg filter, force landscape (or keep as is if already landscape) and | |
# rotate so top left and bottom right corner line up in the middle of the final frame | |
-vf 'transpose=2:passthrough=landscape,rotate=atan2(iw\,ih):ow=sqrt(iw*iw+ih*ih)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pxr import Usd, UsdGeom, Sdf, UsdShade | |
import os | |
############## | |
# Assuming a single mesh usd file | |
# Create a material and a binding to an Unreal material location so it gets automagically assined on load | |
# Remove the existing material assignment if one is found in the file | |
# | |
############## |
NewerOlder