A Subjective Vision of Life

  • Archive
  • RSS
  • What's Up?
banner

Transfer UVs from one object to multiple objects MAYA

This past week I’ve been painstakingly UVing in maya some hard surface models that I’ve modeled for a new project I’m working on. One thing I found is that having a lot of repeated objects (for example buttons) transfering the UVs from one to the other was easy enough. Just go to Mesh > Transfer Attributes > Option Box and with the default options just change Sample space to Component in the Attribute Settings Tab and your set to go.

The problem comes when you have a million objects. You can’t do it in one go… You have to go object by object and do the same steps over and over again.

Luckily with the magic of python I wrote this trivial script that will do this for you. Just select the first object that has the correct UVs an then select all the other ones that you want to transfer the UVs to. 

You’ll turn this:

into this:

With the click of a button (that button being the script in your shelf :D)

Well These next lines are what do it, you’ll see it’s so trivial that you’ll say I could’ve come up with that… :D So if you wanted here it is for you!

import maya.cmds as cm

#grab all the selected objects

selectedObjects = cm.ls(sl=True)

#save first one into variable

#pop first one out of the selected objects list

driver = selectedObjects.pop(0)

#for each object in the selected objects list

for object in selectedObjects:

    cm.select([driver,object])

    #transfer attributes

    cm.transferAttributes(sampleSpace=4,transferUVs=2, transferColors=2 )

That’s it for today folks if you want to check more Programming stuff for maya just visit my programming portfolio or at nestorprado.com

Enjoy!

    • #Maya
    • #uvs
    • #python
    • #code
    • #script
  • 8 months ago
  • 2
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Logo

About

This is a space for reflection, inspiration and quite about anything I feel worth sharing.
more @ nestorprado.com

Me, Elsewhere

  • heavenideas on Behance
  • @heavenideas on Twitter
  • heavenideas on Vimeo
  • heavenideas on Flickr
  • Linkedin Profile
  • nestorprado on github

Twitter

loading tweets…

Top

I Dig These Posts

See more →
  • Photoset via photojojo

    Michal Karcz is a Polish photographer creating some of the most beautiful photo manipulations we’ve ever seen! The vast majority of his images...

    Photoset via photojojo
  • Video via ericalba
    Video

    The First Colour Moving Pictures at the National Media Museum (by nationalmediamuseum)

    Video via ericalba
  • Photoset via photojojo

    If you find yourself in a situation where a flash is necessary, sometimes it’s better to “bounce” that flash off of a surface so your subject isn’t...

    Photoset via photojojo
  • Photo via moretong

    “24 Solar Terms of China-Da Shu”

    Photo via moretong
  • Photo via moretong

    “24 Solar Terms of China-Li Chun” typo design for voicer.me

    Photo via moretong
  • RSS
  • Random
  • Archive
  • What's Up?
  • Mobile
Effector Theme by Pixel Union