2006-07-06 13:34:53 +00:00
|
|
|
#!BPY
|
|
|
|
"""
|
|
|
|
Name: 'Weight Gradient...'
|
2008-04-23 14:04:05 +00:00
|
|
|
Blender: 245
|
2006-07-06 13:34:53 +00:00
|
|
|
Group: 'WeightPaint'
|
|
|
|
Tooltip: 'Click on the start and end grad points for the mesh for selected faces.'
|
|
|
|
"""
|
|
|
|
|
2008-04-23 14:04:05 +00:00
|
|
|
__author__ = "Campbell Barton aka ideasman42"
|
|
|
|
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
|
2006-07-06 13:34:53 +00:00
|
|
|
__version__ = "0.1"
|
|
|
|
__bpydoc__=\
|
|
|
|
'''
|
|
|
|
This script is used to fill the selected faces with a gradient
|
|
|
|
To use the script, switch to "Face Select" mode then "Vertex Paint" mode
|
|
|
|
Select the faces you wish to apply the gradient to.
|
|
|
|
Click twice on the mesh to set the start and end points of the gradient.
|
|
|
|
The color under the mouse will be used for the start and end blend colors.
|
|
|
|
Note:
|
|
|
|
Holding Shift or clicking outside the mesh on the second click will blend the first colour to nothing.
|
|
|
|
'''
|
|
|
|
|
2007-05-20 17:30:30 +00:00
|
|
|
# ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
#
|
|
|
|
# ***** END GPL LICENCE BLOCK *****
|
|
|
|
|
2006-07-07 10:46:46 +00:00
|
|
|
import mesh_gradient
|
2006-07-06 13:34:53 +00:00
|
|
|
import Blender
|
|
|
|
|
|
|
|
def main():
|
|
|
|
scn= Blender.Scene.GetCurrent()
|
2006-12-27 09:31:28 +00:00
|
|
|
ob= scn.objects.active
|
2006-07-06 13:34:53 +00:00
|
|
|
|
2006-12-27 09:31:28 +00:00
|
|
|
if not ob or ob.type != 'Mesh':
|
2006-07-06 13:34:53 +00:00
|
|
|
Blender.Draw.PupMenu('Error, no active mesh object, aborting.')
|
|
|
|
return
|
|
|
|
# MODE 0 == VCOL
|
|
|
|
# MODE 1 == WEIGHT
|
|
|
|
MODE= 0
|
2006-07-07 10:46:46 +00:00
|
|
|
mesh_gradient.vertexGradientPick(ob, MODE)
|
2006-07-06 13:34:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|
2007-01-18 08:39:31 +00:00
|
|
|
|