This file contains hidden or 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
| scene_svc = lx.service.Scene() | |
| sel_svc = lx.service.Selection() | |
| pkt_trans = lx.object.ItemPacketTranslation(sel_svc.Allocate(lx.symbol.sSELTYP_ITEM)) | |
| sel_type = sel_svc.LookupType(lx.symbol.sSELTYP_ITEM) | |
| for i in xrange(sel_svc.Count(sel_type)): | |
| pkt = sel_svc.ByIndex(sel_type, i) | |
| item = pkt_trans.Item(pkt) | |
| scene = item.Context() |
This file contains hidden or 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 modo | |
| # This snippet queries polygon that is under a mouse. | |
| # Querying polygon only works correctly on active meshes. | |
| # That means that if mouse is over the mesh that is not active | |
| # (was not selected prior to entering component mode), |
This file contains hidden or 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 lxu.select | |
| class ReferencedItems: | |
| def __init__(self, scene): | |
| self.mScene = lx.object.Scene(scene) | |
| self.mSceneFilename = self.mScene.Filename() | |
| self.mItems = [] | |
| def AddItem(self, item): | |
| print item |
This file contains hidden or 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 lxu | |
| import lxu.select | |
| def loadImage(filepath, width, height): | |
| ''' | |
| Loads an image as clip and returns it's image interface object. | |
| ''' | |
| if not os.path.exists(filepath): | |
| raise AttributeError("Path does not exist") |
This file contains hidden or 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 | |
| """ Get Channel Selection. | |
| There is no utility class for handling channel selection | |
| like there is for items and scenes so it has to be done manually. | |
| """ | |
| import lx | |
| selection_service = lx.service.Selection() |
This file contains hidden or 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 | |
| ''' | |
| 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 |