Post #5462: Thanks for checking the error!

📋 Metadata

🏷️ Tags

blender-compatibility advanced solved

  • Modal Editor

💬 Content

Thanks for checking the error!
You’re absolutely right — adding move_flag as a class variable does get rid of the error.

That said, just a small note: since this class inherits from CTU.HeadModalHandler, it’s worth taking a look at that implementation too.

In CTU.HeadModalHandler, move_flag is initialized as an instance variable inside __init__(), so at first glance it seems like everything should be fine.
Which likely means something has changed in Blender 4.4.

In cases like this, it’s a good idea to check the release notes.

Release Notes - Blender Developer Documentation

If you look under 4.4 > Python API, there’s a section called Breaking Changes — and sure enough, it outlines a new rule for how __init__ should be used to safely initialize subclasses.

Breaking Changes - Blender Developer Documentation

So yes, we do need to update the code to follow the new rules.
But in this case, instead of relying on __init__(), it might be more future-proof to move the initialization into execute() instead.

imageimage813×1153 101 KB

I haven’t had a chance to try this in 4.4 yet, so if you’re able to test it, let me know if it works!


❤️ 3 likes


🔗 View on Blender Artists