2

Trying to run a script that works fine in maya 2018 but wont in 2022

import gw_anim_clip reload(gw_anim_clip) gw_anim_clip.anim_clip_ui() 

I'm getting this error:

Error: name 'reload' is not defined Traceback (most recent call last): File "<maya console>", line 2, in <module> NameError: name 'reload' is not defined # 
2
  • This looks a lot like a python2.7 to python3 problem. You can try to use ` from importlib import reload` if you are working with pyton3. Commented May 23, 2022 at 15:11
  • thanks where should i add that sorry inexperienced with python just trying to get my maya scripts to work? Commented May 24, 2022 at 13:43

2 Answers 2

1

reload is not available in python 3.9 and maya 2022 already in 3.9. So you have to use importlib.reload to reload a module.

import importlib import gw_anim_clip importlib.reload(gw_anim_clip) gw_anim_clip.anim_clip_ui() 
Sign up to request clarification or add additional context in comments.

Comments

1

Maya 2022 use python 3.7 and you need to import reload first.

from imp import reload import gw_anim_clip reload(gw_anim_clip) gw_anim_clip.anim_clip_ui() 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.