How to add a boolean property class to a panel in Blender 2.8

Hey BlenderArtists!

This question is for Blender 2.8.

I am trying to figure out how to create a boolean and float property classes that I can add as a check-boxes or number values to a panel I’ve created with a script.

I used to create a new property class like shown below in Blender 2.79. But this no longer works for Blender 2.8.

class MySettings(PropertyGroup):

#checkbox bool property for smoke particles
my_bool = BoolProperty(
    name="Enable or Disable",
    description="Smoke Particles",
    default = False

Then I would add the checkbox to my code using the following lines in a added panel.

    layout = self.layout
    scene = context.scene
    self.layout.prop(scene.my_tool, "my_bool")

I don’t know what’s not working but it does with this.

import bpy

class My_settings(bpy.types.PropertyGroup):
    my_float: bpy.props.FloatProperty(

    my_bool: bpy.props.BoolProperty(

class TEST_PT_panel(bpy.types.Panel):
    """A testing Panel"""
    bl_label = "Test panel"
    bl_idname = "TEST_PT_panel"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = "Test"

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

        layout.label(text="Test label")

        row = layout.row()
        row.prop(my_tool, "my_bool")
        row = layout.row()
        row.prop(my_tool, "my_float")
classes = (

def register():
    for cls in classes:
    bpy.types.Scene.my_tool = bpy.props.PointerProperty(type=My_settings)

def unregister():
    del bpy.types.Scene.my_tool
    for cls in reversed(classes):

if __name__ == "__main__":

Thank you Elreenys! Reverse engineering your code worked for me. The colon instead of the equals sign as well as different class registry that you have shown work for me. Not sure why though. Thanks again!

You should read this page before porting code to 2.8x