Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import os
import re
import shutil
import subprocess
SOURCE_DIR = "/src/blender"
@ideasman42
ideasman42 / fill_poly_v2i_n.c
Last active August 18, 2023 03:07
Raster poly-filling by Darel Rex Finley, optimized by Campbell Barton.
/* C99, public domain licensed */
#include <limits.h>
#include <stdbool.h>
#include <math.h>
/* utilities */
#define SWAP(type, a, b) do { \
type sw_ap; \
@ideasman42
ideasman42 / nerd-dictation.diff
Created July 6, 2021 05:35
nerd-dictation diff
diff --git a/nerd-dictation b/nerd-dictation
index 3488618..6e688ab 100755
--- a/nerd-dictation
+++ b/nerd-dictation
@@ -1109,6 +1109,7 @@ This creates the directory used to store internal data, so other commands such a
output=args.output,
),
)
+ return subparse
@ideasman42
ideasman42 / linked_list_sort.c
Created May 23, 2015 06:10
Mergesort single linked list (improvements from SE answer)
/* Originally from: http://stackoverflow.com/a/27663998/432509
*
* With following modifications:
* - Use a pointer to the tail (remove 2x conditional checks, reduces code-size).
* - Avoid re-assigning empty values the size doesn't change.
* - Corrected comments.
*/
static void *listbase_sort_impl(struct Link *head, int (*cmp)(const void *, const void *))
{
@ideasman42
ideasman42 / readme.rst
Last active April 13, 2019 07:46
Proposed Blender Readme

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing and motion tracking and video editing.

Project Pages

# Sphinx version: 1.6.3
# Python version: 3.6.2 (CPython)
# Docutils version: 0.14
# Jinja2 version: 2.9.6
# Last messages:
# loading translations [zh-hant]...
#
# not available for built-in messages
#
# loading intersphinx inventory from https://docs.blender.org/api/2.79/objects.inv...
@ideasman42
ideasman42 / asan_error.txt
Created July 24, 2017 11:03
CMake/ASAN Error
[ 0%: -1485] Generating ../../../../release/datafiles/brushicons/twist.png.c
FAILED: release/datafiles/brushicons/twist.png.c
cd /src/cmake_debug/source/blender/editors/datafiles && /usr/bin/cmake -E make_directory /src/cmake_debug/release/datafiles/brushicons && /src/cmake_debug/bin/datatoc /src/blender/release/datafiles/brushicons/twist.png /src/cmake_debug/release/datafiles/brushicons/twist.png.c
==6648==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==6648==ASan shadow was supposed to be located in the [0x00007fff7000-0x10007fff7fff] range.
==6648==Process memory map follows:
0x00ab8a216000-0x00ab8a21a000 /src/cmake_debug/bin/datatoc
0x00ab8a419000-0x00ab8a41a000 /src/cmake_debug/bin/datatoc
0x00ab8a41a000-0x00ab8a41c000 /src/cmake_debug/bin/datatoc
0x7fc419401000-0x7fc419753000
@ideasman42
ideasman42 / asan_error.txt
Created July 24, 2017 11:03
CMake/ASAN Error
[ 0%: -1485] Generating ../../../../release/datafiles/brushicons/twist.png.c
FAILED: release/datafiles/brushicons/twist.png.c
cd /src/cmake_debug/source/blender/editors/datafiles && /usr/bin/cmake -E make_directory /src/cmake_debug/release/datafiles/brushicons && /src/cmake_debug/bin/datatoc /src/blender/release/datafiles/brushicons/twist.png /src/cmake_debug/release/datafiles/brushicons/twist.png.c
==6648==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==6648==ASan shadow was supposed to be located in the [0x00007fff7000-0x10007fff7fff] range.
==6648==Process memory map follows:
0x00ab8a216000-0x00ab8a21a000 /src/cmake_debug/bin/datatoc
0x00ab8a419000-0x00ab8a41a000 /src/cmake_debug/bin/datatoc
0x00ab8a41a000-0x00ab8a41c000 /src/cmake_debug/bin/datatoc
0x7fc419401000-0x7fc419753000
/// Plot a line,
///
/// Bresenham's line algorithm,
/// See: https://en.wikipedia.org/wiki/Bresenham's_line_algorithm
/// StackOverflow: http://stackoverflow.com/a/40902741/432509
fn plot_line_v2v2i<F>(
p1: &[i32; 2],
p2: &[i32; 2],
import bpy
import os
from bpy import data as D, context as C
if not C.scene.use_nodes:
C.scene.use_nodes = True
compo_nodes = bpy.context.scene.node_tree.nodes
compo_links = bpy.context.scene.node_tree.links