Skip to content

Instantly share code, notes, and snippets.

View cecilemuller's full-sized avatar

Cecile Muller cecilemuller

View GitHub Profile
@cecilemuller
cecilemuller / cubemap.bat
Created May 1, 2019 11:32
Generate a DDS cubemap from 6 JPEG images
texassemble cube -w 1024 -h 1024 -o cubemap.dds px.jpg nx.jpg py.jpg ny.jpg pz.jpg nz.jpg
texconv cubemap.dds -m 0 -y -f BC1_UNORM
@cecilemuller
cecilemuller / activeshade.ms
Last active February 6, 2020 13:24
Maxscript: ActiveShade
-- Open activeshade floater
actionMan.executeAction 0 "40701"
-- Close activeshade floater
-- https://help.autodesk.com/view/3DSMAX/2016/ENU/?guid=__files_GUID_DF068975_00B6_4CF9_B240_50B032C1B960_htm
CloseActiveShade()
-- Close activeshade floater (old version)
-- local children = UIAccessor.GetPopupDialogs()
-- for child in children do (
@cecilemuller
cecilemuller / photoshop-functions.js
Created April 6, 2019 16:53
Photoshop Scripting
/* 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 January 5, 2019 10:23
Marmoset Toolbag: Get Shader ID
# 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 January 3, 2019 14:35
Maxscript: get the Material Editor thumbnail for an arbitrary material
-- 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 January 1, 2023 11:54
Marmoset Toolbag: find material/object by name
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 December 18, 2018 15:53
Marmoset Toolbag: Bake maps properties

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 January 2, 2022 04:08
Marmoset Toolbag: Shader subroutine fields
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active May 23, 2024 16:23
How to create an HTTPS certificate for localhost domains

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
Last active May 16, 2024 16:38
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Example",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],