How to display properties when selected from enum I am trying to create a UI panel. As a part of this when an option is chosen from enum, the corresponding properties should be displayed in the panel. I have the following code so far. so with the selection of "flash" from enum. the properties like "flash distance" are to be displayed. Could anyone please guide on this...

def initSceneProperties(scn):
    bpy.types.Scene.MyInt = IntProperty(
        name = "Integer", 
        description = "Enter an integer")
    scn['MyInt'] = 17

    bpy.types.Scene.MyFloat = FloatProperty(
        name = "Float", 
        description = "Enter a float",
        default = 33.33,
        min = -100,
        max = 100)

    bpy.types.Scene.MyEnum = EnumProperty(
        items = [('Eine', 'Flash', 'One'), 
                 ('Zwei', 'Fountain', 'Two'),
                 ('Drei', 'Split', 'Three')],
        name = "Manuevers")
    scn['MyEnum'] = 2

    return

initSceneProperties(bpy.context.scene)

#
#    Menu in UI region
#

class UIPanel(bpy.types.Panel):
    bl_label = "Property panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):
        layout = self.layout
        scn = context.scene
        layout.prop(scn, 'MyInt', icon='BLENDER', toggle=True)
        layout.prop(scn, 'MyFloat')

        layout.prop(scn, 'MyEnum')
        row = layout.row()
        row.enabled = False

        layout.operator("idname_must.be_all_lowercase_and_contain_one_dot")

#
#    The button prints the values of the properites in the console.
#

class OBJECT_OT_PrintPropsButton(bpy.types.Operator):
    bl_idname = "idname_must.be_all_lowercase_and_contain_one_dot"
    bl_label = "Print props"

    def execute(self, context):
        scn = context.scene

        printProp("Int:    ", 'MyInt', scn)
        printProp("Float:  ", 'MyFloat', scn)
        printProp("Enum:   ", 'MyEnum', scn)


        return{'FINISHED'}    

def printProp(label, key, scn):
    try:
        val = scn[key]
    except:
        val = 'Undefined'
    print("%s %s" % (key, val))



bpy.utils.register_module(__name__)
Include an if-then statement in your draw function, like this:

import bpy
from bpy.props import IntProperty, FloatProperty, EnumProperty


def initSceneProperties(scn):
    bpy.types.Scene.MyInt = IntProperty(
        name = "Integer", 
        description = "Enter an integer")
    scn['MyInt'] = 17

    bpy.types.Scene.MyFloat = FloatProperty(
        name = "Float", 
        description = "Enter a float",
        default = 33.33,
        min = -100,
        max = 100)

    bpy.types.Scene.MyEnum = EnumProperty(
        items = [('Eine', 'Flash', 'One'), 
                 ('Zwei', 'Fountain', 'Two'),
                 ('Drei', 'Split', 'Three')],
        name = "Manuevers")
    scn['MyEnum'] = 2

    bpy.types.Scene.FlashDistance = FloatProperty(
        name="Flash Distance",
        min=1.0,
        default=1.0)

    return

initSceneProperties(bpy.context.scene)

#
#    Menu in UI region
#

class UIPanel(bpy.types.Panel):
    bl_label = "Property panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):
        layout = self.layout
        scn = context.scene

        layout.prop(scn, 'MyInt', icon='BLENDER', toggle=True)
        layout.prop(scn, 'MyFloat')

        layout.prop(scn, 'MyEnum')
        row = layout.row()
        row.enabled = False

        if scn.MyEnum == "Eine":
            layout.prop(scn, 'FlashDistance')

        layout.operator("idname_must.be_all_lowercase_and_contain_one_dot")

#
#    The button prints the values of the properites in the console.
#

class OBJECT_OT_PrintPropsButton(bpy.types.Operator):
    bl_idname = "idname_must.be_all_lowercase_and_contain_one_dot"
    bl_label = "Print props"

    def execute(self, context):
        scn = context.scene

        printProp("Int:    ", 'MyInt', scn)
        printProp("Float:  ", 'MyFloat', scn)
        printProp("Enum:   ", 'MyEnum', scn)


        return{'FINISHED'}    

def printProp(label, key, scn):
    try:
        val = scn[key]
    except:
        val = 'Undefined'
    print("%s %s" % (key, val))



bpy.utils.register_module(__name__)