[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [653] repair_holding/ space_view3d_index_visualiser.py: updated mathutils.Vector() changes
Campbell Barton
ideasman42 at gmail.com
Sun May 2 16:50:56 CEST 2010
locs.append([1.0, 1.0, 1.0, v.index, mathutils.Vector((v.co[:][0],
v.co[:][1], v.co[:][2], 1.0))])
Could be rewritten as...
locs.append([1.0, 1.0, 1.0, v.index, v.co.copy().resize4D()])
On 5/1/10, Florian Meyer <florianfelix at web.de> wrote:
> Revision: 653
>
> http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=653
> Author: testscreenings
> Date: 2010-05-01 14:08:17 +0200 (Sat, 01 May 2010)
>
> Log Message:
> -----------
> updated mathutils.Vector() changes
> ubdated blf changes
> works again on my end
>
> somebody else would like to check?
>
> Modified Paths:
> --------------
> repair_holding/space_view3d_index_visualiser.py
>
> Modified: repair_holding/space_view3d_index_visualiser.py
> ===================================================================
> --- repair_holding/space_view3d_index_visualiser.py 2010-05-01 02:39:32 UTC
> (rev 652)
> +++ repair_holding/space_view3d_index_visualiser.py 2010-05-01 12:08:17 UTC
> (rev 653)
> @@ -66,7 +66,7 @@
> if bpy.context.scene.display_vert_index:
> for v in me.verts:
> if v.selected or not bpy.context.scene.display_sel_only:
> - locs.append([1.0, 1.0, 1.0, v.index,
> mathutils.Vector(v.co[:][0], v.co[:][1], v.co[:][2], 1.0)])
> + locs.append([1.0, 1.0, 1.0, v.index,
> mathutils.Vector((v.co[:][0], v.co[:][1], v.co[:][2], 1.0))])
> if bpy.context.scene.display_edge_index:
> for ed in me.edges:
> if ed.selected or not bpy.context.scene.display_sel_only:
> @@ -74,15 +74,15 @@
> v1 = mathutils.Vector(me.verts[v1].co[:])
> v2 = mathutils.Vector(me.verts[v2].co[:])
> loc = v1 + ((v2-v1)/2.0)
> - locs.append([1.0, 1.0, 0.0, ed.index,
> mathutils.Vector(loc[0],loc[1],loc[2],1.0)])
> + locs.append([1.0, 1.0, 0.0, ed.index,
> mathutils.Vector((loc[0],loc[1],loc[2],1.0))])
> if bpy.context.scene.display_face_index:
> for f in me.faces:
> if f.selected or not bpy.context.scene.display_sel_only:
> - locs.append([1.0, 0.0, 0.5, f.index,
> mathutils.Vector(f.center[0], f.center[1], f.center[2], 1.0)])
> + locs.append([1.0, 0.0, 0.5, f.index,
> mathutils.Vector((f.center[0], f.center[1], f.center[2], 1.0))])
>
> for loc in locs:
> vec = total_mat*loc[4] # order is important
> - vec = mathutils.Vector(vec[0]/vec[3],vec[1]/vec[3],vec[2]/vec[3]) #
> dehomogenise
> + vec = mathutils.Vector((vec[0]/vec[3],vec[1]/vec[3],vec[2]/vec[3]))
> # dehomogenise
> x = int(mid_x + vec[0]*width/2.0)
> y = int(mid_y + vec[1]*height/2.0)
> texts+=[loc[0], loc[1], loc[2], loc[3], x, y, 0]
> @@ -104,11 +104,11 @@
> return
>
> # draw
> - blf.size(13, 72)
> + blf.size(0, 13, 72)
> for i in range(0,len(texts),7):
> bgl.glColor3f(texts[i], texts[i+1], texts[i+2])
> - blf.position(texts[i+4], texts[i+5], texts[i+6])
> - blf.draw(str(int(texts[i+3])))
> + blf.position(0, texts[i+4], texts[i+5], texts[i+6])
> + blf.draw(0, str(int(texts[i+3])))
>
> # operator
> class IndexVisualiser(bpy.types.Operator):
>
>
> _______________________________________________
> Bf-extensions-cvs mailing list
> Bf-extensions-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-extensions-cvs
>
--
- Campbell
More information about the Bf-extensions-cvs
mailing list