Hello, i’m trying to make a script to set the Pass Index Number of all selected objects, but i dont know how to make blender get all selected objects and then set the pass index, i made the script to show up on Object Menu of the 3D View, like so:
import bpy
class SetPassIndex(bpy.types.Operator):
“”“Set Pass Index”""
bl_idname = “object.passindex_set”
bl_label = “Set Pass Index”
def execute (code where the actual pass index is set to all selected objects)
def add_object_button(self, context):
self.layout.operator(
SetPassIndex.bl_idname,
text=SetPassIndex.doc,
icon=‘PLUGIN’)
def register():
bpy.utils.register_class(SetPassIndex)
bpy.types.VIEW3D_MT_object.append(add_object_button)
if name == “main”:
register()
I want to make a small window that pops up when selecting this item on the Object Menu, with two arrows that allows the user to select a specific number to set.
I dont know if everything is correct, but, any help apreciated. Thanks in advance.