Skip to content

Instantly share code, notes, and snippets.


Elie Michel eliemichel

View GitHub Profile
eliemichel /
Last active May 30, 2022
Snippet for reproducing the Shift+D in a node graph editor in Blender
import bpy
def duplicate_node(n1, node_group=None, duplicate_links=False):
Duplicate a node (without duplicating its links)
@param n1 The node to duplicate
@param node_group (optional) Group in which the node must be duplicated
@param duplicate_links Whether to keep input links or not
@return the new duplicate node
// [...]
* Create a new Mesh representing a simple pizza (really just a disc with
* a few quads on top of it).
* olive_count is the number of olives topping the pizza
* radius is the radius of the pizza
* base_polys is filled with the range of polygons belonging to the base
* olive_polys is filled with the range of polygons representing the olives
eliemichel /
Last active Apr 8, 2022
Resolve conflicted areas of a file in favor of theirs or ours and leave correctly merged areas as is
# This is an automation of
# Example:
# --theirs path/to/some/file
import os
import argparse
from shutil import copyfile
import subprocess
parser = argparse.ArgumentParser(description='Resolve conflicted areas of a file during a git merge')
eliemichel / CMakeLists.txt
Last active Jul 13, 2021
Linking issue with OpenVDB - Windows 10, Visual Studio 16 2019, static linking
View CMakeLists.txt
cmake_minimum_required(VERSION 3.7..3.20)
project(MyTest LANGUAGES CXX)
set(OpenVDB_INSTALL_DIR "" CACHE STRING "Directory specified as CMAKE_INSTALL_PREFIX when building OpenVDB")
find_package(OpenVDB COMPONENTS openvdb REQUIRED)
eliemichel / TinyTimer.h
Created Jun 7, 2021
A simple C++ timer library
View TinyTimer.h
* A simple timer library.
* Basic usage:
* using TinyTimer::Timer;
* Timer timer;
* // .. do something
* cout << "Something took " << timer.ellapsed() << " seconds" << endl;
* One can also consolidate several timings to measure standard deviation:
eliemichel / apply_temporal_mapping.jsx
Created Aug 8, 2020
Temporal Stabilization for AfterEffects
View apply_temporal_mapping.jsx
// Select the layer to apply remapping to
// (the rush or any edited version of the rush as long as
// the in/out timings match the original)
var layer = app.project.activeItem.selectedLayers[0];
var timeRemapping ="ADBE Time Remapping");
// Remove previous keys
while (timeRemapping.numKeys > 0) {
eliemichel / MOD_pizza.c
Created Sep 14, 2019
Dummy Blender modifier
View MOD_pizza.c
#include "BKE_modifier.h"
#include "DNA_mesh_types.h"
#include "DNA_modifier_types.h"
static Mesh *pizza_applyModifier(struct ModifierData *md,
const struct ModifierEvalContext *ctx,
struct Mesh *mesh)
printf("PIZZA is cooking on data @%p\n", md);
return mesh;
eliemichel /
Created Apr 24, 2019
Script of a BezierSpline Houdini Digital Asset
# BezierSpline
# (Houdini Digital Asset Module)
# Shared under the terms of the MIT License
# Copyright (c) 2019 Elie Michel
# This is a wip, expect more docstring eventually
from __future__ import print_function
# Utils
# Varint decoding:
import struct
def readVarint(f):
multiplier = 1
value = 0
b = 0xff
while b & 128:
b = struct.unpack('B',[0]
value += multiplier * (b & 127)
eliemichel /
Last active Oct 16, 2021
Extract the items contained in a Marmoset Viewer's .mview archive file
import struct
import os
# Parameter
archive = "vivfox.mview"
def readCString(f):
"""This is the most naive implementation possible, don't use in prod"""
str = ""
c =