All in just one little module, just so there's one simple and small 'interface' with the pymel module. It was fairly simple, as the patching I required was pretty limited. If I had more patching to do I'd probably try to create a more generic method for it all.
- Ofer www.mrbroken.com On Fri, Jul 2, 2010 at 1:26 AM, David Moulder <[email protected]>wrote: > I'll try to have a look at that today and get some feedback to you. > Ofer example is also interesting too. So I'll look into it as well. > Ofer, How are you wrapping PyMel then, Are you creating 1 module that > does all the monkey patching? Or have you done something more complex? > > -Dave > > On Thu, Jul 1, 2010 at 10:24 PM, Paul Molodowitch <[email protected]> > wrote: > > It sounds like factories.registerVirtualClass should do what you > > need... I guess you already saw the example, so that should explain > > how it's used. The only word of warning is that we consider it an > > 'experimental' feature - I've used it before, and it worked, but I > > haven't used it recently, or ever really tested it extensively. > > > > That said, though, we'd love for more people to try it out, and put it > > through it's paces. > > > > - Paul > > > > On Thu, Jul 1, 2010 at 9:49 AM, thirstydevil <[email protected]> > wrote: > >> Salute. > >> > >> Here at eurocom we've been debating how to design our python package > >> with development with pymel in mind. > >> > >> As we're becoming better OO python programmers we're using pymel more > >> and more. Leaving our old MEL libraries behind and slowly converting > >> or writing our pipeline in python with pymel. > >> > >> We've created our own package that use's pymel. The design of that > >> package is something that we've been debating recently in our > >> department. One of the main discussions is how to extend a pymel base > >> class without sub-classing. Because:- Where do we subclass in our > >> package design or even should we subclass? What do we do when we want > >> our subclass to always be returned by pymel? > >> > >> One of our more senior programmers has suggested a extension system > >> for pymel where by a PyNode would bind extension methods to it's > >> respective PyNode class from an extensions module. > >> > >> def isSelected(self): > >> import maya.cmds as cmds > >> return self.longName() in cmds.ls(sl=True,l=True) > >> > >> A = pCore.selected()[0] > >> meth = types.MethodType(isSelected, A, A.__class__) > >> A.isSelected = meth > >> A.isSelected() > >> > >> I like the idea and was wondering how other's have integrated PyMel > >> into their studio Libs and how they handle their package design with > >> pymel in mind. As sometime the line between our pipeline package and > >> extending pymel is blurred. Which is why the pymel extension system > >> came to mind. > >> > >> Looking at the customClasses example I was wondering if we can already > >> do this with the factories module? > >> > >> -Dave > >> > >> > >> -- > >> http://groups.google.com/group/python_inside_maya > > > > -- > > http://groups.google.com/group/python_inside_maya > > > > > > -- > David Moulder > http://www.google.com/profiles/squish3d > > -- > http://groups.google.com/group/python_inside_maya > -- http://groups.google.com/group/python_inside_maya
