Skip to content

Instantly share code, notes, and snippets.

@sweenist
sweenist / view3d_toggle_cursor_relocation.py
Created April 15, 2016 10:41
Blender: A quick and easy way to disable relocation of the 3d cursor on LMB click in Blender
bl_info = {
"name": "3D Cursor LMB Toggle",
"author": "Ryan Sweeney",
"version": (1, 0),
"blender": (2, 75, 0),
"location": "View3D > Properties Panel > 3D Cursor",
"description": "Adds a toggle to the 3D Cursor properties tab.",
"warning": "",
"wiki_url": "http://sweenist.wordpress.com/2014/12/22/blender-add-on-3d-cursor-toggle/",
"category": "3D View"}
@sweenist
sweenist / unzero.py
Last active August 29, 2015 14:12
Python: Increment accidentally 0 indexed lists when the contexts should start at 1
######################################################
### Ever accidentally make a list of immutable tuples
### only to find you used 0 as the base index instead
### of 1? So did I, ergo, unzero_list_of_tuples
### Ever have the reverse happen? use zero_list_of_tuples
######################################################
def unzero_list_of_tuples(t_list):
ret_list = []
for item in t_list:
for i in range(len(item)):
@sweenist
sweenist / type_crossover.py
Last active August 29, 2015 14:12
Blender API: simple script tp cross reference context and data attributes
"""
Simple script to identify what bpy.context and bpy.data attributes have
some crossover. data attributes tend to end with "s", where the context is
singular
eg: bpy.data.objects[i] and bpy.context.object both inherit from:
bpy.types.Object
"""
@sweenist
sweenist / DynWinControls
Last active August 29, 2015 14:11
Dynamic Windows Control example that makes a GroupBox and adds items as needed
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;