Created
January 24, 2023 16:29
-
-
Save aobond2/12bc80a396ea037654de9372c037d046 to your computer and use it in GitHub Desktop.
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
def matchPlaceholderName(): | |
# Function to rename placeholder to match the category name | |
# Select props collection | |
placeholderString = "Placeholder" | |
propsColl = bpy.context.collection | |
categoryArray = [] | |
placeholderArray = [] | |
placeholderCollection = bpy.data.collections[placeholderString] | |
if (propsColl.name == "Props"): | |
# Fill both array | |
for p in placeholderCollection.children: | |
placeholderArray.append(p) | |
for c in propsColl.children: | |
categoryArray.append(c) | |
for p in range (len(placeholderArray)): | |
catName = categoryArray[p].name | |
placeholderArray[p].name = "PH_" + catName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment