This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python | |
import lx | |
import lxu.command | |
my_hint = ( (0, 'zero' ), | |
(1, 'one' ), | |
(-1, 'minusone' ),) | |
class TextValueHint_Cmd(lxu.command.BasicCommand): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import modo | |
item = modo.Scene().selected[0] | |
chanCount = item.internalItem.ChannelCount() | |
chanList = [] | |
for i in xrange(chanCount - 1, -1, -1): | |
try: | |
package = item.internalItem.ChannelPackage(i) | |
except LookupError: | |
lx.out(item.internalItem.ChannelName(i)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python | |
""" Short snippet demonstrating how you can edit scene item's name using MODO 701 Python API. | |
""" | |
import lx | |
import lxu.select | |
PREFIX = 'prefix_' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This snippet demonstrates two of the ways to obtain item's inverted world transform matrix. | |
*/ | |
// --- METHOD 1 | |
CLxUser_Scene scene; | |
item.Context (scene); | |
CLxUser_ChannelRead chanRead; | |
CLxUser_SelectionService selSvc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python | |
""" Match Item Transforms. | |
Command matches transforms of one item to another. | |
Select 2 or more items and all items will be matched to last selected one. | |
I'm not author of this command. | |
This is python translation of Matt Cox's matchXfrm.cpp C++ equivalent | |
and was done as an exercise while learning MODO python API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import modo | |
item = modo.Scene().selected[0] | |
cmdSvc = lx.service.Command() | |
cmd = cmdSvc.Spawn(lx.symbol.iCTAG_NULL, 'texture.reference') | |
attr = lx.object.Attributes(cmd) | |
val = attr.Value(attr.Lookup("item"), True) | |
valRef = lx.object.ValueReference(val) | |
valRef.SetObject(item) | |
cmd.Execute(lx.symbol.fCMD_EXEC_DEFAULT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python | |
""" Aim Item Command. | |
Command sets one item (source item) rotation so that it | |
points at another item (target item) with an upvector defined | |
by third item (up vector item). | |
Command essentially replicates what Direction Constraint does. | |
Only it just applies rotation to the source item only at a current frame and action. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python | |
""" Custom item drawing a shape. | |
---------------------------- | |
Implements a custom item that draws a simple shape in viewport. | |
The item is of Locator supertype. | |
""" | |
import lx | |
import lxifc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python | |
''' | |
List Item Transforms | |
-------------------- | |
Plugin implements item.listXfrm command that lists | |
all selected item's transforms in Event Log | |
''' |