Created
January 16, 2020 18:58
-
-
Save rafaelbriet/4c117d66a8c2ad861056cbeff7cb8e73 to your computer and use it in GitHub Desktop.
Apply a "object pass index" to multiple objects in Blender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# COPYRIGHT: https://blenderartists.org/t/applying-object-pass-index-to-multiple-objects/562689/4 | |
# This script apply a object pass index to multiple objects in Blender | |
# Select all objects to be batched first; all selected objects will be batched | |
import bpy | |
selection = bpy.context.selected_objects | |
passNumber = 2 #change '2' to whichever pass index you choose | |
bpy.ops.object.select_all(action='DESELECT') | |
for obj in selection: | |
obj.select = True | |
obj.pass_index = passNumber | |
obj.select = False | |
for obj in selection: | |
obj.select = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment