I want to select a item from UILayout.template_list from script, not from user interaction. I use following setup:

layout.template_list("UI_UL_list", "objects", scene.objectNames, "objects", scene.objectNames, "activeIndex", rows = 1, maxrows=2)

I would like to change the active index from script. When I try to do that inside panel's draw-function, I get error:

AttributeError: Writing to ID classes in this context is not allowed: Scene, Scene datablock, error setting activeIndex


Your Answer

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

Browse other questions tagged or ask your own question.