Skip to content

Instantly share code, notes, and snippets.

# ##### 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
@tin2tin
tin2tin / transcode_for_avid.sh
Created May 26, 2020 19:57 — forked from bradcordeiro/transcode_for_avid.sh
FFmpeg Command to Transcode DNxHR for Avid Media Composer
# Change number following -profile:v to encode different flavors of DNxHR
# 1: DNxHR 444
# 2: DNxHR HQX
# 3: DNxHR HQ
# 4: DNxHR SQ
# 5: DNxHR LB
ffmpeg -i ${INPUT} -c:v dnxhd -profile:v 3 -c:a pcm_s24le ${OUTPUT}
@tin2tin
tin2tin / build_otio_wheel.sh
Created November 26, 2020 12:14 — forked from Celeborn2BeAlive/build_otio_wheel.sh
Shell script to build a wheel of OpenTimelineIO 0.12.1
#!/bin/bash
# This script generate a wheel for OpenTimelineIO in dist folder
# We need it has a patch to install otio 0.12.1 in Windows Blender because it requires compilation
# This wheel should be distributed with code that depends on otio 0.12.1 and installed using Blender's python -m pip
# You need python (3.7.*) and Visual Studio 2017+
CURRENT_DIR=`dirname $0`
ROOT_DIR=$CURRENT_DIR/
@tin2tin
tin2tin / log.py
Created June 18, 2019 05:29 — forked from tamask/log.py
Route system output (stdout/stderr) of Blender to the app console (put in scripts/startup)
import os
import sys
import bpy
output = None
input = None
info = None
error = None
write = None
@tin2tin
tin2tin / forward_of_sdxl_original_unet.py
Created January 12, 2024 21:42 — forked from kohya-ss/forward_of_sdxl_original_unet.py
SDXLで高解像度での構図の破綻を軽減する
def forward(self, x, timesteps=None, context=None, y=None, **kwargs):
# broadcast timesteps to batch dimension
timesteps = timesteps.expand(x.shape[0])
hs = []
t_emb = get_timestep_embedding(timesteps, self.model_channels) # , repeat_only=False)
t_emb = t_emb.to(x.dtype)
emb = self.time_embed(t_emb)
assert x.shape[0] == y.shape[0], f"batch size mismatch: {x.shape[0]} != {y.shape[0]}"
@tin2tin
tin2tin / basic_ui_documented.py
Last active April 10, 2024 03:38 — forked from AzureDVBB/basic_ui_documented.py
A commented template for making simple UI in blender using the bpy python API
#import the bpy module to access blender API
import bpy
#WARNING: this is written and tested for blender 2.79
#blender 2.8 and newer will likely have a different python API
#create a property group, this is REALLY needed so that operators
#AND the UI can access, display and expose it to the user to change
#in here we will have all properties(variables) that is neccessary
class CustomPropertyGroup(bpy.types.PropertyGroup):