I am relatively new to coding in Blender so I am still familiarizing myself with the keywords and concepts used in bpy.
I am currently trying to create enumerators that use existing lists as their items rather than manually typing out a list of options for their "items" parameters. It seems like it should be as simple as inserting the name of the list in the portion in place of the manually added options, however, that appears to not be the case and I can't figure out what the correct phrasing would be to do so.
Can anybody help me out?
My Code:
import bpy
object_list = []
camera_list = []
light_list = []
for obj in bpy.context.scene.objects:
if obj.type == "CAMERA":
camera_list.append(obj)
if obj.type == "LIGHT":
light_list.append(obj)
if obj.type == "MESH":
object_list.append(obj)
class Enums(bpy.types.PropertyGroup):
camera_enum : bpy.props.EnumProperty(
name= "",
description= "None",
items= [("None", "None", ""), # <-- Option to select none of the items
() #<-- Insert "camera_list" here
]
)
lights_enum : bpy.props.EnumProperty(
name= "",
description= "None",
items= [("None", "None", ""), # <-- Option to select none of the items
() #<-- Insert "light_list" here
]
)
objects_enum : bpy.props.EnumProperty(
name= "",
description= "None",
items= [("None", "None", ""), # <-- Option to select none of the items
() #<-- Insert "object_list" here
]
)
```