Merge branch 'cb/fixs'
[plumiferos.git] / release / scripts / weightpaint_gradient.py
bloba2bff999610f65890c66d68553776f16d918e57a
1 #!BPY
2 """
3 Name: 'Weight Gradient...'
4 Blender: 241
5 Group: 'WeightPaint'
6 Tooltip: 'Click on the start and end grad points for the mesh for selected faces.'
7 """
9 __author__ = ["Campbell Barton"]
10 __url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/")
11 __version__ = "0.1"
12 __bpydoc__=\
13 '''
14 This script is used to fill the selected faces with a gradient
15 To use the script, switch to "Face Select" mode then "Vertex Paint" mode
16 Select the faces you wish to apply the gradient to.
17 Click twice on the mesh to set the start and end points of the gradient.
18 The color under the mouse will be used for the start and end blend colors.
19 Note:
20 Holding Shift or clicking outside the mesh on the second click will blend the first colour to nothing.
21 '''
23 # ***** BEGIN GPL LICENSE BLOCK *****
25 # This program is free software; you can redistribute it and/or
26 # modify it under the terms of the GNU General Public License
27 # as published by the Free Software Foundation; either version 2
28 # of the License, or (at your option) any later version.
30 # This program is distributed in the hope that it will be useful,
31 # but WITHOUT ANY WARRANTY; without even the implied warranty of
32 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 # GNU General Public License for more details.
35 # You should have received a copy of the GNU General Public License
36 # along with this program; if not, write to the Free Software Foundation,
37 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39 # ***** END GPL LICENCE BLOCK *****
41 import mesh_gradient
42 import Blender
44 def main():
45 scn= Blender.Scene.GetCurrent()
46 ob= scn.objects.active
48 if not ob or ob.type != 'Mesh':
49 Blender.Draw.PupMenu('Error, no active mesh object, aborting.')
50 return
51 # MODE 0 == VCOL
52 # MODE 1 == WEIGHT
53 MODE= 0
54 mesh_gradient.vertexGradientPick(ob, MODE)
57 if __name__ == '__main__':
58 main()