Skip to content Skip to sidebar Skip to footer

Maya Python: Unbound Method Due To Reload()

I have two files that import the same object tracking method from a third file. It works something like this file TrackingMethod class Tracker(object): def __init__(se

Solution 1:

You can try importing TrackingMethods twice, with two names.

In shapes:

importTrackingMethodsas trm_shapes


classshape(trm_shapes.Tracker) ...

And in shaders:

importTrackingMethodsas trm_shaders

classshader(trm_shaders.Tracker) ...

This should work, as long as nobody outside tries to check whether a shader or shape objects are the instance of a Tracker - it will fail.

Solution 2:

You probably want to remove the reloads from your submodules and reload them in the logical order implied by the dependencies in the files:

reload(TrackingMethod)
reload(Shapes)
reload(ShaderNodes)

For a small case like this it works, but if things get more complex it's going to be hard to manage.

Post a Comment for "Maya Python: Unbound Method Due To Reload()"