Skip to content

Instantly share code, notes, and snippets.

@Farfarer
Farfarer / resetMeshTransform.py
Created August 22, 2018 18:45
Stick this in `<user scripts folder>/lxserv` and restart Modo. You can run the command `ffr.resetMeshTransform` to reset the transforms for selected items and the normals/tangents should be transformed appropriately, too.
#!/usr/bin/env python
import lx
import lxu
import lxifc
import lxu.command
class ListVMaps(lxifc.Visitor):
def __init__(self, meshmap):
self.meshmap = meshmap
@Farfarer
Farfarer / selectGroundPolys.py
Last active August 23, 2018 00:48
Selects all polygons which face straight up and are at or below 0 in the Y axis.
#!/usr/bin/env python
import lx
import lxifc
import lxu.command
class SelectGround(lxifc.Visitor):
def __init__(self, poly, mesh):
self.poly = poly
self.mesh = mesh
@Farfarer
Farfarer / averageRGBA.py
Created February 6, 2017 17:38
Average the selected RGBA vertex maps across each selected polygon.
#!/usr/bin/env python
import lx
import lxifc
import lxu.command
class ListMaps (lxifc.Visitor):
def __init__ (self, meshmap):
self.meshmap = meshmap
self.mapIDs = []
@Farfarer
Farfarer / createBBOX.py
Created July 13, 2016 08:46
AABB and AACyl creation for MODO.
#!/usr/bin/env python
# Uses Smallest Enclosing Circle code which is:
# Copyright (c) 2014 Nayuki Minase
# http://nayuki.eigenstate.org/page/smallest-enclosing-circle
import lx
import lxifc
import lxu.command
import lxu.select
@mrkline
mrkline / c_sharp_for_python.md
Last active July 21, 2024 08:51
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,