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
// Base Functions | |
function int Mandel(float x0, y0, z0; int imax) { | |
float x, y, z, xnew, ynew, znew; | |
int i; | |
x = x0; | |
y = y0; | |
z = z0; | |
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
// Resample into segments of random length | |
// Run over primitives | |
float seed = chf("seed"); | |
float seg_len_min = chi("seg_len_min"); | |
float seg_len_max = chi("seg_len_max"); | |
float seg_padding = chf("padding"); | |
if (seg_len_min <= 0 || seg_len_max < seg_len_min || seg_padding < 0) { | |
error("Make sure 0 < seg_len_min <= seg_len_max and 0 <= seg_padding"); |
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
import alembic | |
def any_shapes_in_alembic(filename): | |
"""Return whether Alembic file contains any shape/geometry. | |
Arguments: | |
filename (str): Full path to Alembic archive to read. | |
Returns: | |
bool: Whether Alembic file contains geometry. |
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
// Align object to target vector base on selected normal | |
// Useful when object has some weird orientation baked | |
// in the mesh and you wan to straighten it up. | |
// Point with normal from second wrangler input to align | |
vector from = point(1, 'N', 0); | |
// Allign "from" normal to the following vector | |
vector to = {0,1,0}; |
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
public class Perlin { | |
public int repeat; | |
public Perlin(int repeat = -1) { | |
this.repeat = repeat; | |
} | |
public double OctavePerlin(double x, double y, double z, int octaves, double persistence) { | |
double total = 0; |
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
# Get all nodes of type Read | |
readnodes = nuke.allNodes('Read') | |
for readnode in readnodes: | |
print readnode | |
# List all knobs for selected node | |
print( nuke.toNode('Read1') ) | |
# List all knobs for specific node | |
print( nuke.selectedNode() ) |