Skip to content

Instantly share code, notes, and snippets.

@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
@lukpazera
lukpazera / item_add_name_prefix.py
Last active June 9, 2018 15:58
Very simple script that renames selected items by adding a string prefix to each item's current name.
# python
""" Short snippet demonstrating how you can edit scene item's name using MODO 701 Python API.
"""
import lx
import lxu.select
PREFIX = 'prefix_'
@mattcox
mattcox / shapeDraw.py
Last active April 16, 2020 08:08
Python example demonstrating how to modify GL drawing of an item.
#python
'''
Shape Draw python example. This python plugins demonstrates how to create
a Package that can be added to existing items, that controls how they draw
in the GL viewport. We will simply draw a circle. A radius channel and an
sides channel will control how the circle is drawn.
To use, add the python script to an lxserv folder in your scripts directory.
Select an locator item and enter: item.addPackage shape.draw. To remove the