I seem to have trouble finding a tutorial o n user input field. I can only find tutorials on strings and what my objective is to have a simple user input his budget (a float with 2 decimal places not 6) and once he presses enter it would store the float to be used. Sorry if im retarded but its driving me crazy.
It’s pretty simple:
import bpy
class HelloWorldPanel(bpy.types.Panel):
"""Creates a Panel in the Scene properties tab"""
bl_label = "Hello World Panel"
bl_idname = "SCENE_PT_hello"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "scene"
def draw(self, context):
layout = self.layout
sce = context.scene
layout.prop(sce, "budget")
def register():
bpy.utils.register_class(HelloWorldPanel)
bpy.types.Scene.budget = bpy.props.FloatProperty(min=0.0, precision=2)
def unregister():
bpy.utils.unregister_class(HelloWorldPanel)
del bpy.types.Scene.budget
if __name__ == "__main__":
register()