Scripts: marksurface.py

File marksurface.py, 563 bytes (added by goddard, 15 years ago)
Line 
1# Script to place markers on selected surfaces at each surface vertex.
2
3# Get selected surfaces.
4import Surface as S
5plist = S.selected_surface_pieces()
6
7# Create a new marker set.
8import VolumePath as VP
9if len(plist) > 0:
10 mset = VP.Marker_Set('Markers %s' % plist[0].model.name)
11
12# Place markers on each surface vertex.
13rgba = (.6,.8,.7,1) # Color (red, green, blue, opacity)
14radius = 1 # Radius of marker sphere
15for p in plist:
16 vertices, triangles = p.geometry
17 for xyz in vertices:
18 m = mset.place_marker(xyz, rgba, radius)