Skip to content

Instantly share code, notes, and snippets.

@tin2tin
tin2tin / draw_mc_preview.diff
Last active Nov 19, 2021
Draw MovieClip Previews patch
View draw_mc_preview.diff
diff --git a/source/blender/blenkernel/intern/icons.cc b/source/blender/blenkernel/intern/icons.cc
index ffc39028400..0e1a43bfea2 100644
--- a/source/blender/blenkernel/intern/icons.cc
+++ b/source/blender/blenkernel/intern/icons.cc
@@ -41,6 +41,7 @@
#include "DNA_screen_types.h"
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
+#include "DNA_movieclip_types.h"
View dndvse.diff
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 4b6c5e29d77..67c453d391e 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -28,6 +28,7 @@
#include "DNA_gpencil_types.h"
#include "DNA_mask_types.h"
#include "DNA_scene_types.h"
+#include "DNA_sound_types.h"
@tin2tin
tin2tin / strips_to_asset_browser.py
Last active Nov 18, 2021
Convert selected strips to assets via sound, image or clip IDs.
View strips_to_asset_browser.py
# Convert selected strips to assets via sound, image or clip IDs.
# By tintwotin & batFINGER
import bpy, os
strips = bpy.context.selected_editable_sequences
strips = sorted(strips, key=lambda strip: strip.frame_final_start)
for sq in strips:
if sq.type == "SOUND":
@tin2tin
tin2tin / drag_drop.diff
Created Nov 17, 2021
Drag and drop files from outliner and asset browser into VSE
View drag_drop.diff
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 2a6e49edfb6..dd57b74cd0d 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -364,6 +364,21 @@ static void sequencer_listener(const wmSpaceTypeListenerParams *params)
/* ************* dropboxes ************* */
+static bool movie_id_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
+{
@tin2tin
tin2tin / basic_ui_documented.py
Last active Oct 15, 2021 — forked from AzureDVBB/basic_ui_documented.py
A commented template for making simple UI in blender using the bpy python API
View basic_ui_documented.py
#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):
@tin2tin
tin2tin / Dial_and_scale.py
Created Jul 15, 2021
Dial_and_scale.py updated
View Dial_and_scale.py
bl_info = {
"name": "Dial and Scale",
"author": "stacker, sambler",
"version": (1, 2),
"blender": (2, 80, 0),
"location": "3DView > Add > Curve > Dial and Scale",
"description": "Add an array of text number objects or watch dials.",
"warning": "",
"wiki_url": "https://github.com/3dbug/blender/blob/master/DialScale.py",
"tracker_url": "https://github.com/3dbug/blender/issues",
@tin2tin
tin2tin / pan_presets.diff
Created Jul 14, 2021
Diff for Pan Presets for the Blender VSE
View pan_presets.diff
diff --git a/release/scripts/startup/bl_operators/sequencer.py b/release/scripts/startup/bl_operators/sequencer.py
index 48a02a4c5c6..b94d2f03709 100644
--- a/release/scripts/startup/bl_operators/sequencer.py
+++ b/release/scripts/startup/bl_operators/sequencer.py
@@ -377,10 +377,138 @@ def calculate_duration_frames(context, duration_seconds):
return round(duration_seconds * context.scene.render.fps / context.scene.render.fps_base)
+class SEQUENCER_OT_pan_presets(Operator):
+ """Pan Presets"""
@tin2tin
tin2tin / Add_text_strip_outline.py
Last active May 27, 2021
Add_text_strip_outline.py
View Add_text_strip_outline.py
bl_info = {
"name": "Add Outline",
"author": "tintwotin",
"version": (1, 0),
"blender": (2, 83, 0),
"location": "Text Strip > Style > Add Outline",
"description": "Add outline to text strips",
"warning": "",
"doc_url": "",
"category": "Sequencer",
@tin2tin
tin2tin / Run_Script_in_PyConsole.py
Last active May 11, 2021
Run Script in the Python Console
View Run_Script_in_PyConsole.py
bl_info = {
"name": "Run Script in PyConsole",
"author": "CoDEmanX",
"version": (1, 0),
"blender": (2, 80, 0),
"location": "Python Console > Console > Run Script",
"description": "Execute the code of a textblock within the python console.",
"warning": "",
"wiki_url": "",
"tracker_url": "",
@tin2tin
tin2tin / sound_strip_to_speaker_object.py
Created Mar 11, 2021
Import and select a sound strip in the sequencer
View sound_strip_to_speaker_object.py
import bpy
# Import and select a sound strip in the sequencer, then run scipt.
# A speaker object and a sound data-block will be created and linked.
active = bpy.context.scene.sequence_editor.active_strip
if active and active.type == "SOUND":
path = bpy.path.abspath(active.sound.filepath)
bpy.ops.object.speaker_add()