Welcome to mirror list, hosted at ThFree Co, Russian Federation.

uvcopy.py « scripts « release - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b201d31e2a8c49b101aa120e2a1ff1baf5d04bef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!BPY
""" Registration info for Blender menus: <- these words are ignored
Name: 'UVcopy'
Blender: 242
Group: 'UV'
Tip: 'Copy UV coords from a mesh to another that has same vertex indices'
"""

__author__ = "Martin Poirier, Toni Alatalo et. al."
__url__ = ("blender", "elysiun",
"Script's homepage, http://www.elysiun.com/forum/viewtopic.php?t=14897", 
"Communicate problems and errors, http://www.elysiun.com/forum/viewtopic.php?t=14897")
__version__ = "0.1 01/2006"

__bpydoc__ = """\
This script copies UV coords from a mesh to another (version of the same mesh).
"""

import Blender
 
Name_From = "Unwrapped" #XXX active and 1st selected object, or what? two first selected?
Name_To   = "Original" 
 
me1 = Blender.Object.Get(Name_To) 
me2 = Blender.Object.Get(Name_From) 
 
if me1: 
    me1 = me1.getData() 
else: 
    print "No object named "+Name_To+"." 
 
if me2: 
    me2 = me2.getData() 
else: 
    print "No object named "+Name_From+"." 
 
if me1 and me2: 
    for i in range(len(me1.faces)): 
        me1.faces[i].uv = me2.faces[i].uv 
    me1.update() 
    print "Copied UV from object "+Name_From+" to object "+Name_To+"."