Skip to content

Instantly share code, notes, and snippets.

@nicelifeBS
nicelifeBS / ListSelSets.py
Created April 1, 2014 23:29
modo - pyAPI test. Returns a list of all selection sets of a selected meshItem. First two methods are old python scripting (the second uses the lx.Service for query). The third method is pyAPI
#!/usr/bin/env python
import time
import lx
import lxu.select
def output(command):
'''introspect methods and classes'''
lx.out('$$$$$$$$$ dir $$$$$$$$')
@lukpazera
lukpazera / item_selection_filter.py
Last active March 10, 2021 19:56
Simple example of filtering item selection to group items only.
# python
""" Snippet demonstrates how to filter item selection out so it contains
only items of required type (group items in this case).
Filtered items are printed out in Event Log.
"""
import lx
import lxu.select
@tcrowson
tcrowson / modo_getItemsOfType.py
Last active August 29, 2015 13:59
Function that returns all items in the scene of the specified type(s) as a list of Python objects.
# python
'''
This function searches the current Modo scene and returns all items of
the specified type as a list of Python objects.
The function takes one or more arguments as strings or integers, which are the types of items you're after.
To ensure forward compatibility we'll use the symbol for the item type we need.
To see the full list of item type symbols, visit the following URL:
@nathanielanozie
nathanielanozie / camNode.py
Created October 5, 2014 04:30
camera custom node (maya plugin)
##@file camNode.py
#
#Track start and end frames and a transform in Maya(Tested Maya 2008)
#
#@author Nathaniel Anozie
#
#
#@note Inspired by Maya's api tutorials and examples on sineNode.py and lambertShader.cpp
#
##
@Regnareb
Regnareb / evalDeferred.py
Last active September 24, 2018 19:29
Disconnect at particle creation with evalDeferred
import maya.cmds as cmds
emetteur = cmds.emitter(type='surface', rate=10, scaleRateByObjectSize=False, needParentUV=True,
cycleEmission='none', speed=1, speedRandom=0, normalSpeed=1, tangentSpeed=0,
maxDistance=0, minDistance=0, dx=1, dy=0, dz=0, spread=0)
particules = cmds.nParticle()
cmds.evalDeferred(lambda: cmds.disconnectAttr(particules[1] + ".internalOpacityRamp", particules[1] + ".opacityPP"), lowestPriority=True)
# Meme chose que la ligne precedente mais passe par une string au lieu d'un lambda.
# cmds.evalDeferred('cmds.disconnectAttr("{}.internalOpacityRamp","{}.opacityPP")'.format(particules[1], particules[1]), lowestPriority=True)
@dschep
dschep / raspbian-python3.6.rst
Last active October 24, 2023 14:57 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).