I'm a 3d artist trying to understand Python for Blender and develop a buttons plugin for the n-menu. I'm trying to understand a line in the code below, I adapted it so it shows only the interesting parts.
import bpy
class BakeTool_Settings(bpy.types.PropertyGroup):
profile_type_enum =[ ("EASY","Easy","",1),
("EXPERT","Expert","",2)]
profile_type : bpy.props.EnumProperty(name="PassMode",default = "EASY", items = profile_type_enum,description="Select the Pass Bake Mode")
class BakeTool_JobSettings(bpy.types.PropertyGroup):
name : bpy.props.StringProperty()
enabled : bpy.props.BoolProperty(default = True)
job_settings : bpy.props.PointerProperty(type=BakeTool_Settings)
class BakeTool_Jobs(bpy.types.PropertyGroup):
Jobs : bpy.props.CollectionProperty(type=BakeTool_JobSettings)
index : bpy.props.IntProperty()
Job = bpy.context.scene.BakeTool_Jobs
ActiveJob = Job.Jobs[Job.index]
def register():
bpy.utils.register_class(BakeTool_Settings)
bpy.utils.register_class(BakeTool_JobSettings)
bpy.utils.register_class(BakeTool_Jobs)
def unregister():
bpy.utils.unregister_class(BakeTool_Settings)
bpy.utils.unregister_class(BakeTool_JobSettings)
bpy.utils.unregister_class(BakeTool_Jobs)
if __name__ == "__main__":
register()
It's further on used to draw a panel row:
layout.prop(ActiveJob.job_settings,"profile_type", text="Setup Mode",toggle = True, icon = "LIGHT",expand=True)
The thing I wanted to know is what is the 'ActiveJob = Job.Jobs[Job.index]' poiting to? In my perception the bracketed content is a synonym of 'bpy.props.IntProperty()' but I don't understand what is it doing. Thanks!