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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>three.js webgl - loaders - OBJ loader</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> | |
<style> | |
body { | |
font-family: Monospace; | |
background-color: #000; |
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
// stagger_keys.mel (using .m to get gist syntax highlighting) | |
// author: Kelly Yu | |
// I have 124 keys that look like bunny_slice_$i_translateY where $i ranges from 001 to 123 | |
for ($i = 1; $i < 124; $i++) { | |
string $formatted; | |
// format number so that it is at least 3 digits long | |
if ($i < 10) { | |
$formatted = "00" + $i; | |
} else if ($i < 100) { |
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
### assign_to_layers.py | |
### Kelly Yu | |
import maya.cmds as cmds | |
cmds.select(clear=1) | |
# get slices | |
bunny_slices = cmds.ls('polySurface*') | |
# remove surface shapes | |
bunny_slices = [s for s in bunny_slices if 'Shape' not in s] |
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
### combine_slices.py | |
### author: Kelly Yu | |
import maya.cmds as cmds | |
cmds.select(clear=1) | |
# get slices | |
bunny_slices = cmds.ls('polySurface*', o=True) | |
# remove surface shapes | |
bunny_slices = [s for s in bunny_slices if 'Shape' not in s] |
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
### iterative_polycloseborder.py | |
### author: Kelly Yu | |
import maya.cmds as cmds | |
cmds.select(clear=1) | |
# select all objects that start with polySurface | |
bunny_slices = cmds.ls('polySurface*') | |
for slice in bunny_slices: |
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
### iterative_polyseparate.py | |
### author: Kelly Yu | |
import maya.cmds as cmds | |
cmds.select(clear=True) | |
# select a list of objects starting with 'bunny' and get the first element | |
bunny = cmds.ls('bunny')[0] | |
# retrieve face count | |
bunny_face_count = cmds.polyEvaluate(bunny, face=True) |
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
// iterative_polycut.mel (using .m only to get gist syntax highlighting) | |
// author: Kelly Yu | |
// Get bounding box info on the mesh | |
float $boundingBox[] = `polyEvaluate -boundingBox bunnyMesh`; | |
float $ymax = $boundingBox[3]; | |
// We want to cut every 0.125 units | |
int $numDivisions = $ymax / 0.125; | |
// Assuming the bottom of the mesh is at 0, this will cut along the mesh's height |