I was going through the "Getting started" API documentation for 2.68 since I'm guessing 2.70 is similar. I was testing out how to create my first script in 2.70 which I would like to save values which I will need later for future computations. I am using the Blender Panel UI for the user to modify the properties. Here is the basic code I'm stuck at from the HellowWorldPanel class. I was wondering why my property field isn't showing up in the Panel. (Edit: I'm sorry just to clarify this, the panel is showing up with my "Hello world!" label but my property called "bl_mine1" isn't showing up in the newly created panel)
Here is the code I am testing it with:
import bpy class HelloWorldPanel(bpy.types.Panel): """Creates a Panel in the Object properties window""" bl_label = "Hello World Panel" bl_idname = "OBJECT_PT_hello" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "object" bl_mine1 = bpy.props.FloatProperty(name = "MyProperty") def draw(self, context): layout = self.layout obj = context.object #Create New Row with text Hello World row = layout.row() row.label(text="Hello world!", icon='WORLD_DATA') #Try showing a field box with MYProperty in it row = layout.row() row.prop(obj, "bl_mine1") def register(): bpy.utils.register_class(HelloWorldPanel) def unregister(): bpy.utils.unregister_class(HelloWorldPanel) if __name__ == "__main__": register()
Thanks for any input.