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 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) |
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
# 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) |
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
# 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 |
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 "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; |
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
// 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); |
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
/** | |
* 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: |
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
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) |
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
# This is an automation of https://stackoverflow.com/questions/71783590/git-merge-strategy-option-theirs-for-individual-files | |
# Example: | |
# git_resolve.py --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') |
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
// [...] | |
/** | |
* 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 | |
*/ |
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 | |
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 | |
""" |