Is there a generic custom data layer? Is there such a thing as a generic custom data layer in Blender that holds Strings, Booleans, and Enums? I'm trying to create a text box in edit mode that holds a user input note on a given mesh. Unfortunately, it seems that the note doesn't stay with the given mesh. When another mesh is in edit mode, the same note from the previous mesh is there.
Is there another way to do this other than a custom layer? Is this because the text is registered?

import bpy
from bpy.props import *
import bmesh

# ---
# String Properties
# ---

def initSceneProperties():

    bpy.types.Scene.StringType1 = StringProperty(
        name = "String1")

# ---
# Layout
# ---

class LayoutPanel(bpy.types.Panel):
    bl_label = "Test Text"
    bl_space_type = "VIEW_3D"
    bl_region_type = "TOOLS"
    bl_context = "mesh_edit"


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

        row = layout.row(align=True)
        col = row.column()
        col.prop(scn, 'StringType1', text="")

# ---
# Registers
# ---

def register():
    bpy.utils.register_module(__name__)


    initSceneProperties()


def unregister():

    bpy.utils.unregister_module(__name__)


if __name__ == "__main__":
    register()


D. Skarn, I came up with something like this as far as to how it should operate. If you start Blender fresh, run the script and add a cube (named "Cube"), then add text to the text box, it will hold that data. If you create a second item (Cube), put it into edit mode, the text box will be blank and text can be entered. You can switch between both items and each object will hold it's text data. I just don't know how to make it so that it is more elegant and doesn't require actually naming the object explicitly. So I guess somehow detecting a new object and instancing the property data? Will property groups do that?

import bpy
from bpy.props import *

# ---
# String Properties
# ---

def initSceneProperties():
    bpy.types.Scene.naming = StringProperty(name = "String1")
    bpy.types.Scene.naming1 = StringProperty(name = "String1")

# ---
# Layout
# ---

class LayoutPanel(bpy.types.Panel):
    bl_label = "Test Text"
    bl_space_type = "VIEW_3D"
    bl_region_type = "TOOLS"
    bl_context = "mesh_edit"

    def draw(self, context):            
        scn = bpy.context.scene
        layout = self.layout
        obj = bpy.context.edit_object
        objectOut = obj.name

        row = layout.row(align=True)
        col = row.column()
        if (objectOut == "Cube"):
            col.prop(scn, 'naming', text="")
            print(scn.naming)
        else:    
            col.prop(scn, 'naming1', text="")
            print(scn.naming1)
# ---
# Registers
# ---

def register():
    bpy.utils.register_module(__name__)

    initSceneProperties()

def unregister():

    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()
Here is a little panel I took from my project. As far as I understood, that's what you need.

class WowWMOGroupPanel(bpy.types.Panel):
    bl_space_type = "PROPERTIES" # This defines where our panel should appear
    bl_region_type = "WINDOW"
    bl_context = "object" # This defines the mode in which it appears. In our case, it is object. However, could be "edit" or any other mode.and
    bl_label = "Wow WMO group" # Label and property ID name
    bl_options = {'DEFAULT_CLOSED'}

    def draw_header(self, context):
        layout = self.layout
        self.layout.prop(context.object.WowWMOGroup, "Enabled") # This makes the panel toggleable.

    def draw(self, context):
        layout = self.layout
        row = layout.row()
        self.layout.prop(context.object.WowWMOGroup, "GroupName") # This is our text input property

        layout.enabled = context.object.WowWMOGroup.Enabled # Enables everything in layout if checkbox is enabled

    @classmethod
    def poll(cls, context):
        # check if it is object and mesh
        return (context.object is not None and context.object.data is not None and isinstance(context.object.data,bpy.types.Mesh)) 



class WowWMOGroupPropertyGroup(bpy.types.PropertyGroup):
    Enabled = bpy.props.BoolProperty(name="", description="Enable wow WMO group properties")
    GroupName = bpy.props.StringProperty() # our string input!

def RegisterWowWMOGroupProperties():
    bpy.types.Object.WowWMOGroup = bpy.props.PointerProperty(type=WowWMOGroupPropertyGroup)

def UnregisterWowWMOGroupProperties():
    bpy.types.Object.WowWMOGroup = None

# After doing this you can adress your property as bpy.context.scene.objects[some_id_or_name].WowWMOGroup.GroupName