Skip to content

Instantly share code, notes, and snippets.

@mclavan
Last active October 12, 2020 21:56
Show Gist options
  • Save mclavan/57673ab1e8fb634fc9e7df9bb89e766f to your computer and use it in GitHub Desktop.
Save mclavan/57673ab1e8fb634fc9e7df9bb89e766f to your computer and use it in GitHub Desktop.
import pymel.core as pm
# Get Selection Driver and Driven(s)
selection = pm.ls(sl=True)
driver = selection[0]
driven = selection[1:]
# Transfer the UVs
#pm.transferAttributes(driver, driven[0], flipUVs=0, transferPositions=0, transferUVs=2, sourceUvSpace="map1", searchMethod=3, transferNormals=0, transferColors=2, targetUvSpace="map1", colorBorders=1, sampleSpace=5)
# Loop through driven
for current_driven in driven:
pm.transferAttributes(driver, current_driven, flipUVs=0, transferPositions=0, transferUVs=2, sourceUvSpace="map1", searchMethod=3, transferNormals=0, transferColors=2, targetUvSpace="map1", colorBorders=1, sampleSpace=5)
#pm.delete(current_driven, ch=1)
#pm.delete(driver, ch=1)
pm.delete(selection, ch=1)
# Delete history once done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment