Browse Source

Fix noisy tracebacks when not in Korman mode

Blender used to not specify COMPAT_ENGINES on the physics panels. It
does now, and the new poll methods are incompatible with ours. This
results in lots of noisy errors being raised when in Blender Render mode
with the Korman addon active.
pull/123/head
Adam Johnson 6 years ago
parent
commit
734eb58819
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 21
      korman/render.py

21
korman/render.py

@ -65,24 +65,3 @@ del properties_render
from bl_ui import properties_texture
_whitelist_all(properties_texture)
del properties_texture
@classmethod
def _new_poll(cls, context):
"""Nifty replacement for naughty built-in Blender poll()s"""
if context.scene.render.engine == "PLASMA_GAME":
return False
else:
# Dear god you better save the old poll...
return cls._old_poll(cls, context)
def _swap_poll(cls):
cls._old_poll = cls.poll
cls.poll = _new_poll
# This is where we claim the physics context for our own nefarious purposes...
# Hmm... Physics panels don't respect the supported engine thing.
# Metaprogramming to the rescue!
from bl_ui import properties_physics_common
_swap_poll(properties_physics_common.PhysicButtonsPanel)
del properties_physics_common

Loading…
Cancel
Save