Skip to content

Instantly share code, notes, and snippets.

@MineClever
MineClever / getMaterial.py
Created January 1, 2023 11:54 — forked from cecilemuller/getMaterial.py
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