that error should only occur when something tries to operate on one of those PyNodes. so in the relevant code, you could add a .exists() check before doing so. additionally, you could look into MSceneMessage, which provides more fine grained control over scene callbacks, like kBeforeOpen and kAfterOpen.
-chad On Thu, Jun 28, 2012 at 12:12 PM, hapgilmore <[email protected]> wrote: > I have a class that tracks and manages certain nodes in a scene. When the > scene is unloaded, all of the PyNodes that were being tracked become > invalid, and pymel prints a warning for every one: > # Warning: pymel.core.nodetypes : object foo no longer exists # > # Warning: pymel.core.nodetypes : object foo1 no longer exists # > # Warning: pymel.core.nodetypes : object foo2 no longer exists # > > The problem is this list can be a thousand nodes long, so every time I > close a file, maya takes 10 seconds to print all the warnings. > The 'deleteAll' event for scriptJobs is triggered too late for me to clean > up the PyNodes before the maya nodes are deleted. > > Is there another way to trigger a cleanup before the scene is unloaded? Or > at a minimum suppress the # Warning spew? > > -- > view archives: http://groups.google.com/group/python_inside_maya > change your subscription settings: > http://groups.google.com/group/python_inside_maya/subscribe > -- view archives: http://groups.google.com/group/python_inside_maya change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
