Skip to content

Instantly share code, notes, and snippets.

@tin2tin
tin2tin / sort_keymap_alphabetic.py
Created October 2, 2023 07:07
Sort keymap alphabetic
keyconfig_version = (3, 5, 10)
keyconfig_data = \
[("3D View",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items":
[("view3d.cursor3d", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, None),
("transform.translate",
{"type": 'RIGHTMOUSE', "value": 'CLICK_DRAG', "shift": True},
{"properties":
[("cursor_transform", True),
@tin2tin
tin2tin / IS_VSE.py
Last active October 2, 2023 07:23
Industry Standard Keymap for the VSE - based on the 3.5.1 keymap
keyconfig_version = (3, 5, 10)
keyconfig_data = \
[("Sequencer",
{"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'},
{"items":
[("marker.add", {"type": 'M', "value": 'PRESS'}, None),
("screen.animation_cancel",
{"type": 'K', "value": 'PRESS'},
{"properties":
[("restore_frame", False),
@tin2tin
tin2tin / b_and_w.py
Created August 28, 2023 09:04
Strip to black and white
import bpy
# get the current scene
scene = bpy.context.scene
# get the active movie strip
strip = scene.sequence_editor.active_strip
# set the color settings of the movie strip to black and white
@tin2tin
tin2tin / select_strip.py
Created August 25, 2023 22:17
Select strip
import bpy
class StripListPanel(bpy.types.Panel):
bl_label = "Strip List Panel"
bl_idname = "UI_PT_StripListPanel"
bl_space_type = 'SEQUENCE_EDITOR'
bl_region_type = 'UI'
bl_category = 'My Category'
@classmethod
@tin2tin
tin2tin / get_total_vram.py
Created August 4, 2023 20:23
get_total_vram
import torch
def get_total_vram():
total_vram = 0
for i in range(torch.cuda.device_count()):
properties = torch.cuda.get_device_properties(i)
total_vram += properties.total_memory
return total_vram
# SPDX-License-Identifier: GPL-2.0-or-later
import bpy
from bpy.types import (
Header,
Menu,
Panel,
)
from bl_ui.properties_grease_pencil_common import (
Move Add before Edit for consistency.
Add Range submenu.
Add Set Start/End frame.
(Is set range to selected missing in the NLA?)
Add Zoom
Move Frame Seleced above Frame all.
Remove redundant "Add" in add menu.
Move Add Meta Strip+Remove Meta Strip to Edit menu. Should remove be renamed to ex. "Unmeta Strip"?
I don't know what "Include Selected Objects" does, but should it be in the Add menu? Don't should like it should?
# SPDX-License-Identifier: GPL-2.0-or-later
from bpy.types import Header, Menu, Panel
from bpy.app.translations import contexts as i18n_contexts
from bl_ui.space_dopesheet import (
DopesheetFilterPopoverBase,
DopesheetActionPanelBase,
dopesheet_filter,
)
@tin2tin
tin2tin / eq.py
Created April 17, 2023 19:16
eq ui
if mod.type == 'SOUND_EQUALIZER':
box.use_property_decorate = False
box.use_property_split = False
flow = box.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
for i in range(len(mod.graphics)):
soundEq = mod.graphics[i]
box = flow.column()
box.template_curve_mapping(soundEq, "curve_mapping",
type='NONE', levels=False, brush=True, use_negative_slope=True, show_tone=False)
row = box.row(align=True)
@tin2tin
tin2tin / Bystedts_Rigging_Tools.py
Created April 14, 2023 05:05
Bystedts Rigging Tools - add mesh to bones
bl_info = {
"name": "Bystedts Rigging Tools",
"author": "Daniel Bystedt",
"version": (1, 0),
"blender": (3, 60, 0),
"location": "3D View > Bystedts Rigging Tools",
"description": "Various rigging tools",
"category": "Rigging"
}