Skip to content

Instantly share code, notes, and snippets.

@oleg-kachan
oleg-kachan / hander.py
Created February 16, 2018 11:06
Blender render
import bpy
import json
import os
class DataCombiner(object):
def __init__(self, path_to_renders, path_to_groundtruth):
self.path_to_groundtruth = path_to_groundtruth
bpy.data.scenes['Scene'].render.filepath = path_to_renders
@ugai
ugai / .swlg_scripts.md
Last active October 6, 2018 06:44
Blenderで動画作った際の副産物置き場

Blenderで動画作った際の副産物置き場。

  • EC2向けのネットワークレンダ用サービススクリプト
  • Blenderマクロ(Python)
  • OpenEXR連番から動画作成
@Pentan
Pentan / keyconf_html.py
Last active November 24, 2018 06:54
Dump Blender key config as HTML.
import bpy
from bpy_extras import keyconfig_utils
import sys
# Dump Blender keyconfig as HTML.
# How to use
# 1. Open this file in Blender's Text Editor.
# 2. Do "Run Script".
# 3. New Text "keyconfigs.html" will be added.
# save it somewhere and open in web browser (recommends Safari, Chrome or Firefox).
@zeffii
zeffii / has_selection.py
Created September 23, 2012 23:20
checking if text has selection
import bpy
text = bpy.context.edit_text
def has_selection(text):
return not (text.select_end_line == text.current_line and \
text.current_character == text.select_end_character)
print(has_selection(text))
@lennart
lennart / README.md
Last active June 24, 2019 19:11
Splended, a simple Sampler Builder based on Blender… It is, though, just a script.

splended

Build musical samplers with blender, splended helps you!

Installation

OS X

put splended.py into ~/Application Support/Blender/2.xx/scripts/

@pcote
pcote / keyframe_point_swapper.py
Created September 2, 2012 02:58
Blender test script that swaps pairs of selected keyframe points.
import bpy
from pdb import set_trace
# quick handy little lambdas
first = lambda l : l[0]
last = lambda l : l[-1]
def chunks(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i+n]
import bpy
#########################################
# Configuration #
#########################################
# If True, key modifiers will be skipped (always set to NONE).
IGNORE_KEY_MODIFIER = False
@batFINGER
batFINGER / __init__.py
Last active July 6, 2019 15:14
"addon submodules"
bl_info = {
"name": "Example Addon Preferences",
"author": "Your Name Here",
"version": (1, 0),
"blender": (2, 65, 0),
"location": "SpaceBar Search -> Addon Preferences Example",
"description": "Example Addon",
"warning": "",
"wiki_url": "",
"tracker_url": "",
@caiwan
caiwan / bake.py
Created September 1, 2017 13:10
Blender bake
import bpy
def do_bake(scene):
""" This thing tries to bake all the object animations
and camera movement into a single track
Drawback: it eleminates scenegraph hierarchy and flattens everzthing
This suposed to be it, but fingers crossed:
https://wiki.blender.org/index.php/Dev:2.4/Source/Animation/AnimationBaking
@twilson90
twilson90 / get_anim_datas
Created March 31, 2019 00:04
a helpful function for finding most of the animation datas used in a context or scene
def get_anim_datas(context=None):
if context is None: context = bpy.context
found = set()
materials = set()
textures = set()
def found_add(o):
if o is None: raise Exception()
found.add(o)
found_add(context.scene)