In my panel I have 3 buttons you can press. Each one will change the File format type to a different setting. I would like to add text above the buttons that displays "Current Selection:" and then what ever setting that is currently selected (for the File Format).

Change the Cube to what ever setting that is currently selected/active

By looking at the template I know this is possible, because you can add the name of the currently selected object.

row.label(text="Current Selection: " + obj.name)

I know the obj is related to the object in the scene but I need to know how to change it so I can display the File format type instead.

I just don't know the proper context to make it work for me.


After playing around with it, I think it would be easier just to add this:

scene = context.scene
view = scene.view_settings
row.prop(view, "view_transform")

Not only do we get the options we want but we can see which is active.

new layout

Alternatively, as brockmann has said, you can use:

layout.prop(view, "view_transform", expand=True)

which would give you this -

enter image description here

  • 1
    $\begingroup$ You can pass expand=True to get all options at once: row.prop(view, "view_transform", expand=True). $\endgroup$
    – brockmann
    Sep 19 '19 at 17:12
  • $\begingroup$ @brockman, that's helpful thanks! I will add it to the answer.. Thanks for the info.. I am not sure which I like better.. Both are good options.. $\endgroup$
    – Darkfall
    Sep 19 '19 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.