Skip to content

Instantly share code, notes, and snippets.

View eliemichel's full-sized avatar

Elie Michel eliemichel

View GitHub Profile
@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
"""
Usage: blender.exe -b -P BlenderSurfRigMerge.py
Requires TransferMaterialsOperator.py in the same directory
Copyright (c) 2018 -- Elie Michel
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
"""
Transfer material data from active to selected objects.
If the active object is a group instance, recurse over its elements and match
destination by name (object selection is then ignored).
Copyright (c) 2018 -- Elie Michel
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
@eliemichel
eliemichel / hscript
Last active July 16, 2018 13:07
Fade out offset
// Fade in
{
float x0 = ch("../PARAM/start_crossfade_frame");
float x1 = ch("../PARAM/end_crossfade_frame");
float a1 = 0.01;
float a0 = a1 / (2 * (x1 - x0));
float b1 = a0 * (x1 - x0) * (x1 - x0) - a1 * x1;
return if($FF < x0, 0, if($FF < x1, a0 * ($FF - x0) * ($FF - x0), a1 * $FF + b1));
}
// Fade out
"""
autoRotate
==========
Align the selected edge to the world X axis of the scene by rotating the whole mesh.
Usage
-----
Select exactly one edge, then run the script.
"""
autoRotate
==========
(Blender edition -- also available for Maya)
Align the selected edge to the world X axis of the scene by rotating the whole mesh.
Usage
-----
// Copyright (c) 2017 - Élie Michel
// License: CC BY 3.0
// Please credit even if you are just re-using the particle system.
// Sync with 'Image' buffer
const float dt = 0.001;
mat3 particleSpaceMatrix(vec2 origin, vec2 velocity) {
vec3 O = vec3(origin, 1.);
vec3 X = normalize(vec3(velocity, 0.));
#define a(p) textureLod(iChannel0, p, 2.5)
#define t texture(iChannel1,
void mainImage( out vec4 c, vec2 g )
{
c = a(g /= iResolution.xy);
vec2 x = vec2(20);
vec4 n = t round(g*x - .3) / x);
vec2 z = g*x * 6.3 + (t g * .1).rg - .5) * 2.;
x = sin(z) - fract(iTime * (n.b + .1) + n.g) * .5;
// Author: Élie Michel
// License: CC BY 3.0
// July 2017
void mainImage( out vec4 f, in vec2 c )
{
vec2 u = c / iResolution.xy,
n = texture(iChannel1, u * .1).rg; // Displacement
f = textureLod(iChannel0, u, 2.5);
Qless server API
================
The first argument is always `now`, the current timestamp. It is not precised for each method in the documentation because bindings usually automatically prepend it to the argument list. But if you are calling the server directly in lua, you will need it.
The best way to have more information about the methods documented here is to look at `api.lua`. The commands available in the API are the members of the `QlessAPI` table, which are easily readable and point to methods provided in other files. For instance, if the body of the method looks like `return Qless.Job(jid):foobar(...)`, then it is likely that the function is defined and documented in `job.lua` because it's getting a `Job` object. If you cannot say at first because it's not using an object, it must be in `base.lua`.
# Config
## config.get([key])