Skip to content

Instantly share code, notes, and snippets.

@lapaev
lapaev / scale_withmanip.mel
Created May 22, 2015 00:47
Scale based on manip
int $whataxis = `manipMoveContext -q -mode Move`;
if ($whataxis == 6){
float $aaoa[] = `manipMoveContext -q -oa $wtf`;
string $xzoa = "" + $aaoa[0] + "rad";
string $yzoa = "" + $aaoa[1] + "rad";
string $zzoa = "" + $aaoa[2] + "rad";
scale -oa $xzoa $yzoa $zzoa -r -1 1 1;
}
if ($whataxis == 2){
scale -r -ws -1 1 1;
@lapaev
lapaev / Save JPEG to desktop.jsx
Created May 15, 2015 21:44
Save to DEsktop JPEG
//Cobbled together from:
//http://feedback.photoshop.com/photoshop_family/topics/quick_save_as
//http://www.polycount.com/forum/showthread.php?t=85425
#target photoshop;
if (app.documents.length > 0) {
var thedoc = app.activeDocument;
var docName = thedoc.name;
@lapaev
lapaev / timeDragger.py
Created April 10, 2015 23:54
Smooth Time Scrubber
'''
timeDragger 1.0
29/03/2015
Tom Bailey
'''
import maya.cmds as cmds
import maya.mel as mel
'''
@lapaev
lapaev / moi_vp_render.js
Created March 26, 2015 01:23
Render viewport in MOI3D
script:var v = moi.ui.getActiveViewport(); if ( v != null ) { moi.view.lineWidth = 4; v.renderToClipboard( 4096, 4096 ); moi.view.lineWidth = 1; }
@lapaev
lapaev / getname.mel
Created March 26, 2015 01:22
Get name of object from component mode
string $parent[] = `listRelatives -p`;
$parent = `listRelatives -p $parent[0]`;
string $obj = $parent[0];
@lapaev
lapaev / Save_JPEG_to_desktop.jsx
Created March 11, 2015 18:38
Quick Save JPEG to Desktop
//Cobbled together from:
//http://feedback.photoshop.com/photoshop_family/topics/quick_save_as
//http://www.polycount.com/forum/showthread.php?t=85425
#target photoshop;
if (app.documents.length > 0) {
var thedoc = app.activeDocument;
var docName = thedoc.name;
import maya.cmds as cmds import maya.OpenMaya as om import os #Changes the name of file nodes to their Image Name fileNodes = cmds.ls(textures=True) for f in fileNodes: cmds.select(f, replace=True) imageNameFull = cmds.getAttr(".fileTextureName") imageNameBase = os.path.basename(imageNameFull) imageName, imageExt = os.path.splitext(imageNameBase) cmds.rename(f, imageName) om.MGlobal.displayInfo("Changed name on all file Nodes")
@lapaev
lapaev / objFix.mel
Created February 17, 2015 23:10
Fix Visible in Reflection/REfraction vray
global proc objFix()
{
string $mySelection[] = `ls -sl`;
for($each in $mySelection)
{
string $mySelectionShapes[] = `listRelatives -s $each`;
if( !(nodeType($each) == "mesh") )
{
select -cl;
@lapaev
lapaev / curvescvrun.py
Created February 15, 2015 06:44
Run through each CV on selected curves
def clsit(inputer):
cvc = cmds.getAttr(inputer+'.spans') + cmds.getAttr(inputer+'.degree')
for z in range(0, cvc):
z = str(z)
cmds.select(inputer + '.cv[' + z + ']')
@lapaev
lapaev / togglecurves.mel
Created February 7, 2015 22:12
Toggle Curves in maya viewports
global proc toggleCurveser(){
for ($x in `getPanel -type modelPanel`){
int $curvesval = !`modelEditor -q -nurbsCurves modelPanel4`;
modelEditor -e -nurbsCurves $curvesval $x;
}
}