Skip to content

Instantly share code, notes, and snippets.

@aobond2
Created January 24, 2023 16:29
Show Gist options
  • Save aobond2/12bc80a396ea037654de9372c037d046 to your computer and use it in GitHub Desktop.
Save aobond2/12bc80a396ea037654de9372c037d046 to your computer and use it in GitHub Desktop.
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