How to make add-on work with Blender 2.8

There are some vague things to create an add-on to Blender 2.8.
I can now figure out the following issues
・Item is not displayed in template_list
・Acquisition of operation history does not go well
reports =
[
bpy.data.texts.remove(t, do_unlink=True)
for t in bpy.data.texts
if t.name.startswith(“Recent Reports”)
]
# make a report
bpy.ops.ui.reports_to_textblock()
return bpy.data.texts[“Recent Reports”].lines

I need a way to solve these two things

Download Link:

Without more context (i.e. your code and or what you are trying to accomplish) it is nearly impossible to give a useful answer to your problems. However, I will give a few tips based on what I think you are trying to do.

There are many templates inside Blender’s text editor accessible from the menubar. Maybe look at those for the template_list.

What are you trying to attempt with the reports_to_textblock() call? Are you trying to get a list of all the recent operations into a list in your addon? To access each individual line you could loop over whatever bpy.data.texts[“Recent Reports”].lines returns and do something each line’s body

for line in lines:
    some_function(line.body) # Use line.body to access the text

Hope some of that helps! :slight_smile: Like I said above, more detailed questions will get more detailed responses.

We listed download link

I will try it. Thank you very much.

Thank you for posting your code. I was trying to do something similar once I found out that the bpy.ops.ui.reports_to_textblock function was removed in Blender 2.8. But you already did all the hard work recreating the functionality. It is very much appreciated!

ありがとう

The latest version of 2.83 is now available
Caution.
There may be a bug.
Report a bug if you’d like.