How to get a number of objects from a scene ?

Hello Everyone,

I’d like to write a script using Python to make an Add-on. I’m currently trying to cut an object with several planes at the same time. The number of planes drawn can be different from time to time. So I thought of two strategies to get the number of planes in my code.

1st: I thought I could draw a slider in my add-on panel that the user could change to indicate the numer of planes in the scene.

2st: Second option was to select only the meshes of type : Plane. and then get the names in the list

I wonder if any of these possibilities is writable.
Thank for your answers and proposals!!!:slight_smile:

There is no mesh type “Plane”, they are not parametric. A mesh can be any shape and size, and have any name.

Either way, if you want a list of objects which start with “Plane”, you could do

[ob for ob in bpy.context.scene.objects if ob.name.startswith(“Plane”)]