Skip to content

Instantly share code, notes, and snippets.

View Arahnoid's full-sized avatar

Igor Grinchesku Arahnoid

  • Chernivtsi, Ukraine
View GitHub Profile
@Arahnoid
Arahnoid / changeColorMode.js
Last active February 11, 2022 22:34
[Change document color mode] Change color mode of document in photoshop #Photoshop
// change color mode of document in photoshop
// http://ps-scripts.com/bb/viewtopic.php?f=9&t=3158&start=0
var doc = activeDocument;
var ext= doc.name.toLowerCase().match(/[^\.]+$/);
if(doc.mode !=DocumentMode.CMYK && ext == "tif"){
doc.changeMode(ChangeMode.CMYK);
# Generate Txt File With Directory Tree
http://superuser.com/questions/258287/how-can-i-export-a-directory-structure
Assuming your directory tree is of reasonable size, you could also use the built in tree command, which produces a rather pretty looking directory tree. Unfortunately this prettiness is difficult to get working outside of a cmd instance, so you'll probably want to tell it to just use ascii characters with the /A switch.
### Example:
From a small multi-level structure
/*******************************************************************************
1. DEPENDENCIES
*******************************************************************************/
var gulp = require('gulp'); // gulp core
sass = require('gulp-sass'), // sass compiler
uglify = require('gulp-uglify'), // uglifies the js
jshint = require('gulp-jshint'), // check if js is ok
rename = require("gulp-rename"); // rename files
concat = require('gulp-concat'), // concatinate js
@Arahnoid
Arahnoid / raterizeLayerStyle
Last active August 29, 2015 14:16
raterizeLayerStyle PS Function
raterizeLayerStyle = ->
idrasterizeLayer = stringIDToTypeID('rasterizeLayer')
desc = new ActionDescriptor
idnull = charIDToTypeID('null')
ref = new ActionReference
idLyr = charIDToTypeID('Lyr ')
idOrdn = charIDToTypeID('Ordn')
idTrgt = charIDToTypeID('Trgt')
ref.putEnumerated idLyr, idOrdn, idTrgt
desc.putReference idnull, ref
@Arahnoid
Arahnoid / ColorConvertFunctions.ms
Last active April 21, 2019 23:23
3D Max Color convert functions #3dmax
/**
* 3D Max
* COLOR CONVERT FUNCTIONS
* Source: http://www.emoticode.net/maxscript/color-convert-functions.html
*/
--CONVERT RGB (0-255) TO HEXSTRING
fn RGBtoHEX clrRGB = (bit.intAsHex clrRGB.r)+(bit.intAsHex clrRGB.g)+(bit.intAsHex clrRGB.b)
RGBtoHEX (color 80 170 178)
-->"50aab2"
@Arahnoid
Arahnoid / material-display-togle.max
Last active April 21, 2019 23:16
[Togle material in viewport] #3dmax
-- by Denis Trofimov
-- http://forums.cgsociety.org/showthread.php?f=98&t=1316990&page=2
macroScript MaterialDisplayToggle
category:"Display"
toolTip:"Viewport Material Display Toggle"
buttontext:"Mat Toggle"
autoUndoEnabled:off
(
-- Randomly jiggle elements within an object
-- http://forums.cgsociety.org/archive/index.php?t-1030430.html
-- (c) 2012 Created by 3ak (Alexander Loboda)
obj = $
jitter = 2.0
numfaces = polyop.getnumfaces obj
allfacearr = #{1..numfaces}
for i = 1 to numfaces do
@Arahnoid
Arahnoid / DrawShape.js
Created November 4, 2015 18:03 — forked from vladocar/DrawShape.js
Draw Shape in Photoshop with JavaScript
/* Code by Mike Hale http://www.ps-scripts.com/bb/viewtopic.php?f=14&t=1802&start=15
with small modification by Vladimir Carrer
*/
function DrawShape() {
var doc = app.activeDocument;
var y = arguments.length;
var i = 0;
@Arahnoid
Arahnoid / ps-export-layers-to-png.jsx
Last active April 21, 2019 23:20 — forked from tomekc/ps-export-layers-to-png.jsx
[Export .png layers] Photoshop script that exports to PNG all layers and groups whose names end with ".png". #Photoshop
#target photoshop
// $.level = 2;
/*
* Script by Tomek Cejner (tomek (at) japko dot info)
* based on work of Damien van Holten:
* http://www.damienvanholten.com/blog/export-groups-to-files-photoshop/
*
* My version adds support of nested layer groups,
* and exports single layers in addition to groups.
@Arahnoid
Arahnoid / LayersToSpriteSheet.js
Created November 5, 2015 19:40 — forked from ChrisAntaki/LayersToSpriteSheet.js
Photoshop: Layers To Sprite Sheet
// Notes:
// 1. Save this file in Program Files\Adobe\Photoshop\Presets\Scripts\
// 2. Run the script by going to menu File > Scripts > LayersToSpriteSheet
// Based on http://alessandroituarte.com/blag/2012/07/03/470
if (documents.length > 0) {
// Adjust this to the number of columns you want
// leave -1 if you want it to calculate an optimal column value.