This file contains 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
""" | |
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 | |
----- |
This file contains 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
""" | |
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. |
This file contains 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
// 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 |
This file contains 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
""" | |
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 |
This file contains 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
""" | |
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 |
This file contains 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
$ 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 |
This file contains 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 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 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 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); |