diff --git a/release/scripts/archimap.py b/release/scripts/archimap.py index 36974d7df50..2618c91d88d 100644 --- a/release/scripts/archimap.py +++ b/release/scripts/archimap.py @@ -15,7 +15,7 @@ __version__ = "1.1 12/18/05" __bpydoc__ = """\ This script projection unwraps the selected faces of a mesh. -it operates on all selected mesh objects, and can be set to unwrap +it operates on all selected mesh objects, and can be used unwrap selected faces, or all faces. """ diff --git a/release/scripts/batch_name_edit.py b/release/scripts/batch_name_edit.py deleted file mode 100644 index 75d2294aa68..00000000000 --- a/release/scripts/batch_name_edit.py +++ /dev/null @@ -1,131 +0,0 @@ -#!BPY - -""" -Name: 'Batch Object Name Edit' -Blender: 232 -Group: 'Object' -Tooltip: 'Apply the chosen rule to rename all selected objects at once.' -""" - -__author__ = "Campbell Barton" -__url__ = ("blender", "elysiun") -__version__ = "1.0" - -__bpydoc__ = """\ -"Batch Object Name Edit" allows you to change multiple names of Blender -objects at once. It provides options to define if you want to: replace text -in the current names, truncate their beginnings or endings or prepend / append -strings to them. - -Usage: - -Select the objects to be renamed and run this script from the Object->Scripts -menu of the 3d View. -""" - - -# $Id$ -# -# -------------------------------------------------------------------------- -# Batch Name Edit by Campbell Barton (AKA Ideasman) -# -------------------------------------------------------------------------- -# ***** 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 ***** -# -------------------------------------------------------------------------- - -from Blender import * - -def main(): - def new(): - newname = Draw.PupStrInput('Name: ', '', 32) - if newname == None: return - Window.WaitCursor(1) - for ob in Object.GetSelected(): - ob.name = newname - - def replace(): - replace = Draw.PupStrInput('Replace: ', '', 32) - if replace == None: return - with = Draw.PupStrInput('With: ', '', 32) - if with == None: return - Window.WaitCursor(1) - for ob in Object.GetSelected(): - ob.name = ob.name.replace(replace, with) - - # Use pythons replace, its better. - ''' - if replace in ob.name: - chIdx = ob.name.index(replace) - - # Remove the offending word and replace it with - 'with' - ob.name = ob.name[ :chIdx] + with + ob.name[chIdx + len(replace):] - ''' - - - def prefix(): - prefix = Draw.PupStrInput('prefix: ', '', 32) - - if prefix == None: return - Window.WaitCursor(1) - for ob in Object.GetSelected(): - ob.name = prefix + ob.name - - - def suffix(): - suffix = Draw.PupStrInput('Suffix: ', '', 32) - if suffix == None: return - Window.WaitCursor(1) - for ob in Object.GetSelected(): - ob.name = ob.name + suffix - - def truncate_start(): - truncate = Draw.PupIntInput('Truncate Start: ', 0, 0, 31) - if truncate != None: - Window.WaitCursor(1) - for ob in Object.GetSelected(): - ob.name = ob.name[truncate: ] - - def truncate_end(): - truncate = Draw.PupIntInput('Truncate End: ', 0, 0, 31) - if truncate == None: return - Window.WaitCursor(1) - for ob in Object.GetSelected(): - ob.name = ob.name[ :-truncate] - - - name = "Selected Object Names%t|New Name|Replace Text|Add Prefix|Add Suffix|Truncate Start|Truncate End" - result = Draw.PupMenu(name) - - if result == -1: - pass - elif result == 1: - new() - elif result == 2: - replace() - elif result == 3: - prefix() - elif result == 4: - suffix() - elif result == 5: - truncate_start() - elif result == 6: - truncate_end() - - Window.WaitCursor(0) - -main() diff --git a/release/scripts/bpymodules/BPyMesh.py b/release/scripts/bpymodules/BPyMesh.py index fd588d5669d..b40dca924ed 100644 --- a/release/scripts/bpymodules/BPyMesh.py +++ b/release/scripts/bpymodules/BPyMesh.py @@ -1,3 +1,23 @@ +# ***** 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 ***** +# -------------------------------------------------------------------------- + + import Blender from BPyMesh_redux import redux # seperated because of its size. diff --git a/release/scripts/image_find_paths.py b/release/scripts/image_find_paths.py index a4e91a5e5f0..d34cba5af07 100644 --- a/release/scripts/image_find_paths.py +++ b/release/scripts/image_find_paths.py @@ -11,7 +11,35 @@ __author__ = "Campbell Barton AKA Ideasman" __url__ = ["http://members.iinet.net.au/~cpbarton/ideasman/", "blender", "elysiun"] __bpydoc__ = """\ +Find image target paths + +This script searches for images whos +file paths do not point to an existing image file, +usefull when moving projects between computers, when absolute paths links are broken. """ + +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Script copyright (C) Campbell J Barton +# +# 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 ***** +# -------------------------------------------------------------------------- + + from Blender import * try: @@ -20,6 +48,8 @@ except: Draw.PupMenu('You need a full python install to use this script') os= None + + #==============================================# # Strips the slashes from the back of a string # #==============================================# diff --git a/release/scripts/mesh_boneweight_copy.py b/release/scripts/mesh_boneweight_copy.py index e2cbb26d539..06e42b6f96d 100755 --- a/release/scripts/mesh_boneweight_copy.py +++ b/release/scripts/mesh_boneweight_copy.py @@ -6,6 +6,49 @@ Group: 'Object' Tooltip: 'Copy Bone Weights from 1 mesh, to all other selected meshes.' """ +__author__ = ["Campbell Barton"] +__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/") +__version__ = "0.1" +__bpydoc__ = """\ + +Bone Weight Copy + +This script is used to copy bone weights from 1 mesh with weights (the source mesh) to many (the target meshes). +Weights are copied from 1 mesh to another based on how close they are together. + +For normal operation, select 1 source mesh with vertex weights and any number of unweighted meshes that overlap the source mesh. +Then run this script using default options and check the new weigh. + + +A differnt way to use this script is to update the weights an an alredy weighted mesh. +this is done using the "Copy to Selected" option enabled and works a bit differently, +With the target mesh, select the verts you want to update. +since all meshes have weights we cant just use the weighted mesh as the source, +so the Active Object is used for the source mesh. +Run the script and the selected verts on all non active meshes will be updated. +""" + +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Script copyright (C) Campbell J Barton +# +# 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 ***** +# -------------------------------------------------------------------------- + import Blender from Blender import Armature, Object, Mathutils, Window, Mesh Vector= Mathutils.Vector diff --git a/release/scripts/mesh_cleanup.py b/release/scripts/mesh_cleanup.py index f984b0c2512..12e952e06b6 100644 --- a/release/scripts/mesh_cleanup.py +++ b/release/scripts/mesh_cleanup.py @@ -1,10 +1,42 @@ #!BPY """ -Name: 'Clean meshes' -Blender: 228 +Name: 'Clean Meshes' +Blender: 242 Group: 'Mesh' Tooltip: 'Clean unused data from all selected mesh objects.' """ + +__author__ = ["Campbell Barton"] +__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/") +__version__ = "0.1" +__bpydoc__ = """\ +Clean Meshes + +Cleans unused data from selected meshes +""" + +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Script copyright (C) Campbell J Barton +# +# 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 ***** +# -------------------------------------------------------------------------- + + from Blender import * from Blender.Mathutils import TriangleArea diff --git a/release/scripts/mesh_edges2curves.py b/release/scripts/mesh_edges2curves.py index 4aeaf6c6b2b..568cc6158d4 100644 --- a/release/scripts/mesh_edges2curves.py +++ b/release/scripts/mesh_edges2curves.py @@ -10,12 +10,36 @@ __url__ = ("blender", "elysiun") __version__ = "1.0 2006/02/08" __bpydoc__ = """\ +Edges to Curves + This script converts open and closed edge loops into polylines Supported:
Polylines where each vert has no more then 2 edges attached to it. """ +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Script copyright (C) Campbell J Barton +# +# 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 ***** +# -------------------------------------------------------------------------- + + from Blender import * def sortPair(a,b): diff --git a/release/scripts/mesh_poly_reduce.py b/release/scripts/mesh_poly_reduce.py index 1adb9f330cf..af965f4b6a5 100644 --- a/release/scripts/mesh_poly_reduce.py +++ b/release/scripts/mesh_poly_reduce.py @@ -6,9 +6,38 @@ Group: 'Mesh' Tooltip: 'Removed polygons from a mesh while maintaining the shape, textures and weights.' """ +__author__ = "Campbell Barton" +__url__ = ("blender", "elysiun") +__version__ = "1.0 2006/02/07" + +__bpydoc__ = """\ +This script simplifies the mesh by removing faces, keeping the overall shape of the mesh. +""" + from Blender import Draw, Window, Scene, Mesh, Mathutils, sys, Object import BPyMesh +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Script copyright (C) Campbell J Barton +# +# 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 ***** +# -------------------------------------------------------------------------- + def main(): scn = Scene.GetCurrent() diff --git a/release/scripts/mesh_tri2quad.py b/release/scripts/mesh_tri2quad.py index e8f5d3a2583..7f95bf29f8b 100644 --- a/release/scripts/mesh_tri2quad.py +++ b/release/scripts/mesh_tri2quad.py @@ -25,6 +25,28 @@ The joining of quads takes into account UV mapping, UV Images and Vertex colours and will not join faces that have mis-matching data. """ +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Script copyright (C) Campbell J Barton +# +# 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 ***** +# -------------------------------------------------------------------------- + + from Blender import Scene, Object, Mathutils, Draw, Window, sys diff --git a/release/scripts/object_batch_name_edit.py b/release/scripts/object_batch_name_edit.py index 79693e03472..e5f13baefaf 100644 --- a/release/scripts/object_batch_name_edit.py +++ b/release/scripts/object_batch_name_edit.py @@ -276,4 +276,5 @@ def main(): Draw.PupMenu('renamed: %d objects.' % renameCount) -main() +if __name__=='__main__': + main() diff --git a/release/scripts/uv_from_adjacent.py b/release/scripts/uv_from_adjacent.py index 6933242f1cb..1cfbfc7f109 100644 --- a/release/scripts/uv_from_adjacent.py +++ b/release/scripts/uv_from_adjacent.py @@ -12,9 +12,31 @@ __version__ = "1.0 2006/02/07" __bpydoc__ = """\ This script sets the UV mapping and image of selected faces from adjacent unselected faces. -Use this script in face select mode. +Use this script in face select mode for texturing between textured faces. """ +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Script copyright (C) Campbell J Barton +# +# 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 ***** +# -------------------------------------------------------------------------- + + from Blender import * diff --git a/release/scripts/uv_relax.py b/release/scripts/uv_relax.py index f3b6143b7ce..78d2dcff18e 100644 --- a/release/scripts/uv_relax.py +++ b/release/scripts/uv_relax.py @@ -17,6 +17,28 @@ Use this script in face select mode. Left Click to finish or wait until no more relaxing can be done. """ +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Script copyright (C) Campbell J Barton +# +# 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 ***** +# -------------------------------------------------------------------------- + + from Blender import Scene, Object, Mesh, Window from Blender.Mathutils import Vector diff --git a/release/scripts/vertexpaint_selfshadow_ao.py b/release/scripts/vertexpaint_selfshadow_ao.py index 754b25e7eb5..182a0648a4b 100644 --- a/release/scripts/vertexpaint_selfshadow_ao.py +++ b/release/scripts/vertexpaint_selfshadow_ao.py @@ -11,10 +11,10 @@ __url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman __version__ = "0.1" __bpydoc__ = """\ -Clean Weight +Self Shadow -This Script is to be used only in weight paint mode, -It removes very low weighted verts from the current group with a weight option. +This usript uses the angles between faces to shade the mesh, +and optionaly blur the shading to remove artifacts from spesific edges. """ # ***** BEGIN GPL LICENSE BLOCK ***** @@ -149,10 +149,6 @@ def main(): me= ob.getData(mesh=1) - if not me.faceUV: - Draw.PupMenu('Error, The active mesh does not have texface/vertex colors. aborting') - return - PREF_BLUR_ITERATIONS= Draw.Create(1) PREF_BLUR_RADIUS= Draw.Create(0.05) PREF_MIN_EDLEN= Draw.Create(0.01) @@ -183,6 +179,9 @@ def main(): PREF_SHADOW_ONLY= PREF_SHADOW_ONLY.val PREF_SEL_ONLY= PREF_SEL_ONLY.val + if not me.faceUV: + me.faceUV= 1 + #t= sys.time() vertexFakeAO(me, PREF_BLUR_ITERATIONS, PREF_BLUR_RADIUS, PREF_MIN_EDLEN, PREF_CLAMP_CONCAVE, PREF_CLAMP_CONVEX, PREF_SHADOW_ONLY, PREF_SEL_ONLY) #print 'done in %.6f' % (sys.time()-t)