Skip to content

Instantly share code, notes, and snippets.

@ethanaeris
ethanaeris / Pie_workspaces.py
Last active September 14, 2022 17:04
Pie Workspaced Addon for Blender 2.8. A quick way to switch between workspaces
# -*- coding: utf-8 -*-
# ##### 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,
@tamask
tamask / log.py
Created August 8, 2018 00:44
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
@AzureDVBB
AzureDVBB / basic_ui_documented.py
Last active May 25, 2022 20:05
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):
@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
@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
@p2or
p2or / blender-filebrowser-display-override.py
Last active May 21, 2023 18:07
Override File Browser Display Settings (http://blender.stackexchange.com/q/23159/3710) #Blender #BSE
# ##### 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
@p2or
p2or / blender-list-files-of-loaded-image-sequence.py
Created February 17, 2017 14:29
List Files of loaded Image Sequence #Blender #BSE
# for http://blender.stackexchange.com/q/73858/3710
import bpy
import os
def image_sequence_resolve(operator, context):
filepath = context.space_data.clip.filepath
filepath_full = bpy.path.abspath(filepath)
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": "",
@p2or
p2or / blender-custom-toggle-shortcut.py
Last active May 22, 2023 16:11
Custom Shortcut Toggle #Blender #BSE
# for http://blender.stackexchange.com/questions/58486/add-toggle-hotkey-to-custom-checkbox
bl_info = {
"name": "Add-on Template",
"description": "",
"author": "poor",
"version": (0, 0, 2),
"blender": (2, 70, 0),
"location": "3D View > Tools",
"warning": "", # used for warning icon and text in addons panel