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
topLevelLayers = #() | |
for i = 0 to LayerManager.count - 1 do ( | |
findParent = layerManager.getlayer i | |
if findParent.getParent() == undefined then ( | |
appendIfUnique topLevelLayers findParent.name | |
) | |
) |
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
--Creates a tabbed panel UI for complex maxscript tools. | |
--The concept for this script came from one of the great minds over at the CGTalk forum | |
--but I cannnot for the life of me find the original post. If you find it let me know. | |
global panelOne | |
global panelTwo | |
global panelThree | |
rollout panelOne "Panel Script Template" width:350 height:230 | |
( |
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
--Creates a layer with a given name if it doesn't already exist. | |
function createLayer newLayerName = ( | |
layer = LayerManager.getLayerFromName newLayerName | |
if layer == undefined then ( | |
layer = LayerManager.newLayer() | |
layer.setname newLayerName | |
) |
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
/* | |
This snippet here was created based on specific need to *maybe* rotate the camera 90 degrees before doing some other action. | |
*/ | |
--Set some globals | |
global stopRotating = false | |
global resetAngleAmount = 0 | |
--Camera to manipulate has been added to max scene and is named | |
camName = "STUDIO_Camera" |
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
--Global Variables | |
global hwnd | |
fn checkDialogs = ( | |
hwnd = dialogMonitorOps.getWindowHandle() | |
dialogTitle = uiAccessor.getWindowText hwnd | |
print(dialogTitle) | |
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
//Exports out the 12 images that make up cube maps into the current folder. | |
//Make sure you have your export setting setup correctly in PS so no hyphens are added to your filename. | |
//Check here: http://thesetchells.com/2012/06/preventing-dashes-hyphens-photoshop-save-web/ | |
//Works on flattened images. | |
var doc = app.activeDocument; | |
var docName = doc.name.substr(0,doc.name.length-4); | |
var exportName = docName + "_split"; | |
var dir = doc.path.toString()+"/"; |
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
//This script works by runnning a specific action in a given action set. I normally make this action | |
//do nothing at all, but if it's not present on a user's computer to throw a warning. This is important when | |
//scripts rely on specific actions and you want to alert the user that they may not work correctly unless they add or update | |
//the action set. | |
actionCheckFail = false; | |
try { | |
doAction('InstallCheck', 'MySetOfActions'); | |
} catch(e) { |
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
openURL("www.google.com") | |
function openURL(url) { | |
var fname = "shortcut.url"; | |
var shortcut = new File(Folder.temp + '/' + fname); | |
shortcut.open('w'); | |
shortcut.writeln('[InternetShortcut]'); | |
shortcut.writeln('URL=' + url); | |
shortcut.writeln(); | |
shortcut.close(); |
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
//Change app units to pixels so the selection below will perform correctly | |
app.preferences.rulerUnits = Units.PIXELS; | |
//Selects a 100px by 100px rectangle. | |
selectRect(0,0,100,100) | |
function selectRect(top, left, right, bottom) | |
{ | |
app.activeDocument.selection.deselect() | |
// ======================================================= |
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
for obj in selection do ( | |
--Make sure whatever we are trying to weld is actually geometry | |
if( isKindOf obj GeometryClass ) then ( | |
print("Welding...") | |
--Checking what type of geometry it is. | |
if classOf obj == Editable_Poly then ( | |
--Put it inside a try-catch so if there are any issues with any one piece it doesn't break the script | |
try ( |
NewerOlder