Skip to content

Instantly share code, notes, and snippets.

Cecile Muller cecilemuller

View GitHub Profile
View photoshop-functions.js
/* eslint-env photoshop */
/**
* New 3D Layer from File.
* @param {String} modelFilepath Absolute path to the 3D file
*
* Examples:
* `addLayer3D('C:\\example\\scene.wrl');`
* `addLayer3D('C:\\example\\scene.dae');`
* `addLayer3D('C:\\example\\scene.obj');`
@cecilemuller
cecilemuller / getShaderId.py
Created Jan 5, 2019
Marmoset Toolbag: Get Shader ID
View getShaderId.py
# There is no easy way to identify a shader from a MaterialSubroutine,
# so this tries to guess from the list of fields.
#
# However it cannot distinguish between:
# - "Lambertian" or "Unlit"
# - "Horizon Occlusion" or "Mirror" or "Blinn-Phong"
def getShaderId(material, subroutineId):
subroutine = material.getSubroutine(subroutineId)
@cecilemuller
cecilemuller / getMaterialThumbnail.ms
Created Jan 3, 2019
Maxscript: get the Material Editor thumbnail for an arbitrary material
View getMaterialThumbnail.ms
-- Reads the 88x88 thumbnail from Material Editor for an arbitrary material.
-- Note that it renders faster when the material editor is closed,
-- so you could call `MatEditor.Close()` first.
--
-- Parameters:
-- mat: a material instance (StandardMaterial, Universal_Material, etc..)
--
-- Returns:
-- a Bitmap or `undefined`
--
@cecilemuller
cecilemuller / getMaterial.py
Last active Dec 26, 2018
Marmoset Toolbag: find material/object by name
View getMaterial.py
import mset
# Smarter "findMaterial": doesn't print a message in the console
# or throw an error when the object to find doesn't exist.
def getMaterial(name, createIfNotFound=False):
found = None
objs = mset.getAllMaterials()
for obj in objs:
if obj.name == name:
found = obj
@cecilemuller
cecilemuller / marmoset-bake-maps-properties.md
Created Dec 18, 2018
Marmoset Toolbag: Bake maps properties
View marmoset-bake-maps-properties.md

Marmoset Toolbag: Bake maps properties

Example:

import mset

baker = mset.findObject("Baker")
baker.loadPreset("All")
baker.getMap("Normals").enabled = True
@cecilemuller
cecilemuller / marmoset-material-fields.md
Last active Dec 14, 2018
Marmoset Toolbag: Shader subroutine fields
View marmoset-material-fields.md
@cecilemuller
cecilemuller / 2018-https-localhost.md
Last active Jan 31, 2019
How to create an HTTPS certificate for localhost domains
View 2018-https-localhost.md

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@cecilemuller
cecilemuller / launch.json
Created Jan 8, 2018
Run ts-node in VSCode Debugger
View launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Node Inspector",
"type": "node",
"request": "launch",
"args": ["${workspaceRoot}/src/service.ts"],
"runtimeArgs": ["-r", "ts-node/register"],
"cwd": "${workspaceRoot}",
@cecilemuller
cecilemuller / VSCode.reg
Last active Apr 24, 2018
Adds a "Open Folder in VSCode" command in Windows Explorer
View VSCode.reg
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
@="Open folder in VSCode"
"Icon"="C:\\Program Files\\Microsoft VS Code\\resources\\app\\resources\\win32\\code_file.ico"
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""
@cecilemuller
cecilemuller / wallaby.chrome.js
Last active Jan 2, 2018
Wallaby.js for Typescript
View wallaby.chrome.js
'use strict';
const wallabyWebpack = require('wallaby-webpack');
// Headless Chrome tests
module.exports = wallaby => ({
debug: true,
testFramework: 'jasmine',
files: [
{pattern: 'src/**/*.ts', load: false},
'!src/**/*.spec.ts',
You can’t perform that action at this time.