This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> | |
<Type Name="blender::StringRef"> | |
<DisplayString>{data_}</DisplayString> | |
<Expand> | |
<Item Name="[size]">size_</Item> | |
<Item Name="[data]">data_</Item> | |
</Expand> | |
</Type> | |
</AutoVisualizer> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint a = BLI_rng_get_uint(rng); | |
uint b = 0x3F800000 | (0x007FFFFF & a); | |
float c = *(float *)&b; | |
return c - 1.0f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from dataclasses import dataclass | |
from itertools import islice | |
@dataclass | |
class Rectangle: | |
x: float | |
y: float | |
width: float | |
height: float |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "llvm/IR/IRBuilder.h" | |
#include "llvm/IR/Verifier.h" | |
#include "llvm/Support/TargetSelect.h" | |
#include "llvm/ExecutionEngine/ExecutionEngine.h" | |
#include <vector> | |
#include <memory> | |
void test_llvm() { | |
llvm::LLVMContext *context = new llvm::LLVMContext(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import bpy | |
import sys | |
import typing | |
import inspect | |
import pkgutil | |
import importlib | |
from pathlib import Path | |
__all__ = ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static PyObject *get_external_function(const char *module_name, const char *function_name) | |
{ | |
PyObject *module = PyImport_ImportModule(module_name); | |
PyObject *globals = PyModule_GetDict(module); | |
PyObject *function = PyDict_GetItemString(globals, function_name); | |
Py_DecRef(module); | |
return function; | |
} | |
static PyObject *call_external_method( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import ceil | |
from random import randint | |
def mergesort(A): | |
B = [None] * len(A) | |
chunk_size = 1 | |
while chunk_size < len(A): | |
for i in range(ceil(len(A) / chunk_size / 2)): | |
merge(A, B, | |
start1 = 2 * i * chunk_size, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sources = [ | |
("test1.pyx", []), | |
("test2.pyx", ["extra.c"]) | |
] | |
import os | |
import sys | |
def main(): | |
if cython_exists(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from bpy.props import * | |
from ... base_types import AnimationNode | |
from ... data_structures import DoubleList | |
class MidiNoteData(bpy.types.PropertyGroup): | |
noteName = StringProperty() # e.g. C4, B5, ... | |
# This value can be keyframed. | |
# It is possible but not easy to 'find' the fcurve of this property. | |
# Therefor only the value in the current frame can be accessed efficiently. |