poll() as a python '@staticmethod' was too limiting and didnt allow useful base class poll functions in many cases.
now rna functions that dont have a 'self' are automatically assumed '@classmethods'. de-duplicated poll functions and made some minor tweaks too.
This commit is contained in:
@@ -26,8 +26,8 @@ class SceneButtonsPanel():
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "scene"
|
||||
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.scene
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ class SCENE_PT_scene(SceneButtonsPanel, bpy.types.Panel):
|
||||
|
||||
|
||||
class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, bpy.types.Panel):
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
_context_path = "scene"
|
||||
|
||||
|
||||
@@ -108,8 +109,8 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, bpy.types.Panel):
|
||||
class SCENE_PT_keying_set_paths(SceneButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Active Keying Set"
|
||||
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.scene.active_keying_set and context.scene.active_keying_set.absolute)
|
||||
|
||||
def draw(self, context):
|
||||
|
||||
Reference in New Issue
Block a user