Help with a blendercookie tutorial

So I was following a tutorial for creating FK/IK rigs. Things are going along fine. But I got to a coding part. I’m doing that, but whenever it says to run the script to make sure things are working, they’re not. And then I ran into an error that has me confused. I’ve done everything 100% like in the video (Except for the few things I’ve changed to match what’s in my file)

This is the tutorial: http://www.blendercookie.com/2011/02/07/creating_fk_ik_rig/
I’ve gotten to about 39:08 on it.

This is the coding I have so far with it.

import bpy

class showButtons(bpy.types.Panel):
    bl_label = "Rig Layers"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    
    @classmethod
    def poll(self, context):
        if(bpy.context.active_object.type == 'ARMATURE':)
            return(True)
    
    def draw(self, context):
        layout = self.layout
        row = layout.row()
        row.label("ArmL:")
        row.prop(context.active_object.data, "layers", index=1, toggle=True, text="FK")
        row.prop(context.active_object.data, "layers", index=2, toggle=True, text="IK")
        

class showButtons(bpy.types.Panel):
    bl_label = "IK Slider"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    
    @classmethod
    def poll(self, context):
        if(bpy.context.active_object.type == 'ARMATURE':)
            return(True)
    
    def draw(self, context):
        layout = self.layout
        row = layout.row()
        row.label("LegIK.L:")
        row.prop(context.active_object.data, "['LegIK.L']", index=1, toggle=True, text="FK")

The error I get is at line ten “if(bpy.context.active_object.type == ‘ARMATURE’”
It tells me that it’s invalid syntax.

The rest of it not working I don’t know what the problem is. Do I have something spelled wrong somewhere that I’ve simply missed? Or is the tutorial out of date (which would be odd as it’s in version 2.5 as well…) or am I perhaps out of date?

I’m not sure how old the video tutorial is but there has been a few changes in the API
(but I don’t think that is your issue)

I think the : should be outside the brackets


if (bpy.context.active_object.type == 'ARMATURE'):

you have 2 classes in your script - both called “showButtons”
this could cause some problems (name them something different form each other)

and you will need to register the classes at the end of the script
(you you add a template “simple_UI panel” to the text editor you will see how to correctly register the classes at the bottom)


def register():
    bpy.utils.register_class(showButtons)
    bpy.utils.register_class(showIK)

def unregister():
    bpy.utils.unregister_class(showButtons)
    bpy.utils.unregister_class(showIK)


if __name__ == "__main__":
    register()

Eh. Just adding those and changing the names to fit what I have doesn’t work. I’ll just stick to keeping the sliders in their normal spots. Annoying and a pain in the butt, but obviously I just fail and can’t get blender to work.

post the blend