~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to release/scripts/uvcalc_quad_clickproj.py

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
# -------------------------------------------------------------------------- 
41
41
 
42
42
import Blender
 
43
import bpy
43
44
import BPyMesh
44
45
import BPyWindow
45
46
 
46
47
mouseViewRay= BPyWindow.mouseViewRay
47
48
from Blender import Mathutils, Window, Scene, Draw, sys
48
49
from Blender.Mathutils import CrossVecs, Vector, Matrix, LineIntersect, Intersect #, AngleBetweenVecs, Intersect
49
 
LMB= Window.MButs['L']
50
 
RMB= Window.MButs['R']
 
50
LMB= Window.MButs.L
 
51
RMB= Window.MButs.R
51
52
 
52
53
def using_modifier(ob):
53
54
        for m in ob.modifiers:
74
75
 
75
76
def main():
76
77
        
77
 
        scn = Scene.GetCurrent()
 
78
        scn = bpy.data.scenes.active
78
79
        ob = scn.objects.active
79
80
        if not ob or ob.type!='Mesh':
80
81
                return
167
168
        def get_face_coords(f):
168
169
                f_uv = f.uv
169
170
                return [(v.co-face_corner_main, f_uv[i]) for i,v in enumerate(f.v)]
170
 
                
171
 
                
172
 
                
173
 
        SELECT_FLAG = Blender.Mesh.FaceFlags.SELECT
174
 
        HIDE_FLAG = Blender.Mesh.FaceFlags.HIDE
175
 
        def use_face(f_flag):
176
 
                if f_flag & HIDE_FLAG:          return False
177
 
                elif f_flag & SELECT_FLAG:      return True
178
 
                else:                                           return False
179
171
        
180
 
        coords = [ (co,uv) for f in me.faces if use_face(f.flag) for co, uv in get_face_coords(f)]
 
172
        coords = [ (co,uv) for f in me.faces if f.sel for co, uv in get_face_coords(f)]
181
173
        
182
174
        coords_orig = [uv.copy() for co, uv in coords]
183
175
        USE_MODIFIER = using_modifier(ob)