How to use template_list?

I’ve spent about three hours trying to figure out how I can get template_list to work, to no avail. I’ve tried working from the code given in this thread. I can add the collection, but I cant figure out how to fill it, or how to control what will be displayed in the list. Could someone point me to a working example? What I want to do is display a list of IK constraints or some custom objects and be able to read what the user has selected.

I create a little example hope it help.
Its not necessary to use PointerProperty for list item, but I prefer to do so especially if you have a lot data to store.

This is a cool exaple, thanks!

can you explain a little how this is working!

i can see a panel with one button but don’t see it in version 236

so where does this pane appears



i can see a panel with one button but don’t see it in version 236

Version of what? =)
Open this script in Blender 2.5 text editor and press “Run script”.
The panel will appear in Render buttons. It contains list widget and two buttons “+” and “-” to add and remove list items. When you add and select an item you will see check-button “Enabled” below the list.

working in 236 nicely !

never used that feature before
but interested to learn more here

how and where would this be used
do you have an example for using this?

i got a problem with the other little script example for template in other given link
problem with registration
any idea how to correct this little scdript to make it work
it’s very short !

Thanks and happy 2.5

RickyBlender, remove this line “bpy.types.register(OBJECT_PT_hello)” from that example, but i don’t know why you need it - it doesn’t show any list management.

do you have an example for using this?

I use it in vb25 script to manage render channels.

you remove the registration line!

ok is this a new API change
cause i think i have other older scripts that are not working may be becasue of this API change or other API’s changes!

i try to have as many examples so if i need one then i can always check back in my examples to see if i can find something usefull

because right now there are almost no good tut on 2.5
so i grab whatever comes along and keep it as reference
till we get more tut for this new API in 2.5

it’s one way to learn i guess !


Only got around to testing it now. Great example, thanks!
(edit: what’s up with “p a s t e a l l” being hidden in the link?)