# How can I display a FloatVector without it being editable by the user?

I am writing a python script that takes some user input in the operator and does a calculation. The result is three floats, which I would like to display in a nice form like FloatVector but I don’t want them to be editable. This would produce unexpected results. I passed in only a get() function to the parameter constructor to make a read-only result, but now I can’t set the values via code.

What is the ‘blender way’ of showing data to the user in a ui panel, and if there is none, how can I make this work?

You can disable the row (makes it read-only) and set emboss to False for example:

def draw(self, context):
layout = self.layout
# ...
row = layout.row()
row.prop(my_data, "my_prop", emboss=False, text="Values")
row.enabled = False


Or you can use a label:

    row = layout.row()
row.label(text="Values: {}".format("  ".join(map(str, my_data.my_prop))))


– user97005
Jun 15 '20 at 3:28
• Thanks for expanding and enhancing my answer @brockmann ;) Jun 15 '20 at 9:10

I passed in only a get() function to the parameter constructor to make a read-only result, but now I can’t set the values via code.

Confused as to why you think cannot just set the value of a read only property in the get method.

Silly example, in the main thread sets the value of _booble_gooble to (1, 2, 3) This value is used by the float property getter.

This way you have a truly read only property, not one that is being masked in the UI, but possibly available to alter in the custom properties.

import bpy
from bpy.props import FloatVectorProperty
from random import random

_booble_gooble = (random(), random(), random())

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"

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

scene = context.scene

col = layout.column()

def random_value(self):
# self is scene
return _booble_gooble

def register():