Skip to content

Instantly share code, notes, and snippets.

bl_info = {
"name": "FreeCAD Importer",
"category": "Import-Export",
"author": "Yorik van Havre",
"version": (5, 0, 0),
"blender": (2, 80, 0),
"location": "File > Import > FreeCAD",
"description": "Imports a .FCStd file from FreeCAD",
"warning": "This addon needs FreeCAD installed on your system. Only Part- and Mesh-based objects supported at the moment.",
}
@Farfarer
Farfarer / islandCount.py
Created January 2, 2018 19:34
Command to tell you the number of polygon islands in the active mesh(es). Queryable in script via islandCount = lx.eval1('ffr.islandCount ?')
#!/usr/bin/env python
import lx
import lxu.command
import lxifc
class SetMarks (lxifc.Visitor):
def __init__ (self, acc, mark):
self.acc = acc
self.mark = mark
@Farfarer
Farfarer / selectByColor.py
Created October 30, 2017 11:48
Select vertices by vertex color.
#!/usr/bin/env python
import lx
import lxifc
import lxu.command
class SelectByColor_Vis(lxifc.Visitor):
def __init__(self, mesh, point, vmapID, rgb, selMode, sel_svc, vtx_pkt_trans, sel_type_vert):
self.mesh = mesh
self.point = point
@tcrowson
tcrowson / morphToMesh.py
Last active April 11, 2018 20:56
Modo 901 command for freezing a morph to a new mesh.
# Command for freezing a morph to a new mesh.
# 1. Select a morph map
# 2. run morph.freezeToMesh
# 3. A new mesh bearing the name of the morph map will be created, with the frozen morph shape in it.
import lx
import lxu
import lxifc
import modo
@ivogrig
ivogrig / Monitor example
Created June 23, 2015 09:26
Modo Monitor example
import time
import lx
dialog_svc = lx.service.StdDialog()
# Allocate monitor
mon = lx.object.Monitor(dialog_svc.MonitorAllocate('Calculating Center Of Mass ...'))
steps = 50
@ivogrig
ivogrig / CmdSetMeshInstance.py
Created June 10, 2015 14:08
Sets a new source mesh to a mesh instance, by manipulating the 'meshInst' and 'source' graphs.
################################################################################
#
# SetMeshInstance.py
#
# Version: 0.1
#
# Author: Ivo Grigull
#
# Last Update: 10/06/2015
#
#!/usr/bin/env python
# To install this plugin, simply copy this file (selectAxisUVs.py) into folder called "lxserv" in your modo scripts folder (and restart modo, if it's open).
# If you are unsure where your modo scripts folder is, you can open modo, then select System > Open User Scripts Folder.
# If there is no folder called "lxserv" in your MODO Scripts folder, simply create one and then put this file in there.
# Once MODO has been restarted, you can run the command via ffr.selectaxisuv
#
# Any issues, please drop me a line at jamesohare@gmail.com.
#
# James O'Hare