Skip to content

Instantly share code, notes, and snippets.

@eliemichel
eliemichel / CMakeLists.txt
Last active July 13, 2021 16:54
Linking issue with OpenVDB - Windows 10, Visual Studio 16 2019, static linking
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")
list(APPEND CMAKE_MODULE_PATH "${OpenVDB_INSTALL_DIR}/lib/cmake/OpenVDB")
set(OPENVDB_USE_STATIC_LIBS ON)
find_package(OpenVDB COMPONENTS openvdb REQUIRED)
@eliemichel
eliemichel / TinyTimer.h
Last active April 17, 2025 15:32
A simple C++ timer library
/**
* A simple timer library, with a thread-safe sample accumulator.
*
* Basic usage:
* using TinyTimer::Timer;
* Timer timer;
* // .. do something
* cout << "Something took " << timer.elapsed() << " seconds" << endl;
*
* One can also consolidate several timings to measure standard deviation:
@eliemichel
eliemichel / apply_temporal_mapping.jsx
Created August 8, 2020 14:59
Temporal Stabilization for AfterEffects
// 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 = layer.property("ADBE Time Remapping");
// Remove previous keys
while (timeRemapping.numKeys > 0) {
timeRemapping.removeKey(1);
@eliemichel
eliemichel / MOD_pizza.c
Created September 14, 2019 09:03
Dummy Blender modifier
#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
eliemichel / eliemichel_bezierspline_PythonModule.py
Created April 24, 2019 10:04
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: https://developers.google.com/protocol-buffers/docs/encoding
import struct
def readVarint(f):
multiplier = 1
value = 0
b = 0xff
while b & 128:
b = struct.unpack('B', f.read(1))[0]
value += multiplier * (b & 127)
@eliemichel
eliemichel / extract_marmoset_archive.py
Last active October 21, 2024 14:32
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 = f.read(1)
@eliemichel
eliemichel / output
Last active March 2, 2019 11:20
Output of list_marmoset_archive on vivfox
$ python marmoset/marmoset_archive.py
Name MIME type Compressed Size Raw size
thumbnail.jpg image/jpeg False 0x1e5ca 0x1e5ca
sky.dat image/derp True 0x127a8e 0x200000
mesh0.dat model/mset False 0x43230 0x43230
mesh1.dat model/mset False 0xd86c 0xd86c
mat0_c.jpg image/jpeg False 0x2c055 0x2c055
mat0_r.jpg image/jpeg False 0xbc42 0xbc42
mat0_n.png image/png False 0x110666 0x110666
mat0_g.jpg image/jpeg False 0x415a8 0x415a8
@eliemichel
eliemichel / list_marmoset_archive.py
Last active December 14, 2023 08:05
List the items contained in a Marmoset Viewer's .mview archive file
import struct
def readCString(f):
"""This is the most naive implementation possible, don't use in prod"""
str = ""
c = f.read(1)
while c != '\0':
str += c
c = f.read(1)
return str
@eliemichel
eliemichel / marmoset.js
Created March 1, 2019 22:46
Marmoset viewer embedded code, as is
/*
(Built: Mon, Sep 24, 2018 4:38:25 PM)
Marmoset Viewer Code and Tools
Copyright (c) 2018 Marmoset LLC.
All rights reserved.
Redistribution and use of this software are permitted provided
that the software remains whole and unmodified and this copyright
notice remains attached. Use or inclusion of any portion of this