1
votes

I try to learn Maya (3d Software) API with Python, but I encounter some problems..

class Foo (node):
    def __init__ (self, arg):
        if isinstance (arg, str):
            fGlobal = OpenMaya.MGlobal()
            fGlobal.selectByName (arg , OpenMaya.MGlobal.kReplaceList)
            selected = OpenMaya.MSelectionList()
            fGlobal.getActiveSelectionList(selected);
            obj = OpenMaya.MObject()
            selected.getDependNode(0,obj)
        else :
            obj = arg

Everytime i use this class, Maya returns me a warning message.

swig/python detected a memory leak of type 'MGlobal *', no destructor found.

Does someone know what does it mean ?

1
I think it means your class doesn't have a destructor. - Waleed Khan
To be more precise it means that whilst you may have had a destructor of some sort available for real SWIG didn't know about it when generating the wrapper. - Flexo

1 Answers

0
votes

I've found the solution, it seems that the MGobal class is static.