taniwha / io_object_mu

Python .mu reader/writer and blender import/export addon
GNU General Public License v2.0
122 stars 51 forks source link

Fix menu entries not appearing after reloading scripts in Blender #18

Closed ZNixian closed 5 years ago

ZNixian commented 5 years ago

Hello,

On the current HEAD, if you try to reload scripts from inside Blender (search->Reload Scripts), only the io_object_mu module gets reloaded, register_submodules only gets called once, and most stuff doesn't get registered.

(while I haven't tested it, the same problem likely also occurs when disabling and reenabling the addon in Blender's preferences)

This PR reloads all the addon's modules during a reload, which solves the problem.

taniwha commented 5 years ago

Wow, thank you. I had long ago (many years) given up on getting that to work.

ZNixian commented 5 years ago

No problem at all.

On further testing I have found that some files (those only used by regular imports and not register_submodules) don't get reloaded, which I'm currently working on fixing.

All the UI stuff does get reloaded though.