0
$\begingroup$

I wat to make a script that will, for every mesh in the scene, set a different object pass index so I don't have to select every mesh in my scene to assign a different number. I know this is possible via scripting, but I have no idea how to go about it.

$\endgroup$
2
$\begingroup$

A simple way to do this would be:

import bpy

pi = 0
for obj in bpy.data.objects:
    obj.pass_index = pi
    pi += 1
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.