Skip to content

Instantly share code, notes, and snippets.

@cyaoeu
cyaoeu / gist:d6566022626782fd07dcdd9540e1bb5f
Created October 10, 2019 13:44
Blender random colors
(1,0,0,1),
(0,1,0,1),
(0,0,1,1),
(1,1,0,1),
(1,0,1,1),
(0,1,1,1),
(1,0.5,0.5,1),
(0.5,1,0.5,1),
(0.5,0.5,1,1),
(1,1,0.5,1),
@cyaoeu
cyaoeu / extractjson.py
Created July 11, 2018 13:55
Extract JSON from txt files containing other stuff
import shutil
import glob
path = "C:\\beatsaber\\OST\\"
filenames = glob.glob(path + "*.txt")
for filename in filenames:
with open(filename, 'r') as txtfile:
data=txtfile.read().replace('\n', '')
splitstring = data.split('_jsonData = "')[1].rsplit('"', 1)[0]
@cyaoeu
cyaoeu / SetVertexColor.py
Last active June 16, 2018 14:52
Blender addon: Set Vertex Color (License: GPL)
#
# Save into your addons directory as mesh_set_vertex_color.py
# and activate the add-on in user preferences
#
bl_info = {
"name" : "Set Vertex Color",
"author" : "Stanislav Blinov, edited by Henrik Berglund",
"version" : (1, 1, 0),
"blender" : (2, 79, 0),
@cyaoeu
cyaoeu / stroke_select_blender.py
Created March 24, 2018 14:56
stroke select addon (edited)
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ffmpeg -y -hwaccel cuvid -i input.mkv -acodec copy -vcodec h264_nvenc -b:v 6M -vf "stereo3d=sbsl:abl, pad=width=3840:height=3840:x=960:y=0" input_fixed.mkv
@cyaoeu
cyaoeu / ue4.xml
Last active November 27, 2018 01:41
Blender UE4 theme (WIP) - install using Install Theme from user preferences
<bpy>
<Theme>
<user_interface>
<ThemeUserInterface menu_shadow_fac="0.5"
menu_shadow_width="12"
icon_file=""
icon_alpha="1"
widget_emboss="#31313105"
axis_x="#dc0000"
axis_y="#00dc00"
@cyaoeu
cyaoeu / ImageFramesToImgurMp4.bat
Created November 19, 2017 15:04
ImageFramesToImgurMp4.bat (batch script)
@ECHO OFF
ECHO "%~1"
C:/ffmpeg/bin/ffmpeg.exe -i "%~d1%%04d.png" -r ntsc -movflags faststart -pix_fmt yuv420p -vf scale=trunc(iw/2)*2:trunc(ih/2)*2 "%~n1.mp4"
set /p=
@cyaoeu
cyaoeu / cyaoeu.xml
Last active November 18, 2017 22:53
cyaoeu Blender theme (WIP!)
<bpy>
<Theme>
<user_interface>
<ThemeUserInterface menu_shadow_fac="0.5"
menu_shadow_width="12"
icon_file=""
icon_alpha="1"
widget_emboss="#31313105"
axis_x="#dc0000"
axis_y="#00dc00"
@cyaoeu
cyaoeu / fbx_export_animation_with_shapekeyanimation.py
Created October 23, 2017 19:19
fbx_export_animation_with_shapekeyanimation.py
import bpy
path = bpy.path.abspath('//') #path of .blend
for object in bpy.context.selected_objects:
if object.type == "ARMATURE": #select both mesh and rig
rig = object
if object.type == "MESH":
mesh = object
riganimname = rig.animation_data.action.name
@cyaoeu
cyaoeu / import_multiple_fbx.py
Created September 27, 2017 13:10
Import multiple FBX files (hacky)
import bpy
import os
def listFiles(dir, ext):
fileList = []
for file in os.listdir(path):
if file[-len(ext):] == ext:
fileList.append(file)