diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2004-11-07 19:31:13 +0300 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2004-11-07 19:31:13 +0300 |
commit | c702b237d5f9a542c1d327e1c87a5b7e7ec81590 (patch) | |
tree | 99347ced1b1260843aff9c6f70670a2a9d45f7f8 /release/scripts | |
parent | 23e8b982288699258c4bf4d7f5464f968b98d5cf (diff) |
Scripts:
-- adding help_browser.py to show help for installed scripts;
-- updated scripts to include basic doc info to be shown with above script:
script authors can / will / should update with more info, of course;
-- updated some scripts to newer versions: disp_paint, fixfromarmature, hotkeys, etc.
Diffstat (limited to 'release/scripts')
59 files changed, 2478 insertions, 371 deletions
diff --git a/release/scripts/Apply_def.py b/release/scripts/Apply_def.py index a8f17b02c0f..f4880341a43 100644 --- a/release/scripts/Apply_def.py +++ b/release/scripts/Apply_def.py @@ -6,6 +6,28 @@ Blender: 234 Group: 'Mesh' Tooltip: 'Create fixed copies of deformed meshes' """ + +__author__ = "Martin Poirier" +__url__ = ("blender", "elysiun") +__version__ = "1.5 09/21/04" + +__bpydoc__ = """\ +This script creates "raw" copies of deformed meshes. + +Usage: + +Select the mesh(es) and run this script. A fixed copy of each selected mesh +will be created, with the word "_deformed" appended to its name. + +Meshes in Blender can be deformed by armatures, lattices, curve objects and subdivision, but this will only change its appearance on screen and rendered +images -- the actual mesh data is still simpler, with vertices in an original +"rest" position and less vertices than the subdivided version. + +Use this script if you want a "real" version of the deformed mesh, so you can +directly manipulate or export its data. +""" + + # $Id$ # # -------------------------------------------------------------------------- diff --git a/release/scripts/Axiscopy.py b/release/scripts/Axiscopy.py index bfdb89806cd..0a9a411ef08 100644 --- a/release/scripts/Axiscopy.py +++ b/release/scripts/Axiscopy.py @@ -4,9 +4,40 @@ Name: 'Axis Orientation Copy' Blender: 233 Group: 'Object' -Tip: 'Copy the axis orientation of the active object to all selected mesh object' +Tip: 'Copy the axis orientation of the active object to all selected mesh objects' """ +__author__ = "A Vanpoucke (xand)" +__url__ = ("blender", "elysiun", +"French Blender support forum, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender") +__version__ = "1.1 11/05/04" + +__bpydoc__ = """\ +This script copies the axis orientation -- X, Y and Z rotations -- of the +active object to all selected meshes. + +It's useful to align the orientations of all meshes of a structure, a human +skeleton, for example. + +Usage: + +Select all mesh objects that need to have their orientations changed +(reminder: keep SHIFT pressed after the first, to add each new one to the +selection), then select the object whose orientation will be copied from and +finally run this script to update the angles. + +Notes:<br> + Before copying the orientation to each object, the script stores its +transformation matrix. Then the angles are copied and after that the object's +vertices are transformed "back" so that they still have the same positions as +before. In other words, the rotations are updated, but you won't notice that +just from looking at the objects.<br> + Checking their X, Y and Z rotation values with "Transform Properties" in +the 3D View's Object menu shows the angles are now the same of the active +object. +""" + + # $Id$ # #---------------------------------------------- @@ -53,17 +84,23 @@ def applyTransform(mesh,mat): oblist =Object.GetSelected() lenob=len(oblist) -if lenob<2: - Draw.PupMenu("Select at least 2 objects") -else : - source=oblist[0] - nsource=source.name - texte="Copy axis orientation from : " + nsource + " ?%t|OK" - result=Draw.PupMenu(texte) +error = 0 +for o in oblist[1:]: + if o.getType() != "Mesh": + Draw.PupMenu("ERROR%t|Selected objects must be meshes") + error = 1 + +if not error: + if lenob<2: + Draw.PupMenu("ERROR%t|You must select at least 2 objects") + else : + source=oblist[0] + nsource=source.name + texte="Copy axis orientation from: " + nsource + " ?%t|OK" + result=Draw.PupMenu(texte) - for cible in oblist[1:]: - if cible.getType()=='Mesh': + for cible in oblist[1:]: if source.rot!=cible.rot: rotcible=cible.mat.toEuler().toMatrix() rotsource=source.mat.toEuler().toMatrix() diff --git a/release/scripts/DirectX8Exporter.py b/release/scripts/DirectX8Exporter.py index c37f6dceba6..0eea95bcc93 100644 --- a/release/scripts/DirectX8Exporter.py +++ b/release/scripts/DirectX8Exporter.py @@ -6,9 +6,38 @@ Blender: 234 Group: 'Export' Submenu: 'Export to DX8 file format' export Submenu: 'How to use this exporter?' help -Tip: 'Export to DirectX8 text file format format.' +Tip: 'Export to DirectX8 text file format' """ +__author__ = "Arben (Ben) Omari" +__url__ = ("blender", "elysiun", "Author's site, http://www.omariben.too.it") +__version__ = "1.0" + +__bpydoc__ = """\ +This script exports a Blender mesh with armature to DirectX 8's text file +format. + +Usage: + +1) There should be only one mesh and one armature in the scene; + +2) Before parenting set:<br> + a) Armature and mesh must have the same origin location +(in the 3d View press N (menu Object->"Transform Properties") for both and set +same LocX, LocY and LocZ);<br> + b) Armature and mesh must have the same rotation +(select them and press Ctrl + A); + +3) Set the number of the animation frames to export; + +4) Read warnings (if any) in console. + +Notes:<br> + Check author's site or the elYsiun forum for a new beta version of the +DX exporter. +""" + + # $Id$ # # DirectX8Exporter.py version 1.0 diff --git a/release/scripts/DirectXExporter.py b/release/scripts/DirectXExporter.py index c2cee3a4c11..9303683e269 100644 --- a/release/scripts/DirectXExporter.py +++ b/release/scripts/DirectXExporter.py @@ -6,9 +6,34 @@ Blender: 234 Group: 'Export' Submenu: 'Only mesh data...' mesh Submenu: 'Animation(not armature yet)...' anim -Tip: 'Export to DirectX text file format format.' +Tip: 'Export to DirectX text file format' """ +__author__ = "Arben (Ben) Omari" +__url__ = ("blender", "elysiun", "Author's site, http://www.omariben.too.it") +__version__ = "1.0" + +__bpydoc__ = """\ +This script exports Blender uv-textured meshes with animation frame keys to +DirectX 7's text file format. + +Usage: + +Run the script and check console for possible warning messages. + +Supported:<br> + UV-textured meshes with animation frame (location, rotation) keys. + +Known issues:<br> + Some DX format viewers don't support Material names with dots +('.') in them. + +Notes:<br> + Check author's site or the elYsiun forum for a new beta version of the +DX exporter. +""" + + # $Id$ # # DirectX.py version 1.0 diff --git a/release/scripts/UVpaint05.py b/release/scripts/UVpaint05.py index 40902a4909f..5217d942109 100644 --- a/release/scripts/UVpaint05.py +++ b/release/scripts/UVpaint05.py @@ -1,10 +1,40 @@ #!BPY + """ Registration info for Blender menus: <- these words are ignored Name: 'UVpainter' Blender: 232 Group: 'UV' -Tip: 'Use vertex paint color value to fill uvmapping.' +Tip: 'Use vertex paint color value to fill uvmapping' """ + +__author__ = "Jean-Michel Soler (jms)" +__url__ = ("blender", "elysiun", +"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_uvpainting.htm", +"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender") +__version__ = "0.5 05/2004" + +__bpydoc__ = """\ +This script "paints" uv-mappings with the model's vertex colors. + +Usage: + +With this script you can export uv-maps filled with vertex colors to TARGA +(.tga) images. To use it the mesh must have proper uv coordinates assigned +in UV Face Select Mode. And to fill the projected faces with color, the mesh +can also have material(s) and vertex colors painted on it. + +The script has a GUI with a preview of the results and options like drawing +lines or not, defining size, etc. You can paint vertex colors in the mesh and +see the uv-map updated in the script's window. + +Notes:<br> + Material's rgb color is also used to fill the uv-map;<br> + If there are no vertex colors or texture faces in the mesh and you press +the "Make" VColors button in the edit mesh buttons win, the current light setup +is saved as vertex colors for the model;<br> + Check the script's homepage for example images. +""" + # $Id$ # #---------------------------------------------- @@ -13,7 +43,6 @@ Tip: 'Use vertex paint color value to fill uvmapping.' # this script is released under GPL licence # for the Blender 2.33 scripts distribution #---------------------------------------------- -#---------------------------------------------- # Official page : # http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_uvpainting.htm # Communicate problems and errors on: @@ -26,7 +55,30 @@ Tip: 'Use vertex paint color value to fill uvmapping.' #--------------------------------------------- # ce script est proposé sous licence GPL pour etre associe # a la distribution de Blender 2.33 et suivant -#---------------------------------------------- +# -------------------------------------------------------------------------- +# this script is released under GPL licence +# for the Blender 2.33 scripts package +# -------------------------------------------------------------------------- +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Script copyright (C) 2003, 2004: Jean-Michel Soler +# +# 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.Draw import * diff --git a/release/scripts/ac3d_export.py b/release/scripts/ac3d_export.py index 3ee140e9a2c..b3fb3008947 100644 --- a/release/scripts/ac3d_export.py +++ b/release/scripts/ac3d_export.py @@ -10,6 +10,37 @@ Submenu: 'Configure +' config Tip: 'Export to AC3D (.ac) format.' """ +__author__ = "Willian P. Germano" +__url__ = ("blender", "elysiun", "AC3D's homepage, http://www.ac3d.org", + "PLib 3d gaming lib, http://plib.sf.net") +__version__ = "2.34 09/20/04" + +__bpydoc__ = """\ +This script exports Blender meshes to AC3D's .ac file format. + +AC3D is a simple and affordable commercial 3d modeller also built with OpenGL. +The .ac file format is an easy to parse text format well supported, +for example, by the PLib 3d gaming library (AC3D v3.x). + +Supported:<br> + UV-textured meshes with hierarchy (grouping) information. + +Missing:<br> + Support for AC3D 4's crease tag (simple, will be added soon). + +Known issues:<br> + Models textured with more than one image do not work -- for the +moment you can separate them in Blender such that each mesh only has one +image assigned (also see notes below);<br> + The exporter is slow for large meshes -- faster code was written for the +TuxKart (http://tuxkart.sf.net) game exporter and will be integrated on a +future version of this exporter. + +Notes:<br> + There is a version of this script by <fix this> that accepts meshes with +more than one texture image assigned, check TuxKart's wiki. +""" + # $Id$ # # -------------------------------------------------------------------------- diff --git a/release/scripts/ac3d_import.py b/release/scripts/ac3d_import.py index 82bc1b2335b..07e8540798a 100644 --- a/release/scripts/ac3d_import.py +++ b/release/scripts/ac3d_import.py @@ -7,6 +7,33 @@ Group: 'Import' Tip: 'Import an AC3D (.ac) file.' """ +__author__ = "Willian P. Germano" +__url__ = ("blender", "elysiun", "AC3D's homepage, http://www.ac3d.org", + "PLib 3d gaming lib, http://plib.sf.net") +__version__ = "2.34 07/26/04" + +__bpydoc__ = """\ +This script imports AC3D models into Blender. + +AC3D is a simple and affordable commercial 3d modeller also built with OpenGL. +The .ac file format is an easy to parse text format well supported, +for example, by the PLib 3d gaming library (AC3D v3.x). + +Supported:<br> + UV-textured meshes with hierarchy (grouping) information. + +Missing:<br> + Support for AC3D 4's crease tag (simple, will be added soon). + +Known issues:<br> + None. + +Notes:<br> + Check script's source code for options that can be tweaked (using Blender +empties to emulate AC3D's grouping info and setting a default folder for +textures, for the case of wrong paths in the .ac file(s). +""" + # $Id$ # # -------------------------------------------------------------------------- diff --git a/release/scripts/batch_name_edit.py b/release/scripts/batch_name_edit.py index b28cb5464ae..08611198d47 100644 --- a/release/scripts/batch_name_edit.py +++ b/release/scripts/batch_name_edit.py @@ -4,7 +4,23 @@ Name: 'Batch Object Name Edit' Blender: 232 Group: 'Object' -Tooltip: 'Apply the chosen rule to rename all selected objects at once.' +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$ diff --git a/release/scripts/bevel_center.py b/release/scripts/bevel_center.py index 6de4a20718f..ededf397ef7 100644 --- a/release/scripts/bevel_center.py +++ b/release/scripts/bevel_center.py @@ -7,6 +7,30 @@ Group: 'Mesh' Tip: 'Bevel selected vertices' """ +__author__ = "Loic Berthe" +__url__ = ("blender", "elysiun") +__version__ = "1.0" + +__bpydoc__ = """\ +This script implements vertex bevelling in Blender. + +Usage: + +Select the mesh you want to work on, enter Edit Mode and select the vertices +to bevel. Then run this script from the 3d View's Mesh->Scripts menu. + +You can control the thickness of the bevel with the slider -- redefine the +end points for bigger or smaller ranges. The thickness can be changed even +after applying the bevel, as many times as needed. + +For an extra smoothing after or instead of direct bevel, set the level of +recursiveness and use the "Recursive" button. + +Notes:<br> + You can undo and redo your steps just like with normal mesh operations in +Blender. +""" + # $Id$ # ###################################################################### diff --git a/release/scripts/blender2cal3d.py b/release/scripts/blender2cal3d.py index 07728df50b3..3d7d148a55c 100644 --- a/release/scripts/blender2cal3d.py +++ b/release/scripts/blender2cal3d.py @@ -6,6 +6,46 @@ Blender: 234 Group: 'Export' Tip: 'Export armature/bone data to the Cal3D library.' """ + +__author__ = ["Jean-Baptiste Lamy (Jiba)", "Chris Montijin", "Damien McGinnes"] +__url__ = ("blender", "elysiun", "Cal3D, http://cal3d.sf.net") +__version__ = "0.7" + +__bpydoc__ = """\ +This script exports armature / bone data to the well known open source Cal3D +library. + +Usage: + +Simply run the script to export available armatures. + +Supported:<br> + Cal3D versions 0.7 -> 0.9. + +Known issues:<br> + Material color is not supported yet;<br> + Cal3D springs (for clothes and hair) are not supported yet;<br> + Cal3d has a bug in that a cycle that doesn't have a root bone channel +will segfault cal3d. Until cal3d supports this, add a keyframe for the +root bone;<br> + When you finish an animation and run the script you can get an error +(something with KeyError). Just save your work and reload the model. This is +usually caused by deleted items hanging around;<br> + If a vertex is assigned to one or more bones, but has for each bone a +weight of zero, there used to be a subdivision by zero error somewhere. As a +workaround, if sum is 0.0 then sum becomes 1.0. It's recommended that you give +weights to all bones to avoid problems. + +Notes:<br> + Objects/bones/actions whose names start by "_" are not exported so call IK +and null bones _LegIK, for example;<br> + All your armature's exported bones must be connected to another bone + (except for the root bone). Contrary to Blender, Cal3D doesn't support +"floating" bones.<br> + Actions that start with '@' will be exported as actions, others will be +exported as cycles. +""" + # $Id$ # # Copyright (C) 2003 Jean-Baptiste LAMY -- jiba@tuxfamily.org diff --git a/release/scripts/bvh_export.py b/release/scripts/bvh_export.py index a2370ed66a6..84425626cee 100644 --- a/release/scripts/bvh_export.py +++ b/release/scripts/bvh_export.py @@ -7,6 +7,23 @@ Group: 'Export' Tip: 'Export a (.bvh) motion capture file' """ +__author__ = "Campbell Barton" +__url__ = ("blender", "elysiun") +__version__ = "1.0 03/30/04" + +__bpydoc__ = """\ +This script exports animation data to BVH motion capture file format. + +Supported:<br> + +Missing:<br> + +Known issues:<br> + +Notes:<br> + +""" + # $Id$ # #===============================================# diff --git a/release/scripts/bvh_import.py b/release/scripts/bvh_import.py index 9c6255633bb..3d29dc926c8 100644 --- a/release/scripts/bvh_import.py +++ b/release/scripts/bvh_import.py @@ -7,6 +7,23 @@ Group: 'Import' Tip: 'Import a (.bvh) motion capture file' """ +__author__ = "Campbell Barton" +__url__ = ("blender", "elysiun") +__version__ = "1.0 03/25/04" + +__bpydoc__ = """\ +This script imports BVH motion capture data to Blender. + +Supported:<br> + +Missing:<br> + +Known issues:<br> + +Notes:<br> + +""" + # $Id$ # #===============================================# diff --git a/release/scripts/clean_mesh.py b/release/scripts/clean_mesh.py index 7fa3a496b34..be1fa460572 100644 --- a/release/scripts/clean_mesh.py +++ b/release/scripts/clean_mesh.py @@ -7,6 +7,28 @@ Group: 'Mesh' Tooltip: 'Clean unused data from all selected meshes' """ +__author__ = "Campbell Barton" +__url__ = ("blender", "elysiun") +__version__ = "1.0 04/25/04" + +__bpydoc__ = """\ +This script cleans specific data from all selected meshes. + +Usage: + +Select the meshes to be cleaned and run this script. A pop-up will ask +you what you want to remove: + +- Free standing vertices;<br> +- Edges that are not part of any face;<br> +- Edges below a threshold length;<br> +- Faces below a threshold area;<br> +- All of the above. + +After choosing one of the above alternatives, if your choice requires a +threshold value you'll be prompted with a number pop-up to set it. +""" + # $Id$ # # -------------------------------------------------------------------------- diff --git a/release/scripts/disp_paint.py b/release/scripts/disp_paint.py index 30bcd9e88f4..01a6da8cc98 100644 --- a/release/scripts/disp_paint.py +++ b/release/scripts/disp_paint.py @@ -1,29 +1,57 @@ #!BPY """ Registration info for Blender menus: <- these words are ignored -Name: 'Dispaint' -Blender: 234 +Name: 'dispaint' +Blender: 233 Group: 'Mesh' -Tip: 'Use vertex paint color value to modify shape displacing vertices along normal' +Tip: 'use vertex paint color value to modify shape displacing vertices along normal' +""" + +__author__ = "Jean-Michel Soler (jms)" +__url__ = ("blender", "elysiun", +"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_displacementpainting.htm", +"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender") +__version__ = "233i" + +__bpydoc__ = """\ +This script displaces mesh vertices according to vertex color values. + +Usage: + +Select the mesh, enter Edit Mode and run this script to open its GUI. Options +include setting mode, orientation, size and number of repetitions of the +displacement. You can enter Vertex Paint mode and alternate applying +displacements and painting parts of the mesh. + +Orientation includes vertex normals, local coordinates and noise (you may need +to resize the scripts window to view the noise menu below the "Last Error:" +line. This menu lets you define noise type from the many options available in +Blender. + +Notes:<br> + The "Create" button will make at any time a copy of the active mesh in its +current state, so you can keep it and continue working on the copy;<br> + One of the great possible uses of this script is to "raise" terrain from a +subdivided plane, for example, with good control of the process by setting +options, defining orientation and alternating vertex painting with +displacements. """ -# $Id$ -# #---------------------------------------------- # jm soler, displacement paint 03/2002 - > 05/2004: disp_paintf # Terrain Noise added suugered by Jimmy Haze #---------------------------------------------- # Page officielle : -# http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_displacementpainting.htm +# http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_displacementpainting.htm # Communiquer les problemes et erreurs sur: -# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender -# -------------------------------------------------------------------------- +# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender +#--------------------------------------------- # ce script est proposé sous licence GPL pour etre associe # a la distribution de Blender 2.33 -# -------------------------------------------------------------------------- +#---------------------------------------------- # this script is released under GPL licence # for the Blender 2.33 scripts package -# -------------------------------------------------------------------------- +#---------------------------------------------- # ***** BEGIN GPL LICENSE BLOCK ***** # # Copyright (C) 2003, 2004: Jean-Michel Soler @@ -46,6 +74,7 @@ Tip: 'Use vertex paint color value to modify shape displacing vertices along nor # -------------------------------------------------------------------------- # 09/07/04 : Noise functions based on a piece of script by Jimmy Haze. # -------------------------------------------------------------------------- + import Blender from Blender import * from Blender.Draw import * @@ -74,6 +103,31 @@ NEWName='' ERROR=0 TextERROR='' +E_EXIT = 1 +E_MODE = 2 +E_ORIENT = 3 +E_NSIZE = 4 +E_REPEAT = 5 +E_ACTION = 16 +E_CREATE = 17 +E_DOCMAT = 24 +E_MATVAL = [32,33,34,35,36,37,38,39,40,41,42,43,44] +E_AXESEL = 45 +E_AXESELX = 46 +E_AXESELY = 47 +E_AXESELZ = 48 + +E_NOISEME = 49 +E_NOISEH = 50 +E_NOISELAC = 51 +E_NOISEOCT = 52 +E_NOISEOFF = 53 +E_NOISEBAS = 54 +E_NOISEVAL=[E_NOISEH,E_NOISELAC,E_NOISEOCT,E_NOISEOFF,E_NOISEBAS] +E_NOISEDIM = 55 + + + def copy_transform(ozero,Obis): Obis.setSize(ozero.getSize()); Obis.setEuler(ozero.getEuler()); @@ -81,7 +135,7 @@ def copy_transform(ozero,Obis): return Obis def traite_face(f): - global vindexm, ng, NOISE + global vindexm, ng, NOISE, NOISEDIM global H,lacunarity,octaves,offset,basis if ORIENTMenu.val==1: @@ -111,10 +165,10 @@ def traite_face(f): for z in range(len(f.v)): c=0.0 if vindex[f.v[z].index]!=0: - nx=f.v[z].co[0]/4 - ny=f.v[z].co[1]/4 - nz=f.v[z].co[2]/4 - nn = ng + noise((nx,ny,nz),NOISE) + nx=f.v[z].co[0]/NOISEDIM + ny=f.v[z].co[1]/NOISEDIM + nz=f.v[z].co[2]/NOISEDIM + nn = ng * noise((nx,ny,nz),NOISE) c=float(f.col[z].r+f.col[z].b+f.col[z].g)/maxcol*nn/vindex[f.v[z].index] else: c=0 @@ -126,10 +180,10 @@ def traite_face(f): for z in range(len(f.v)): c=0.0 if vindex[f.v[z].index]!=0: - nx=f.v[z].co[0]/4 - ny=f.v[z].co[1]/4 - nz=f.v[z].co[2]/4 - nn = ng + cellNoise((nx,ny,nz)) + nx=f.v[z].co[0]/NOISEDIM + ny=f.v[z].co[1]/NOISEDIM + nz=f.v[z].co[2]/NOISEDIM + nn = ng * cellNoise((nx,ny,nz)) c=float(f.col[z].r+f.col[z].b+f.col[z].g)/maxcol*nn/vindex[f.v[z].index] else: c=0 @@ -141,10 +195,10 @@ def traite_face(f): for z in range(len(f.v)): c=0.0 if vindex[f.v[z].index]!=0: - nx=f.v[z].co[0]/4 - ny=f.v[z].co[1]/4 - nz=f.v[z].co[2]/4 - nn = ng + heteroTerrain((nx,ny,nz),H,lacunarity,octaves,offset,basis) + nx=f.v[z].co[0]/NOISEDIM + ny=f.v[z].co[1]/NOISEDIM + nz=f.v[z].co[2]/NOISEDIM + nn = ng * heteroTerrain((nx,ny,nz),H,lacunarity,octaves,offset,basis) c=float(f.col[z].r+f.col[z].b+f.col[z].g)/maxcol*nn/vindex[f.v[z].index] else: c=0 @@ -154,68 +208,60 @@ def traite_face(f): def paint(): - global MODEMenu, vindex,ng, mat, ORIName, NEWName + global MODEMenu, vindex,ng, mat, ORIName, NEWName + global ERROR, TextERROR + Me=Object.GetSelected() if Me!=[]: if Me[0].getType()=='Mesh': - + vindex=[] ORIName=Me[0].getData().name - me1=NMesh.GetRaw(Me[0].getData().name) - - try: - o=Object.Get('newMESH') - me=o.getData() - me=me1 - + me=NMesh.GetRaw(Me[0].getData().name) + + try: + for m in me.verts: + vindex.append(0) + + for f in me.faces: + for v in f.v: + if MODEMenu.val!=2: + if MODEMenu.val==1: + vindex[v.index]+=1 + else: + if v.sel==1: + vindex[v.index]+=1 + else: + #print mat + if f.mat in mat: + vindex[v.index]+=1 + for f in me.faces: + if MODEMenu.val==2: + if f.mat in mat: + traite_face(f) + else: + traite_face(f) + Me[0].link(me) + Me[0].makeDisplayList() except: - o=Object.New('Mesh','newMESH') - sc.link(o) - me=me1 - - name='new.002' - - for m in me.verts: - vindex.append(0) - - for f in me.faces: - for v in f.v: - if MODEMenu.val!=2: - if MODEMenu.val==1: - vindex[v.index]+=1 - else: - if v.sel==1: - vindex[v.index]+=1 - else: - #print mat - if f.mat in mat: - vindex[v.index]+=1 - for f in me.faces: - if MODEMenu.val==2: - if f.mat in mat: - traite_face(f) - else: - traite_face(f) - - - Me[0].link(me) - #o=copy_transform(Me[0],o) - -def NEWMEcreation(name): - nomdelobjet=""; objnumber=-1; namelist=[] - obj=Object.Get() - - for ozero in obj: - if ozero.getType()=='Mesh': - namelist.append(ozero.getData().name) - if ozero.getData().name==name: - objnumber=obj.index(ozero) - - if objnumber!=-1: - ozero=obj[objnumber] + ERROR=2 + TextERROR='No color on this Object.' + +def NEWMEcreation(obj): + + if obj.getType()=='Mesh': + nomdelobjet=""; + objnumber=-1; namelist=[] + OBJ=Object.Get() + + for ozero in OBJ: + if ozero.getType()=='Mesh': + namelist.append(ozero.getData().name) + + ozero=obj nomdelobjet=ozero.getName() Mesh=Blender.NMesh.GetRawFromObject(nomdelobjet) - + name=obj.getData().name n=0; name2=name[:];ok=0 while ok==0: @@ -224,6 +270,7 @@ def NEWMEcreation(name): ok=0;name2=name[0:name.find('.')+1]+'%s'%(n+1) else: ok=1 n+=1 + Mesh.name=name2 Obis = Blender.NMesh.PutRaw(Mesh,name2) copy_transform(ozero,Obis) @@ -265,12 +312,26 @@ octaves=5.0 offset=1.0 basis=3 +NOISEDIM=4 +NOISEDIMbout=Create(NOISEDIM) HBout=Create(H) lacunarityBout=Create(lacunarity) octavesBout=Create(octaves) offsetBout=Create(offset) basisBout=Create(basis) + +noiseTYPE={0:'BLENDER', + 1:'STDPERLIN', + 2:'STDPERLIN', + 3:'NEWPERLIN', + 4:'VORONOI_F1', + 5:'VORONOI_F2', + 6:'VORONOI_F3', + 7:'VORONOI_F2F1', + 8:'VORONOI_CRACKLE', + 9:'CELLNOISE'} + TMATList= [0,[],[]] for t in range(16): @@ -291,8 +352,9 @@ glRct=glRectf def draw(): global MODEMenu, NSIZE, TDOCMat,TMATList, TAXEList global mat, ORIName, NEWName, ORIENTMenu - global NRepeat, ERROR, TextERROR , NOISE, NOISEMenu + global NRepeat, ERROR, TextERROR , NOISE, NOISEMenu, NOISEDIMbout,NOISEDIM global HBout,lacunarityBout,octavesBout,offsetBout,basisBout + global noiseTYPE size=Buffer(GL_FLOAT, 4) glGetFloatv(GL_SCISSOR_BOX, size) @@ -307,7 +369,7 @@ def draw(): glColor3f(1.0,1.0,1.0) glRasterPos2f(20, size[3]-15) - Text("Script Python de displacement painting") + Text("Script Python de displacement paintingt") glRasterPos2f(20, size[3]-28) Text("Jean-michel Soler, juillet 2004") @@ -316,20 +378,20 @@ def draw(): n0=70 n1=55 - Button("Create" ,17 ,5 ,size[3]-n0+16 ,60 ,20) - Button("Action" ,16 ,5 ,size[3]-n0-4 ,60 ,20) - Button("Exit" ,1 ,5 ,size[3]-n0-24 ,60 ,20) + Button("Create" ,E_CREATE ,5 ,size[3]-n0+16 ,60 ,20) + Button("Action" ,E_ACTION ,5 ,size[3]-n0-4 ,60 ,20) + Button("Exit" ,E_EXIT ,5 ,size[3]-n0-24 ,60 ,20) - NRepeat=Number("repeat" ,5 ,5 ,size[3]-n0-50 ,75 ,20, NRepeat.val,1,10) + NRepeat=Number("repeat" ,E_REPEAT ,5 ,size[3]-n0-50 ,75 ,20, NRepeat.val,1,10) glColor3f(0.0,0.0,0.0) glRasterPos2f(80 ,size[3]-n0+24) Text("MODE") - MODEMenu= Menu(MOname, 2 ,80 ,size[3]-n0 ,100,20, MODEMenu.val, "MODE menu.") + MODEMenu= Menu(MOname, E_MODE ,80 ,size[3]-n0 ,100,20, MODEMenu.val, "MODE menu.") if MODEMenu.val==2: - TDOCMat=Toggle("Doc Mat" ,24 ,180 ,size[3]-n0 ,60 ,20,TDOCMat.val) + TDOCMat=Toggle("Doc Mat" ,E_DOCMAT ,180 ,size[3]-n0 ,60 ,20,TDOCMat.val) if TDOCMat.val==1: #print TMATList for t in range(TMATList[0]): @@ -341,9 +403,10 @@ def draw(): 80+t*40+40, size[3]-n0-60+40) TMATList[2][t]=Toggle("%s"%t , 32+t ,80+t*40+5 ,size[3]-n0-50 ,30 , 20,TMATList[2][t].val) + glColor3f(1.0,0.3,0.0) glRasterPos2f(80+40+5 ,size[3]-n0-80) - if ERROR==1: + if ERROR>1: Text('Last error : '+TextERROR) else: Text('Last error : ') @@ -351,54 +414,57 @@ def draw(): glColor3f(0.0,0.0,0.0) glRasterPos2f(240 ,size[3]-n0+24) Text("ORIENTATION") - ORIENTMenu= Menu(ORname, 3 ,240 ,size[3]-n0 ,100,20, ORIENTMenu.val, "ORIENT menu.") + ORIENTMenu= Menu(ORname, E_ORIENT ,240 ,size[3]-n0 ,100,20, ORIENTMenu.val, "ORIENT menu.") if ORIENTMenu.val==2 : for t in range(3): TAXEList[1][t]=Toggle("%s"%TAXEList[0][t], - 40+t, + E_AXESEL+t, 240+100+t*30 , size[3]-n0 ,30 , 20, TAXEList[1][t].val) if ORIENTMenu.val==3 : - glRasterPos2f(20 ,size[3]-n0-90+24) + glRasterPos2f(240 ,size[3]-n0-90-4) Text("NOISE") - NOISEMenu= Menu(NOname, 45 , 240 ,size[3]-n0-110 ,110,20, NOISEMenu.val, "NOISE menu.") + NOISEMenu= Menu(NOname, E_NOISEME , 240 ,size[3]-n0-118 ,110,20, NOISEMenu.val, "NOISE menu.") + NOISEDIMbout=Number(" Dim: " ,E_NOISEDIM , 240 ,size[3]-n0-138 ,110,20, NOISEDIMbout.val, 1,100) + if NOISEMenu.val==11: - HBout= Slider("H", 46 ,110 ,size[3]-n0-190 ,125,20, HBout.val, -2.0,+2.0,0,) - lacunarityBout=Slider("lacunarity",47 ,110 ,size[3]-n0-110 ,125,20, lacunarityBout.val, -4.0,+4.0,0,) - octavesBout=Slider("octave", 48 ,110 ,size[3]-n0-130 ,125,20, octavesBout.val, -10.0,+10.0,0,) - offsetBout=Slider("offset", 49 ,110 ,size[3]-n0-150 ,125,20, offsetBout.val, -5.0,+5.0,0,) - basisBout=Slider("noise", 50 ,110 ,size[3]-n0-170 ,125,20, basisBout.val, 0,9,0,) + basisBout=Slider(noiseTYPE[basisBout.val], + E_NOISEBAS ,40 ,size[3]-n0-118 ,175,20, basisBout.val, 0,9,) + HBout= Slider("H", E_NOISEH ,40 ,size[3]-n0-138 ,175,20, HBout.val, -2.0,+2.0,0,) + lacunarityBout=Slider("lacunarity", E_NOISELAC ,40 ,size[3]-n0-158 ,175,20, lacunarityBout.val, -4.0,+4.0,0,) + octavesBout=Slider("octave", E_NOISEOCT ,40 ,size[3]-n0-178 ,175,20, octavesBout.val, -10.0,+10.0,0,) + offsetBout=Slider("offset", E_NOISEOFF ,40 ,size[3]-n0-198 ,175,20, offsetBout.val, -5.0,+5.0,0,) - NSIZE= Slider("Disp Size", 4 ,80 ,size[3]-n0-20 ,260,20, NSIZE.val, -4.0,+4.0,0,"SIZE.") + NSIZE= Slider("Disp Size", E_NSIZE ,80 ,size[3]-n0-20 ,260,20, NSIZE.val, -4.0,+4.0,0,"SIZE.") def event(evt, val): - if ((evt== QKEY or evt== ESCKEY) and not val): Exit() + if (evt== QKEY and not val): Exit() def bevent(evt): global MODEMenu, NSIZE, ng, TMATList global mat, ORIENTMenu, NRepeat, TAXEList - global ERROR,TextERROR, NOISE, NOISEMenu + global ERROR,TextERROR, NOISE, NOISEMenu, NOISEDIMbout,NOISEDIM global HBout,lacunarityBout,octavesBout,offsetBout,basisBout global H,lacunarity,octaves,offset,basis - if (evt== 1): + if (evt== E_EXIT): Exit() - elif (evt== 16): + elif (evt== E_ACTION): for n in range(NRepeat.val): paint() - elif (evt== 4): + elif (evt== E_NSIZE): ng=NSIZE.val - elif (evt== 24) or (evt in [32,33,34,35,36,37,38,39,40,41,42,43,44]): + elif (evt== E_DOCMAT) or (evt in E_MATVAL): Me=Object.GetSelected() if Me!=[]: if Me[0].getType()=='Mesh': @@ -414,21 +480,29 @@ def bevent(evt): else: ERROR=1 TextERROR='No Selected Object.' - - elif (evt== 17): - NEWMEcreation('new.002') + - elif (evt== 45): + elif (evt== E_CREATE): + + NEWMEcreation(Blender.Object.GetSelected()[0]) + Blender.Draw.Redraw() + + ERROR=1 + TextERROR='No Selected Object.' + + elif (evt== E_NOISEME): NOISE=NOISEMenu.val-1 - elif (evt in [46,47,48,49, 50]): + elif (evt in E_NOISEVAL): H=HBout.val lacunarity=lacunarityBout.val octaves=octavesBout.val offset=offsetBout.val basis=basisBout.val - Blender.Redraw() + elif (evt== E_NOISEDIM): + NOISEDIM=NOISEDIMbout.val + + Blender.Draw.Redraw() -Window.EditMode(0) Register(draw, event, bevent) diff --git a/release/scripts/doc_browser.py b/release/scripts/doc_browser.py index e9c63b3d319..9c8d77caca6 100644 --- a/release/scripts/doc_browser.py +++ b/release/scripts/doc_browser.py @@ -7,6 +7,24 @@ Group: 'Misc' Tip: 'Browse BPython (scripting API) modules doc strings.' """ +__author__ = "Daniel Dunbar" +__url__ = ("blender", "elysiun") +__version__ = "1.0" +__bpydoc__ = """\ +The "Doc Browser" lets users navigate the documentation strings of part of +the Blender Python API. + +It doesn't give access yet to object method functions and variables, only to +module functions, but still it is a handy reference. Specially for quick +access, for example to Blender.BGL: the module that wraps OpenGL calls. + +Notes:<br> + Everyone interested in the bpython api is also invited to read "The Blender +Python API Reference" doc, available online ("Python Scripting Reference" +entry in Blender's Help menu). +""" + + # $Id$ # # -------------------------------------------------------------------------- diff --git a/release/scripts/fixfromarmature.py b/release/scripts/fixfromarmature.py index 4766b0b08f2..c60978831fc 100644 --- a/release/scripts/fixfromarmature.py +++ b/release/scripts/fixfromarmature.py @@ -4,7 +4,21 @@ Name: 'Fix From Armature' Blender: 232 Group: 'Mesh' -Tip: 'Fix armature deformation.' +Tip: 'Fix armature deformation' +""" + +__author__ = "Jean-Michel Soler (jms)" +__url__ = ("blender", "elysiun", +"Script's homepage, http://jmsoler.free.fr/util/blenderfile/py/fixfromarmature.py", +"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender") +__version__ = "10/2004" + +__bpydoc__ = """\ +This script creates a copy of the active mesh with armature deformation fixed. + +Usage: + +Select the mesh and run this script. A fixed copy of it will be created. """ # $Id$ @@ -21,19 +35,43 @@ Tip: 'Fix armature deformation.' # http://jmsoler.free.fr/util/blenderfile/py/fixfromarmature.py # Communiquer les problemes et erreurs sur: # http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender -#--------------------------------------------- +#--------------------------------------------- +# ce script est proposé sous licence GPL pour etre associe +# a la distribution de Blender 2.33 et suivant +# -------------------------------------------------------------------------- +# this script is released under GPL licence +# for the Blender 2.33 scripts package +# -------------------------------------------------------------------------- +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Script copyright (C) 2003, 2004: Jean-Michel Soler +# +# 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 try: - Ozero=Blender.Object.GetSelected()[0] - nomdelobjet=Ozero.getName() - Mesh=Blender.NMesh.GetRawFromObject(nomdelobjet) - Obis = Blender.Object.New ('Mesh') - Obis.link(Mesh) - Obis.setSize(Ozero.getSize()) - Obis.setEuler(Ozero.getEuler()) - Obis.setLocation(Ozero.getMatrix()[3][0:3]) - scene = Blender.Scene.getCurrent() - scene.link (Obis) + Ozero=Blender.Object.GetSelected()[0] + nomdelobjet=Ozero.getName() + Mesh=Blender.NMesh.GetRawFromObject(nomdelobjet) + Obis = Blender.Object.New ('Mesh') + Obis.link(Mesh) + Obis.setMatrix(Ozero.getMatrix()) + scene = Blender.Scene.getCurrent() + scene.link (Obis) except: - Blender.Draw.PupMenu("Error|Not a mesh or no object selected") + Blender.Draw.PupMenu("Error%t|Not a mesh or no object selected") diff --git a/release/scripts/help_browser.py b/release/scripts/help_browser.py new file mode 100644 index 00000000000..550a494c97b --- /dev/null +++ b/release/scripts/help_browser.py @@ -0,0 +1,753 @@ +#!BPY + +""" +Name: 'Scripts Help Browser' +Blender: 234 +Group: 'Help' +Tooltip: 'Show help information about a chosen installed script.' +""" + +__author__ = "Willian P. Germano" +__version__ = "0.1 11/02/04" +__email__ = ('scripts', 'Author, wgermano:ig*com*br') +__url__ = ('blender', 'elysiun') + +__bpydoc__ ="""\ +This script shows help information for scripts registered in the menus. + +Usage: + +- Start Screen: + +To read any script's "user manual" select a script from one of the +available category menus. If the script has help information in the format +expected by this Help Browser, it will be displayed in the Script Help +Screen. Otherwise you'll be offered the possibility of loading the chosen +script's source file in Blender's Text Editor. The programmer(s) may have +written useful comments there for users. + +Hotkeys:<br> + ESC or Q: [Q]uit + +- Script Help Screen: + +This screen shows the user manual page for the chosen script. If the text +doesn't fit completely on the screen, you can scroll it up or down with +arrow keys or a mouse wheel. There may be link and email buttons that if +clicked should open your default web browser and email client programs for +further information or support. + +Hotkeys:<br> + ESC: back to Start Screen<br> + Q: [Q]uit<br> + S: view script's [S]ource code in Text Editor<br> + UP, DOWN Arrows and mouse wheel: scroll text up / down +""" + +# $Id$ +# +# -------------------------------------------------------------------------- +# sysinfo.py version 0.1 Jun 09, 2004 +# -------------------------------------------------------------------------- +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Copyright (C) 2004: Willian P. Germano, wgermano _at_ ig.com.br +# +# 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 sys as bsys, Draw, Window + +WEBBROWSER = True +try: + import webbrowser +except: + WEBBROWSER = False + +DEFAULT_EMAILS = { + 'scripts': ['Bf-scripts-dev', 'bf-scripts-dev@blender.org'] +} + +DEFAULT_LINKS = { + 'blender': ["blender.org\'s Python forum", "http://www.blender.org/modules.php?op=modload&name=phpBB2&file=viewforum&f=9"], + 'elysiun': ["elYsiun\'s Python and Plugins forum", "http://www.elysiun.com/forum/viewforum.php?f=5"] +} + +PADDING = 15 +COLUMNS = 1 +TEXT_WRAP = 100 +WIN_W = WIN_H = 200 +SCROLL_DOWN = 0 + +def screen_was_resized(): + global WIN_W, WIN_H + + w, h = Window.GetAreaSize() + if WIN_W != w or WIN_H != h: + WIN_W = w + WIN_H = h + return True + return False + +def fit_on_screen(): + global TEXT_WRAP, PADDING, WIN_W, WIN_H, COLUMNS + + COLUMNS = 1 + WIN_W, WIN_H = Window.GetAreaSize() + TEXT_WRAP = int((WIN_W - PADDING) / 6) + if TEXT_WRAP < 40: + TEXT_WRAP = 40 + elif TEXT_WRAP > 100: + if TEXT_WRAP > 110: + COLUMNS = 2 + TEXT_WRAP /= 2 + else: TEXT_WRAP = 100 + +def cut_point(text, length): + "Returns position of the last space found before 'length' chars" + l = length + c = text[l] + while c != ' ': + l -= 1 + if l == 0: return length # no space found + c = text[l] + return l + +def text_wrap(text, length = None): + global TEXT_WRAP + + wrapped = [] + lines = text.split('<br>') + llen = len(lines) + if llen > 1: + if lines[-1] == '': llen -= 1 + for i in range(llen - 1): + lines[i] = lines[i].rstrip() + '<br>' + lines[llen-1] = lines[llen-1].rstrip() + + if not length: length = TEXT_WRAP + + for l in lines: + while len(l) > length: + cpt = cut_point(l, length) + line, l = l[:cpt], l[cpt + 1:] + wrapped.append(line) + wrapped.append(l) + return wrapped + +def load_script_text(script): + global PATHS, SCRIPT_INFO + + if script.userdir: + path = PATHS['uscripts'] + else: + path = PATHS['scripts'] + + fname = bsys.join(path, script.fname) + + source = Blender.Text.Load(fname) + if source: + Draw.PupMenu("File loaded%%t|Please check the file \"%s\" in the Text Editor window" % source.name) + + +# for theme colors: +def float_colors(cols): + return map(lambda x: x / 255.0, cols) + +# globals + +SCRIPT_INFO = None + +PATHS = { + 'home': Blender.Get('homedir'), + 'scripts': Blender.Get('scriptsdir'), + 'uscripts': Blender.Get('uscriptsdir') +} + +BPYMENUS_FILE = bsys.join(PATHS['home'], 'Bpymenus') + +f = file(BPYMENUS_FILE, 'r') +lines = f.readlines() +f.close() + +AllGroups = [] + +class Script: + + def __init__(self, data): + self.name = data[0] + self.version = data[1] + self.fname = data[2] + self.userdir = data[3] + self.tip = data[4] + +# End of class Script + + +class Group: + + def __init__(self, name): + self.name = name + self.scripts = [] + + def add_script(self, script): + self.scripts.append(script) + + def get_name(self): + return self.name + + def get_scripts(self): + return self.scripts + +# End of class Group + + +class BPy_Info: + + def __init__(self, script, dict): + + self.script = script + + self.d = dict + + self.header = [] + self.len_header = 0 + self.content = [] + self.len_content = 0 + self.spaces = 0 + self.fix_urls() + self.make_header() + self.wrap_lines() + + def make_header(self): + + sc = self.script + d = self.d + + header = self.header + + title = "Script: %s" % sc.name + version = "Version: %s for Blender %1.2f or newer" % (d['__version__'], + sc.version / 100.0) + + if len(d['__author__']) == 1: + asuffix = ':' + else: asuffix = 's:' + + authors = "%s%s %s" % ("Author", asuffix, ", ".join(d['__author__'])) + + header.append(title) + header.append(version) + header.append(authors) + self.len_header = len(header) + + + def fix_urls(self): + + emails = self.d['__email__'] + fixed = [] + for a in emails: + if a in DEFAULT_EMAILS.keys(): + fixed.append(DEFAULT_EMAILS[a]) + else: + a = a.replace('*','.').replace(':','@') + ltmp = a.split(',') + if len(ltmp) != 2: + ltmp = [ltmp[0], ltmp[0]] + fixed.append(ltmp) + + self.d['__email__'] = fixed + + links = self.d['__url__'] + fixed = [] + for a in links: + if a in DEFAULT_LINKS.keys(): + fixed.append(DEFAULT_LINKS[a]) + else: + ltmp = a.split(',') + if len(ltmp) != 2: + ltmp = [ltmp[0], ltmp[0]] + fixed.append([ltmp[0].strip(), ltmp[1].strip()]) + + self.d['__url__'] = fixed + + + def wrap_lines(self, reset = 0): + + lines = self.d['__bpydoc__'].split('\n') + self.content = [] + newlines = [] + newline = [] + + if reset: + self.len_content = 0 + self.spaces = 0 + + for l in lines: + if l == '' and newline: + newlines.append(newline) + newline = [] + newlines.append('') + else: newline.append(l) + if newline: newlines.append(newline) + + for lst in newlines: + wrapped = text_wrap(" ".join(lst)) + for l in wrapped: + self.content.append(l) + if l: self.len_content += 1 + else: self.spaces += 1 + + if not self.content[-1]: + self.len_content -= 1 + + +# End of class BPy_Info + +def parse_pyobj_close(closetag, lines, i): + i += 1 + l = lines[i] + while l.find(closetag) < 0: + i += 1 + l = "%s%s" % (l, lines[i]) + return [l, i] + +def parse_pyobj(var, lines, i): + "Bad code, was in a hurry for release" + + l = lines[i].replace(var, '').replace('=','',1).strip() + + i0 = i - 1 + + if l[0] == '"': + if l[1:3] == '""': # """ + if l.find('"""', 3) < 0: # multiline + l2, i = parse_pyobj_close('"""', lines, i) + if l[-1] == '\\': l = l[:-1] + l = "%s%s" % (l, l2) + elif l[-1] == '"' and l[-2] != '\\': # single line: "..." + pass + else: + l = "ERROR" + + elif l[0] == "'": + if l[-1] == '\\': + l2, i = parse_pyobj_close("'", lines, i) + l = "%s%s" % (l, l2) + elif l[-1] == "'" and l[-2] != '\\': # single line: '...' + pass + else: + l = "ERROR" + + elif l[0] == '(': + if l[-1] != ')': + l2, i = parse_pyobj_close(')', lines, i) + l = "%s%s" % (l, l2) + + elif l[0] == '[': + if l[-1] != ']': + l2, i = parse_pyobj_close(']', lines, i) + l = "%s%s" % (l, l2) + + return [l, i - i0] + +# helper functions: + +def parse_help_info(script): + + global PATHS, SCRIPT_INFO + + if script.userdir: + path = PATHS['uscripts'] + else: + path = PATHS['scripts'] + + fname = bsys.join(path, script.fname) + + if not bsys.exists(fname): + Draw.PupMenu('IO Error|Couldn\'t find script %s' % fname) + return None + + f = file(fname, 'r') + lines = f.readlines() + f.close() + + # fix line endings: + if lines[0].find('\r'): + unixlines = [] + for l in lines: + unixlines.append(l.replace('\r','')) + lines = unixlines + + llen = len(lines) + has_doc = 0 + + doc_data = { + '__author__': '', + '__version__': '', + '__url__': '', + '__email__': '', + '__bpydoc__': '', + '__doc__': '' + } + + i = 0 + while i < llen: + l = lines[i] + incr = 1 + for k in doc_data.keys(): + if l.find(k, 0, 20) == 0: + value, incr = parse_pyobj(k, lines, i) + exec("doc_data['%s'] = %s" % (k, value)) + has_doc = 1 + break + i += incr + + # fix these to seqs, simplifies coding elsewhere + for w in ['__author__', '__url__', '__email__']: + val = doc_data[w] + if val and type(val) == str: + doc_data[w] = [doc_data[w]] + + if not doc_data['__bpydoc__']: + if doc_data['__doc__']: + doc_data['__bpydoc__'] = doc_data['__doc__'] + + if has_doc: # any data, maybe should confirm at least doc/bpydoc + info = BPy_Info(script, doc_data) + SCRIPT_INFO = info + return True + + else: + return False + + +def parse_script_line(l): + + try: + pieces = l.split("'") + name = pieces[1].replace('...','') + version, fname, userdir = pieces[2].strip().split() + tip = pieces[3] + except: + return None + + return [name, int(version), fname, int(userdir), tip] + + +def parse_bpymenus(lines): + + global AllGroups + + llen = len(lines) + + for i in range(llen): + l = lines[i].strip() + if not l: continue + if l[-1] == '{': + group = Group(l[:-2]) + AllGroups.append(group) + i += 1 + l = lines[i].strip() + while l != '}': + if l[0] != '|': + data = parse_script_line(l) + if data: + script = Script(data) + group.add_script(script) + i += 1 + l = lines[i].strip() + + AllGroups.reverse() + + +def create_group_menus(): + + global AllGroups + menus = [] + + for group in AllGroups: + + name = group.get_name() + menu = [] + scripts = group.get_scripts() + for s in scripts: menu.append(s.name) + menu = "|".join(menu) + menu = "%s%%t|%s" % (name, menu) + menus.append([name, menu]) + + return menus + + +# Collecting data: +fit_on_screen() +parse_bpymenus(lines) +GROUP_MENUS = create_group_menus() + + +# GUI: + +from Blender import BGL +from Blender.Window import Theme + +# globals: + +START_SCREEN = 0 +SCRIPT_SCREEN = 1 + +SCREEN = START_SCREEN + +# gui buttons: +len_gmenus = len(GROUP_MENUS) + +BUT_GMENU = range(len_gmenus) +for i in range(len_gmenus): + BUT_GMENU[i] = Draw.Create(0) + +# events: +BEVT_LINK = None # range(len(SCRIPT_INFO.links)) +BEVT_EMAIL = None # range(len(SCRIPT_INFO.emails)) +BEVT_GMENU = range(100, len_gmenus + 100) +BEVT_VIEWSOURCE = 1 +BEVT_EXIT = 2 +BEVT_BACK = 3 + +# gui callbacks: + +def gui(): # drawing the screen + + global SCREEN, START_SCREEN, SCRIPT_SCREEN + global SCRIPT_INFO, AllGroups, GROUP_MENUS + global BEVT_EMAIL, BEVT_LINK + global BEVT_VIEWSOURCE, BEVT_EXIT, BEVT_BACK, BEVT_GMENU, BUT_GMENU + global PADDING, WIN_W, WIN_H, SCROLL_DOWN, COLUMNS + + theme = Theme.Get()[0] + tui = theme.get('ui') + ttxt = theme.get('text') + + COL_BG = float_colors(ttxt.back) + COL_TXT = ttxt.text + COL_TXTHI = ttxt.text_hi + + BGL.glClearColor(COL_BG[0],COL_BG[1],COL_BG[2],COL_BG[3]) + BGL.glClear(BGL.GL_COLOR_BUFFER_BIT) + BGL.glColor3ub(COL_TXT[0],COL_TXT[1], COL_TXT[2]) + + resize = screen_was_resized() + if resize: fit_on_screen() + + if SCREEN == START_SCREEN: + x = PADDING + bw = 70 + bh = 25 + hincr = 50 + + butcolumns = (WIN_W - 2*x)/ bw + if butcolumns < 2: butcolumns = 2 + elif butcolumns > 7: butcolumns = 7 + + len_gm = len(GROUP_MENUS) + butlines = len_gm / butcolumns + if len_gm % butcolumns: butlines += 1 + + h = hincr * butlines + 20 + y = h + bh + + BGL.glColor3ub(COL_TXTHI[0],COL_TXTHI[1], COL_TXTHI[2]) + BGL.glRasterPos2i(x, y) + Draw.Text('Scripts Help Browser') + + y -= bh + + BGL.glColor3ub(COL_TXT[0],COL_TXT[1], COL_TXT[2]) + + i = 0 + j = 0 + for group_menu in GROUP_MENUS: + BGL.glRasterPos2i(x, y) + Draw.Text(group_menu[0]+':') + BUT_GMENU[j] = Draw.Menu(group_menu[1], BEVT_GMENU[j], + x, y-bh-5, bw, bh, 0, + 'Choose a script to read its help information') + if i == butcolumns - 1: + x = PADDING + i = 0 + y -= hincr + else: + i += 1 + x += bw + 3 + j += 1 + + x = PADDING + y = 10 + BGL.glRasterPos2i(x, y) + Draw.Text('Select script for its help. Press Q or ESC to leave.') + + elif SCREEN == SCRIPT_SCREEN: + if SCRIPT_INFO: + + if resize: + SCRIPT_INFO.wrap_lines(1) + SCROLL_DOWN = 0 + + h = 18 * SCRIPT_INFO.len_content + 12 * SCRIPT_INFO.spaces + x = PADDING + y = WIN_H + bw = 38 + bh = 16 + + BGL.glColor3ub(COL_TXTHI[0],COL_TXTHI[1], COL_TXTHI[2]) + for line in SCRIPT_INFO.header: + y -= 18 + BGL.glRasterPos2i(x, y) + size = Draw.Text(line) + + for line in text_wrap('Tooltip: %s' % SCRIPT_INFO.script.tip): + y -= 18 + BGL.glRasterPos2i(x, y) + size = Draw.Text(line) + + i = 0 + y -= 28 + for data in SCRIPT_INFO.d['__url__']: + Draw.PushButton('link %d' % (i + 1), BEVT_LINK[i], + x + i*bw, y, bw, bh, data[0]) + i += 1 + y -= bh + 1 + + i = 0 + for data in SCRIPT_INFO.d['__email__']: + Draw.PushButton('email', BEVT_EMAIL[i], x + i*bw, y, bw, bh, data[0]) + i += 1 + y -= 18 + + y0 = y + BGL.glColor3ub(COL_TXT[0],COL_TXT[1], COL_TXT[2]) + for line in SCRIPT_INFO.content[SCROLL_DOWN:]: + if line: + line = line.replace('<br>', '') + BGL.glRasterPos2i(x, y) + Draw.Text(line) + y -= 18 + else: y -= 12 + if y < PADDING + 20: # reached end, either stop or go to 2nd column + if COLUMNS == 1: break + elif x == PADDING: # make sure we're still in column 1 + x = 6*TEXT_WRAP + PADDING / 2 + y = y0 + + x = PADDING + Draw.PushButton('source', BEVT_VIEWSOURCE, x, 17, 45, bh, + 'View this script\'s source code in the Text Editor (hotkey: S)') + Draw.PushButton('exit', BEVT_EXIT, x + 45, 17, 45, bh, + 'Exit from Scripts Help Browser (hotkey: Q)') + Draw.PushButton('back', BEVT_BACK, x + 2*45, 17, 45, bh, + 'Back to scripts selection screen (hotkey: ESC)') + BGL.glColor3ub(COL_TXTHI[0],COL_TXTHI[1], COL_TXTHI[2]) + BGL.glRasterPos2i(x, 5) + Draw.Text('use the arrow keys or the mouse wheel to scroll text', 'small') + +def fit_scroll(): + global SCROLL_DOWN + if not SCRIPT_INFO: + SCROLL_DOWN = 0 + return + max = SCRIPT_INFO.len_content + SCRIPT_INFO.spaces - 1 + if SCROLL_DOWN > max: SCROLL_DOWN = max + if SCROLL_DOWN < 0: SCROLL_DOWN = 0 + + +def event(evt, val): # input events + + global SCREEN, START_SCREEN, SCRIPT_SCREEN + global SCROLL_DOWN + + if not val: return + + if evt == Draw.ESCKEY: + if SCREEN == START_SCREEN: Draw.Exit() + else: + SCREEN = START_SCREEN + SCROLL_DOWN = 0 + Draw.Redraw() + return + elif evt == Draw.QKEY: + Draw.Exit() + return + elif evt in [Draw.DOWNARROWKEY, Draw.WHEELDOWNMOUSE] and SCREEN == SCRIPT_SCREEN: + SCROLL_DOWN += 1 + fit_scroll() + Draw.Redraw() + return + elif evt in [Draw.UPARROWKEY, Draw.WHEELUPMOUSE] and SCREEN == SCRIPT_SCREEN: + SCROLL_DOWN -= 1 + fit_scroll() + Draw.Redraw() + return + elif evt == Draw.SKEY: + if SCREEN == SCRIPT_SCREEN and SCRIPT_INFO: + load_script_text(SCRIPT_INFO.script) + return + +def button_event(evt): # gui button events + + global SCREEN, START_SCREEN, SCRIPT_SCREEN + global BEVT_LINK, BEVT_EMAIL, BEVT_GMENU, BUT_GMENU, SCRIPT_INFO + global SCROLL_DOWN + + if evt >= 100: # group menus + for i in range(len(BUT_GMENU)): + if evt == BEVT_GMENU[i]: + group = AllGroups[i] + index = BUT_GMENU[i].val - 1 + if index < 0: return # user didn't pick a menu entry + script = group.get_scripts()[BUT_GMENU[i].val - 1] + if parse_help_info(script): + SCREEN = SCRIPT_SCREEN + BEVT_LINK = range(20, len(SCRIPT_INFO.d['__url__']) + 20) + BEVT_EMAIL = range(50, len(SCRIPT_INFO.d['__email__']) + 50) + Draw.Redraw() + else: + res = Draw.PupMenu("No help available%t|View Source|Cancel") + if res == 1: + load_script_text(script) + elif evt >= 20: + if not WEBBROWSER: + Draw.PupMenu('Missing standard Python module%t|You need module "webbrowser" to access the web') + return + + if evt >= 50: # script screen email buttons + email = SCRIPT_INFO.d['__email__'][evt - 50][1] + webbrowser.open("mailto:%s" % email) + else: # >= 20: script screen link buttons + link = SCRIPT_INFO.d['__url__'][evt - 20][1] + webbrowser.open(link) + elif evt == BEVT_VIEWSOURCE: + if SCREEN == SCRIPT_SCREEN: load_script_text(SCRIPT_INFO.script) + elif evt == BEVT_EXIT: + Draw.Exit() + return + elif evt == BEVT_BACK: + if SCREEN == SCRIPT_SCREEN: + SCREEN = START_SCREEN + SCRIPT_INFO = None + SCROLL_DOWN = 0 + Draw.Redraw() + +Draw.Register(gui, event, button_event) diff --git a/release/scripts/help_getting_started.py b/release/scripts/help_getting_started.py index 1706f5b2f67..19eac9e2e20 100644 --- a/release/scripts/help_getting_started.py +++ b/release/scripts/help_getting_started.py @@ -6,6 +6,16 @@ Group: 'Help' Tooltip: 'Help for new users' """ +__author__ = "Matt Ebb" +__url__ = ("blender", "elysiun") +__version__ = "1.0" +__bpydoc__ = """\ +This script opens the user's default web browser at www.blender3d.org's +"Getting Started" page. +""" + +# $Id$ +# # -------------------------------------------------------------------------- # Getting Started Help Menu Item # -------------------------------------------------------------------------- @@ -30,4 +40,4 @@ Tooltip: 'Help for new users' import Blender, webbrowser version = str(Blender.Get('version')) -webbrowser.open('http://www.blender3d.org/Help/?pg=GettingStarted&ver=' + version)
\ No newline at end of file +webbrowser.open('http://www.blender3d.org/Help/?pg=GettingStarted&ver=' + version) diff --git a/release/scripts/help_manual.py b/release/scripts/help_manual.py index 51bccf07869..75d93522c31 100644 --- a/release/scripts/help_manual.py +++ b/release/scripts/help_manual.py @@ -6,6 +6,14 @@ Group: 'Help' Tooltip: 'The Blender reference manual' """ +__author__ = "Matt Ebb" +__url__ = ("blender", "elysiun") +__version__ = "1.0" +__bpydoc__ = """\ +This script opens the user's default web browser at www.blender3d.org's +"Blender Manual" page. +""" + # -------------------------------------------------------------------------- # Manual Help Menu Item # -------------------------------------------------------------------------- @@ -30,4 +38,4 @@ Tooltip: 'The Blender reference manual' import Blender, webbrowser version = str(Blender.Get('version')) -webbrowser.open('http://www.blender3d.org/Help/?pg=Manual&ver=' + version)
\ No newline at end of file +webbrowser.open('http://www.blender3d.org/Help/?pg=Manual&ver=' + version) diff --git a/release/scripts/help_py_reference.py b/release/scripts/help_py_reference.py index 1f9b5836e23..54ff227ea49 100644 --- a/release/scripts/help_py_reference.py +++ b/release/scripts/help_py_reference.py @@ -6,6 +6,15 @@ Group: 'Help' Tooltip: 'Documentation for using the Blender Python API' """ +__author__ = "Matt Ebb" +__url__ = ("blender", "elysiun") +__version__ = "1.0" +__bpydoc__ = """\ +This script opens the user's default web browser at www.blender3d.org's +"Blender Python API Reference" page. +""" + + # -------------------------------------------------------------------------- # Python Scripting Reference Help Menu Item # -------------------------------------------------------------------------- @@ -30,4 +39,4 @@ Tooltip: 'Documentation for using the Blender Python API' import Blender, webbrowser version = str(Blender.Get('version')) -webbrowser.open('http://www.blender3d.org/Help/?pg=PyReference&ver=' + version)
\ No newline at end of file +webbrowser.open('http://www.blender3d.org/Help/?pg=PyReference&ver=' + version) diff --git a/release/scripts/help_release_notes.py b/release/scripts/help_release_notes.py index 6095a8c5911..49382755163 100644 --- a/release/scripts/help_release_notes.py +++ b/release/scripts/help_release_notes.py @@ -6,6 +6,14 @@ Group: 'Help' Tooltip: 'Information about the changes in this version of Blender' """ +__author__ = "Matt Ebb" +__url__ = ("blender", "elysiun") +__version__ = "1.0" +__bpydoc__ = """\ +This script opens the user's default web browser at www.blender3d.org's +"Release Notes" page. +""" + # -------------------------------------------------------------------------- # Release Notes Help Menu Item # -------------------------------------------------------------------------- @@ -30,4 +38,4 @@ Tooltip: 'Information about the changes in this version of Blender' import Blender, webbrowser version = str(Blender.Get('version')) -webbrowser.open('http://www.blender3d.org/Help/?pg=ReleaseNotes&ver=' + version)
\ No newline at end of file +webbrowser.open('http://www.blender3d.org/Help/?pg=ReleaseNotes&ver=' + version) diff --git a/release/scripts/help_tutorials.py b/release/scripts/help_tutorials.py index 8a48271e276..1fbabc43eb6 100644 --- a/release/scripts/help_tutorials.py +++ b/release/scripts/help_tutorials.py @@ -7,6 +7,14 @@ Group: 'Help' Tooltip: 'Tutorials for learning to use Blender' """ +__author__ = "Matt Ebb" +__url__ = ("blender", "elysiun") +__version__ = "1.0" +__bpydoc__ = """\ +This script opens the user's default web browser at www.blender3d.org's +"Blender Tutorials" page. +""" + # -------------------------------------------------------------------------- # Tutorials Help Menu Item # -------------------------------------------------------------------------- @@ -31,4 +39,4 @@ Tooltip: 'Tutorials for learning to use Blender' import Blender, webbrowser version = str(Blender.Get('version')) -webbrowser.open('http://www.blender3d.org/Help/?pg=Tutorials&ver=' + version)
\ No newline at end of file +webbrowser.open('http://www.blender3d.org/Help/?pg=Tutorials&ver=' + version) diff --git a/release/scripts/help_web_blender.py b/release/scripts/help_web_blender.py index b422db19a2d..999746c1f9c 100644 --- a/release/scripts/help_web_blender.py +++ b/release/scripts/help_web_blender.py @@ -7,6 +7,15 @@ Group: 'HelpWebsites' Tooltip: 'The official Blender website' """ +__author__ = "Matt Ebb" +__url__ = ("blender", "elysiun") +__version__ = "1.0" +__bpydoc__ = """\ +This script opens the user's default web browser at Blender's main site, +www.blender3d.org. +""" + + # -------------------------------------------------------------------------- # Blender Website Help Menu -> Websites Item # -------------------------------------------------------------------------- @@ -30,4 +39,4 @@ Tooltip: 'The official Blender website' # -------------------------------------------------------------------------- import Blender, webbrowser -webbrowser.open('http://www.blender3d.org/')
\ No newline at end of file +webbrowser.open('http://www.blender3d.org/') diff --git a/release/scripts/help_web_devcomm.py b/release/scripts/help_web_devcomm.py index b572486d64c..afe9ef064d9 100644 --- a/release/scripts/help_web_devcomm.py +++ b/release/scripts/help_web_devcomm.py @@ -7,6 +7,14 @@ Group: 'HelpWebsites' Tooltip: 'Get involved with Blender development' """ +__author__ = "Matt Ebb" +__url__ = ("blender", "elysiun") +__version__ = "1.0" +__bpydoc__ = """\ +This script opens the user's default web browser at www.blender.org, the +Blender development portal. +""" + # -------------------------------------------------------------------------- # Blender Website Help Menu -> Websites Item # -------------------------------------------------------------------------- @@ -30,4 +38,4 @@ Tooltip: 'Get involved with Blender development' # -------------------------------------------------------------------------- import webbrowser -webbrowser.open('http://www.blender.org')
\ No newline at end of file +webbrowser.open('http://www.blender.org') diff --git a/release/scripts/help_web_eshop.py b/release/scripts/help_web_eshop.py index 0ce92ab49b0..997d07ca255 100644 --- a/release/scripts/help_web_eshop.py +++ b/release/scripts/help_web_eshop.py @@ -7,6 +7,14 @@ Group: 'HelpWebsites' Tooltip: 'Buy official Blender resources and merchandise online' """ +__author__ = "Matt Ebb" +__url__ = ("blender", "elysiun") +__version__ = "1.0" +__bpydoc__ = """\ +This script opens the user's default web browser at www.blender3d.org's +"E-Shop" section. +""" + # -------------------------------------------------------------------------- # Blender Website Help Menu -> Websites Item # -------------------------------------------------------------------------- @@ -30,4 +38,4 @@ Tooltip: 'Buy official Blender resources and merchandise online' # -------------------------------------------------------------------------- import Blender, webbrowser -webbrowser.open('http://www.blender3d.org/e-shop')
\ No newline at end of file +webbrowser.open('http://www.blender3d.org/e-shop') diff --git a/release/scripts/help_web_usercomm.py b/release/scripts/help_web_usercomm.py index a6b31dbf977..56f64764ac7 100644 --- a/release/scripts/help_web_usercomm.py +++ b/release/scripts/help_web_usercomm.py @@ -7,6 +7,14 @@ Group: 'HelpWebsites' Tooltip: 'Get involved with other Blender users' """ +__author__ = "Matt Ebb" +__url__ = ("blender", "elysiun") +__version__ = "1.0" +__bpydoc__ = """\ +This script opens the user's default web browser at www.blender3d.org's +"User Community" page. +""" + # -------------------------------------------------------------------------- # Blender Website Help Menu -> Websites Item # -------------------------------------------------------------------------- @@ -30,4 +38,4 @@ Tooltip: 'Get involved with other Blender users' # -------------------------------------------------------------------------- import webbrowser -webbrowser.open('http://www.blender3d.org/Community')
\ No newline at end of file +webbrowser.open('http://www.blender3d.org/Community') diff --git a/release/scripts/hotkeys.py b/release/scripts/hotkeys.py index 859c38ba10e..ca2ef1689cb 100644 --- a/release/scripts/hotkeys.py +++ b/release/scripts/hotkeys.py @@ -1,15 +1,33 @@ #!BPY """ Registration info for Blender menus: -Name: 'Hotkey Reference' +Name: 'HotKey and MouseAction Reference' Blender: 232 Group: 'Help' -Tip: 'All the hotkeys' +Tip: 'All the hotkeys/short keys' """ + +__author__ = "Jean-Michel Soler (jms)" +__url__ = ("blender", "elysiun", +"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_hotkeyscript.htm", +"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender") +__version__ = "10/2004" + +__bpydoc__ = """\ +This script is a reference about all hotkeys and mouse actions in Blender. + +Usage: + +Open the script from the Help menu and select group of keys to browse. + +Notes:<br> + Additional entries in the database (c) 2004 by Bart. +""" + # $Id$ #------------------------ # Hotkeys script -# jm soler (2003) +# jm soler (2003-->10/2004) # ----------------------- # Page officielle : # http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_hotkeyscript.htm @@ -24,7 +42,8 @@ Tip: 'All the hotkeys' # -------------------------------------------------------------------------- # ***** BEGIN GPL LICENSE BLOCK ***** # -# Copyright (C) 2003, 2004: Jean-Michel Soler +# Script copyright (C) 2003, 2004: Jean-Michel Soler +# Additionnal entries in the original data base (c) 2004 by Bart (bart@neeneenee.de) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -50,205 +69,294 @@ from Blender.BGL import * hotkeys={ 'Specials 1 ':[ [',', 'Set Bounding Box rotation scaling pivot'], -['.', 'Set 3D cursor as rotation scaling pivot'] , -['~', 'Display all layers'] , -['Shift-~', 'Display all/previous layers'] , -['TAB', 'Enter/exit edit mode'] , +['Ctrl-,', 'Set Median Point rotation scaling pivot'], +['.', 'Set 3D cursor as rotation scaling pivot'], +['Ctrl-.', 'Set Individual Object Centers as rotation scaling pivot'] , +['~', 'Display all layers (German keys: ö)'], +['Shift-~', 'Display all/previous layers (German keys: Shift-ö)'], +['Space', 'Popup menu'], +['Space', '3D View: camera selected + fly mode, accept'], +['TAB', 'Enter/exit Edit Mode'], ['TAB', 'Edit Mode and Numerical Edit (see N key) : move to next input value'], -['TAB', 'Sequencer: Edit meta strip'] , -['CTRL-TAB', 'Enter/exit pose mode'] +['TAB', 'Sequencer: Edit meta strip'], +['TAB', 'IPO: Edit selected'], +['Ctrl-TAB', 'Enter/exit Pose Mode'], +['Shift-TAB', 'Enter Object Mode'], +['Ctrl-Open menu/', ''], +['Ctrl-Load Image', 'Opens a thumbnail browser instead of file browser for images'] ], - -'Specials 2 ':[ +'Mouse ':[ +['Actions:', ''], +['LMB', '3D View: Set 3D Cursor'], +['LMB', '3D View: camera selected + fly mode, move forward'], +['LMB drag', 'Border select circle: add to selection'], +['LMB hold down', 'Popup menu'], +['LMB hold down drag', 'Gesture'], +['Ctrl-LMB', 'IPO: Add key'], +['MMB', 'Rotate'], +['Ctrl-MMB', 'Zoom view'], +['Shift-MMB', 'Move view'], +['RMB', 'Select'], +['RMB drag', 'Border select circle: subtract from selection'], +['RMB hold down', 'Popup menu'], +['Alt+Ctrl-RMB', 'Edit Mode: Select edge'], +['Alt+Ctrl-RMB', 'UV Image Editor: Select face'], +['Shift-RMB', 'Add/subtract to/from selection'], +['Wheel', 'Zoom view'], +['Transformations:', ''], +['Drag+Ctrl', 'Step adjustment'], +['Drag+Ctrl+Shift', 'Small step adjustment'], +['Drag+Shift', 'Fine adjustment'], +['LMB', 'Confirm transformation'], +['MMB', 'Toggle optional transform feature'], +['RMB', 'Abort transformation'] +], +'F-Keys ':[ ['F1', 'Open File'], ['F2', 'Save File'], ['F3', 'Save image'], -['F4', 'Logic window (may change)'], -['F5', 'Material window'], -['F6', 'Texture window'], -['F7', 'Object window'], -['F8', 'World window'], -['F9', 'Edit Mode window'], +['F4', 'Logic Window (may change)'], +['F5', 'Material Window'], +['F6', 'Texture Window'], +['F7', 'Object Window'], +['F8', 'World Window'], +['F9', 'Edit Mode Window'], ['F10', 'Render Window'], ['F11', 'Recall the last rendered image'], ['F12', 'Render current Scene'], +['Ctrl-Shift-F12', 'NLA Editor'], ['Shift-F1', 'Library Data Select'], -['Shift-F4', 'Data Select '], -['Shift-F5', '3D window'], -['Shift-F6', 'IPO window'], -['Shift-F8', 'Video Sequencer window'], -['Shift-F9', 'OOP window'], -['Shift-F10', 'Image Window'] -] , - -'Numbers ':[ -['1..2..0-=', 'Show layer 1..2..12'] , -['ALT-1..2..0', 'Show layer 11..12..20'] , -['SHIFT-1..2..0-=', 'Toggle layer 1..2..12'] , -['SHIFT-ALT-...', 'Toggle layer 11..12..20'] ], - -'Numpad ':[ -['Numpad DEL', 'Zoom on object'] , -['Numpad /', 'Local view on object (hide others)'] , -['Numpad *', "Rotate view to object's local axes"] , -['Numpad +', 'Zoom in (works everywhere)'] , -['Numpad +', 'Proportional vertex edit mode: Increase range of influence'] , -['Numpad -', 'Zoom out (works everywhere)'] , -['Numpad -', 'Proportional vertex edit mode: Decrease range of influence'] , -['Numpad INS', 'Set Camera view'] , -['CTRL-Numpad INS', 'Set active object as camera'] , -['ALT-Numbad INS', 'Restore old camera'] , -['Numpad 1', 'Front view'] , -['CTRL-Numpad 1', 'Back view'] , -['Numpad 3', 'Right-Side view'] , -['CTRL-Numpad 3', 'Left-Side view'] , -['Numpad 7', 'Top view'] , -['CTRL-Numpad 7', 'Bottom view '] , -['Numpad 5', 'Toggle orthogonal // perspective view'] , -['Numpad 9', 'Redraw view'] , -['Numpad 2', 'Rotate view left'] , -['Numpad 6', 'Rotate view right'] , -['Numpad 8', 'Rotate view up'] , -['Numpad 2', 'Rotate view down'] ], +['Shift-F2', 'Export DXF'], +['Shift-F4', 'Object manager Data Select '], +['Shift-F5', '3D Window'], +['Shift-F6', 'IPO Window'], +['Shift-F7', 'Buttons Window'], +['Shift-F8', 'Video Sequencer Window'], +['Shift-F9', 'OOP Window'], +['Shift-F10', 'UV Image Editor'], +['Shift-F11', 'Text Editor'], +['Shift-F12', 'Action Editor'] +], + +'Numbers ':[ +['1..2..0-=', 'Show layer 1..2..12'], +['Alt-1..2..0', 'Show layer 11..12..20'], +['Shift-1..2..0-=', 'Toggle layer 1..2..12'], +['Shift-ALT-...', 'Toggle layer 11..12..20'] +], + +'Numpad ':[ +['Numpad DEL', 'Zoom on object'], +['Numpad /', 'Local view on object (hide others)'], +['Numpad *', 'Rotate view to objects local axes'], +['Numpad +', 'Zoom in (works everywhere)'], +['Numpad +', 'Proportional vertex Edit Mode: Increase range of influence'], +['Ctrl-Numpad +', 'Edit Mode: Select More vertices'], +['Numpad -', 'Zoom out (works everywhere)'], +['Numpad -', 'Proportional vertex Edit Mode: Decrease range of influence'], +['Ctrl-Numpad +', 'Edit Mode: Select Less vertices'], +['Numpad INS', 'Set Camera view'], +['Ctrl-Numpad INS', 'Set active object as camera'], +['Alt-Numbad INS', 'Restore old camera'], +['Numpad 1', 'Front view'], +['Ctrl-Numpad 1', 'Back view'], +['Numpad 3', 'Right view'], +['Ctrl-Numpad 3', 'Left view'], +['Numpad 7', 'Top view'], +['Ctrl-Numpad 7', 'Bottom view '], +['Numpad 5', 'Toggle orthogonal/perspective view'], +['Numpad 9', 'Redraw view'], +['Numpad 4', 'Rotate view left'], +['Numpad 6', 'Rotate view right'], +['Numpad 8', 'Rotate view up'], +['Numpad 2', 'Rotate view down'] +], 'Arrows ':[ -['PgUp', 'IPO: Select next keyframe'] , -['CTRL-PgUp', 'IPO: Select and jump to next keyframe'] , -['PgDn', 'IPO: Select previous keyframe'] , -['CTRL-PgDn', 'IPO: Select and jump to previous keyframe'] , -['LEFT', 'One frame backwards'] , -['RIGHT', 'One frame forwards'] , -['DOWN', '10 frames backwards'] , -['UP', '10 frames forwards'] ], +['Home/Pos1', 'View all'], +['PgUp', 'IPO: Select next keyframe'], +['Ctrl-PgUp', 'IPO: Select and jump to next keyframe'], +['PgDn', 'IPO: Select previous keyframe'], +['Ctrl-PgDn', 'IPO: Select and jump to previous keyframe'], +['Left', 'One frame backwards'], +['Right', 'One frame forwards'], +['Down', '10 frames backwards'], +['Up', '10 frames forwards'], +['Alt-Down', 'Blender in Window mode'], +['Alt-Up', 'Blender in Fullscreen mode'], +['Ctrl-Left', 'Previous screen'], +['Ctrl-Right', 'Next screen'], +['Ctrl-Down', 'Maximize window toggle'], +['Ctrl-Up', 'Maximize window toggle'], +['Shift-Arrow', 'Toggle first frame/ last frame'] +], 'Letters ':[ {"A":[ -['A', 'Select all / Deselect all'] , -['ALT-A', 'Animate current window'] , -['CTRL-A', "Apply object's size/rotation to object data"] , -['SHIFT-A', 'Sequencer: ADD menu'] , -['SHIFT-ALT-A', 'Animate all windows'] , -['SHIFT-CTRL-A', 'Apply lattice / Make dupliverts real']] , +['A', 'Select all/Deselect all'], +['Alt-A', 'Play animation in current window'], +['Ctrl-A', 'Apply objects size/rotation to object data'], +['Ctrl-A', 'Text Editor: Select all'], +['Shift-A', 'Sequencer: Add menu'], +['Shift-A', '3D-View: Add menu'], +['Shift-ALT-A', 'Play animation in all windows'], +['Shift-CTRL-A', 'Apply lattice / Make dupliverts real'] +], "B":[ -['B', 'Border select'] , -['BB', 'Circle select'] , -['SHIFT-B', 'Set render border'] ], +['B', 'Border select'], +['BB', 'Circle select'], +['Alt+B', 'Edit Mode: Select Vertex Loop'], +['Shift-B', 'Set render border (in active camera view)'] +], "C":[ -['C', 'Center view on cursor'] , -['C', 'Sequencer: Change images'] , -['C', 'IPO: Snap current frame to selected key'] , -['ALT-C', 'Convert menu'] , -['CTRL-C', 'Copy menu (Copy properties of active to selected objects)'] , -['SHIFT-C', 'Center and zoom view on selected objects']] , +['C', 'Center view on cursor'], +['C', 'UV Image Editor: Active Face Select toggle'], +['C', 'Sequencer: Change images'], +['C', 'IPO: Snap current frame to selected key'], +['Alt-C', 'Object Mode: Convert menu'], +['Alt-C', 'Text Editor: Copy selection to clipboard'], +['Ctrl-C', 'Copy menu (Copy properties of active to selected objects)'], +['Ctrl-C', 'UV Image Editor: Stick UVs to mesh vertex'], +['Shift-C', 'Center and zoom view on selected objects'], +['Shift-C', 'UV Image Editor: Stick local UVs to mesh vertex'] +], "D":[ -['D', 'Set 3d draw mode'] , -['ALT-D', 'Create new instance of object'] , -['CTRL-D', 'Display alpha of image texture as wire'] , -['SHIFT-D', 'Create full copy of object'] ], +['D', 'Set 3d draw mode'], +['Alt-D', 'Object Mode: Create new instance of object'], +['Ctrl-D', 'Display alpha of image texture as wire'], +['Shift-D', 'Create full copy of object'] +], "E":[ -['E', 'Extrude'], -['EX', 'Extrude along X axis'], -['EY', 'Extrude along Y axis'], -['EZ', 'Extrude along Z axis'], -['ALT-E', 'Edit mode: exit edit mode'],] , +['E', 'Edit Mode: Extrude'], +['E', 'UV Image Editor: LSCM Unwrap'], +['ER', 'Edit Mode: Extrude Rotate'], +['ES', 'Edit Mode: Extrude Scale'], +['ESX', 'Edit Mode: Extrude Scale X axis'], +['ESY', 'Edit Mode: Extrude Scale Y axis'], +['ESZ', 'Edit Mode: Extrude Scale Z axis'], +['EX', 'Edit Mode: Extrude along X axis'], +['EY', 'Edit Mode: Extrude along Y axis'], +['EZ', 'Edit Mode: Extrude along Z axis'], +['Alt-E', 'Edit Mode: exit Edit Mode'], +['Ctrl-E', 'Edit Mode: Edge Specials menu'], +['Shift-E', 'Edit Mode: SubSurf Edge Sharpness'] +], "F":[ -['F', 'Edit mode: Make edge/face'] , -['F', 'Sequencer: Set Filter Y'] , -['F', 'Faceselect mode'] , -['ALT-F', 'Beautify fill'] , -['CTRL-F', 'Sort faces in Z direction'] , -['CTRL-F', 'Edit mode: Flip triangle edges'] , -['SHIFT-F', 'Edit mode: Fill with triangles']] , +['F', 'Edit mode: Make edge/face'], +['F', 'Sequencer: Set Filter Y'], +['F', 'Object Mode: UV/Face Select mode'], +['Alt-F', 'Edit Mode: Beautify fill'], +['Ctrl-F', 'Object Mode: Sort faces in Z direction'], +['Ctrl-F', 'Edit Mode: Flip triangle edges'], +['Shift-F', 'Edit Mode: Fill with triangles'], +['Shift-F', 'Object Mode: active camera in fly mode (use LMB, RMB, Alt, Ctrl and Space too)'] +], "G":[ -['G', 'Grab (move)'] , -['ALT-G', 'Clear location'] , -['SHIFT-ALT-G', 'Remove selected objects from group'] , -['CTRL-G', 'Add selected objects to group'] , -['SHIFT-G', 'Group menu'] ], +['G', 'Grab (move)'], +['Alt-G', 'Clear location'], +['Shift-ALT-G', 'Remove selected objects from group'], +['Ctrl-G', 'Add selected objects to group'], +['Shift-G', 'Selected Group menu'] +], "H":[ -['H', 'Hide selected vertices/faces'] , -['H', 'Curves: Set handle type'] , -['ALT-H', 'Reveal vertices'] , -['CTRL-H', 'Curves: Automatic handle calculation'] , -['SHIFT-H', 'Hide deselected vertices'] , -['SHIFT-H', 'Curves: Set handle type']] , +['H', 'Hide selected vertices/faces'], +['H', 'Curves: Set handle type'], +['Alt-H', 'Show Hidden vertices/faces'], +['Ctrl-H', 'Curves: Automatic handle calculation'], +['Shift-H', 'Hide deselected vertices/faces'], +['Shift-H', 'Curves: Set handle type'] +], "I":[ -['I', 'Keyframe menu'] ], +['I', 'Keyframe menu'] +], "J":[ -['J', 'Mesh: Join all adjacent triangles to quads'] , -['J', 'Swap render page of render window'] , -['CTRL-J', 'Join selected objects'] , -['CTRL-J', 'Nurbs: Add segment'] , -['CTRL-J', 'IPO: Join keyframes menu'], -['ALT-J', 'Edit Mode: convert quads to triangles'] +['J', 'IPO: Join menu'], +['J', 'Mesh: Join all adjacent triangles to quads'], +['J', 'Render Window: Swap render buffer'], +['Ctrl-J', 'Join selected objects'], +['Ctrl-J', 'Nurbs: Add segment'], +['Ctrl-J', 'IPO: Join keyframes menu'], +['Alt-J', 'Edit Mode: convert quads to triangles'] ], "K":[ -['K', '3d window: Show keyframe positions'] , -['K', 'IPO: Show keyframe positions'] , -['K', 'Nurbs: Print knots'] , -['CTRL-K', 'Make skeleton from armature'] , -['SHIFT-K', 'Show and select all keyframes for object'] , -['SHIFT-K', 'Edit: Knife Mode select'], -['SHIFT-K', 'Faceselect: Clear vertexcolours'], -] , +['K', '3d Window: Show keyframe positions'], +['K', 'Edit Mode: Loop/Cut menu'], +['K', 'IPO: Show keyframe positions'], +['K', 'Nurbs: Print knots'], +['Ctrl-K', 'Make skeleton from armature'], +['Shift-K', 'Show and select all keyframes for object'], +['Shift-K', 'Edit Mode: Knife Mode select'], +['Shift-K', 'UV Face Select: Clear vertex colours'], +['Shift-K', 'Vertex Paint: Fill with vertex colours'] +], "L":[ -['L', 'Make local menu'] , -['L', 'Edit mode: Select linked vertices (near mouse pointer)'] , -['L', 'OOPS window: Select linked objects'] , -['CTRL-L', 'Make links menu'] , -['SHIFT-L', 'Select links menu'] ], +['L', 'Make local menu'], +['L', 'Edit mode: Select linked vertices (near mouse pointer)'], +['L', 'OOPS window: Select linked objects'], +['L', 'UV Face Select: Select linked faces'], +['Ctrl-L', 'Make links menu'], +['Shift-L', 'Select links menu'] +], "M":[ -['M', 'Move object to different layer'] , +['M', 'Move object to different layer'], ['M', 'Sequencer: Make meta strip (group) from selected strips'], -['ALT-M', 'Edit Mode: Merge vertices'] ], +['M', 'Edit Mode: Mirros Axis menu'], +['Alt-M', 'Edit Mode: Merge vertices menu'], +['Ctrl-M', 'Object Mode: Mirros Axis menu'] +], "N":[ -['N', 'Numeric input menu (Size/Rot/Loc)'] , +['N', 'Transform Properties panel'] , ['N', 'OOPS window: Rename object/linked objects'] , -['CTRL-N', 'Armature: Recalculate bone roll angles'] , -['CTRL-N', 'Recalculate normals to outside'] , -['CTRL-ALT-N', 'Recalculate normals to inside'] ], +['Ctrl-N', 'Armature: Recalculate bone roll angles'] , +['Ctrl-N', 'Edit Mode: Recalculate normals to outside'] , +['Ctrl-ALT-N', 'Edit Mode: Recalculate normals to inside'] ], "O":[ -['O', 'Edit mode: Toggle proportional vertex editing'] , -['ALT-O', 'Clear object origin'] , -['CTRL-O', 'Revert current file to last saved'] , -['SHIFT-O', 'Proportional vertex edit mode: Toggle smooth/steep falloff'] ], +['O', 'Edit Mode/UV Image Editor: Toggle proportional vertex editing'], +['Alt-O', 'Clear object origin'], +['Ctrl-O', 'Revert current file to last saved'], +['Shift-O', 'Proportional vertex Edit Mode: Toggle smooth/steep falloff'] +], "P":[ -['P', 'Start realtime engine'] , -['P', 'Edit mode: Seperate vertices to new object'] , -['ALT-P', 'Clear parent relationship'] , -['CTRL-P', 'Make active object parent of selected object'] , -['CTRL-SHIFT-P', 'Make active object parent of selected object without inverse'] , -['CTRL-P', 'Edit mode: Make active vertex parent of selected object'] ], +['P', 'Object Mode: Start realtime engine'], +['P', 'Edit mode: Seperate vertices to new object'], +['P', 'UV Image Editor: Pin UVs'], +['Alt-P', 'Clear parent relationship'], +['Alt-P', 'UV Image Editor: Unpin UVs'], +['Ctrl-P', 'Make active object parent of selected object'], +['Ctrl-SHIFT-P', 'Make active object parent of selected object without inverse'], +['Ctrl-P', 'Edit mode: Make active vertex parent of selected object'] +], "Q":[['Q', 'Quit'] ], "R":[ -['R', 'Rotate'] , -['R', 'IPO: Record mouse movement as IPO curve'] , -['RX', 'Rotate around X axis'] , -['RXX', "Rotate around object's local X axis"] , -['RY', 'Rotate around Y axis'] , -['RYY', "Rotate around object's local Y axis"] , -['RZ', 'Rotate around Z axis'] , -['RZZ', "Rotate around object's local Z axis"] , -['ALT-R', 'Clear object rotation'] , -['SHIFT-R', 'Nurbs: Select row'], -['CTRL-R', 'Edit Mode: Knife, cut selected edges, accept left mouse/ cancel right mouse'], -['SHIT-R', 'Edit Mode: loop Selection']], +['R', 'Rotate'], +['R', 'IPO: Record mouse movement as IPO curve'], +['R', 'UV Face Select: Rotate menu uv coords or vertex colour'], +['RX', 'Rotate around X axis'], +['RXX', "Rotate around object's local X axis"], +['RY', 'Rotate around Y axis'], +['RYY', "Rotate around object's local Y axis"], +['RZ', 'Rotate around Z axis'], +['RZZ', "Rotate around object's local Z axis"], +['Alt-R', 'Clear object rotation'], +['Ctrl-R', 'Edit Mode: Knife, cut selected edges, accept left mouse/ cancel right mouse'], +['Shift-R', 'Edit Mode: select Face Loop'], +['Shift-R', 'Nurbs: Select row'] ], "S":[ ['S', 'Scale'] , @@ -258,58 +366,69 @@ hotkeys={ ['SXX', 'Flip around X axis and show axis'] , ['SYY', 'Flip around Y axis and show axis'] , ['SZZ', 'Flip around Z axis and show axis'] , -['ALT-S', 'Edit mode: Shrink/fatten (Scale along vertex normals)'] , -['ALT-S', 'Clear object size'] , -['CTRL-S', 'Edit mode: Shear'] , -['SHIFT-S', 'Cursor/Grid snap menu'] ], +['Alt-S', 'Edit mode: Shrink/fatten (Scale along vertex normals)'] , +['Alt-S', 'Clear object size'] , +['Ctrl-S', 'Edit mode: Shear'] , +['Shift-S', 'Cursor/Grid snap menu'] ], "T":[ ['T', 'Sequencer: Touch and print selected movies'] , ['T', 'Adjust texture space'] , ['T', 'Edit mode: Flip 3d curve'] , ['T', 'IPO: Change IPO type'] , -['ALT-T', 'Clear tracking of object'] , -['CTRL-T', 'Make selected object track active object'] , -['CTRL-T', 'Mesh: Convert to triangles'] , -['CTRL-ALT-T', 'Blenchmark'] ], +['Alt-T', 'Clear tracking of object'] , +['Ctrl-T', 'Make selected object track active object'] , +['Ctrl-T', 'Edit Mode: Convert to triangles'] , +['Ctrl-ALT-T', 'Benchmark'] ], "U":[ ['U', 'Make single user menu'] , -['U', 'Edit mode: Reload object data from before entering edit mode'] , -['U', 'Faceselect mode: Automatic UV calculation menu'] , +['U', '3D View: Global undo'] , +['U', 'Edit Mode: Reload object data from before entering Edit Mode'] , +['U', 'UV Face Select: Automatic UV calculation menu'] , ['U', 'Vertex-/Weightpaint mode: Undo'] , -['CTRL-U', 'Save current state as user default'], -['SHIFT-U', 'EditMode : Redo Menu'], -['ALT-U', 'Edit Mode: Undo Menu'] - ], +['Ctrl-U', 'Save current state as user default'], +['Shift-U', 'Edit Mode: Redo Menu'], +['Alt-U', 'Edit Mode: Undo Menu'] ], "V":[ -['V', 'Curves/Nurbs: Vector handle'] , -['V', 'Vertexpaint mode'] , -['ALT-V', "Scale object to match image texture's aspect ratio"] , -['SHIFT-V', 'Edit mode: Align view to selected vertices'] ], +['V', 'Curves/Nurbs: Vector handle'], +['V', 'Vertexpaint mode'], +['V', 'UV Image Editor: Stitch UVs'], +['Alt-V', "Scale object to match image texture's aspect ratio"], +['Shift-V', 'Edit mode: Align view to selected vertices'], +['Shift-V', 'UV Image Editor: Limited Stitch UVs popup'], +], "W":[ -['W', 'Boolean operations menu'] , -['W', 'Edit mode: Specials menu'] , -['CTRL-W', 'Save current file'] , -['CTRL-W', 'Nurbs: Switch direction'] , -['SHIFT-W', 'Warp/bend selected vertices around cursor'] ] , +['W', 'Object Mode: Boolean operations menu'], +['W', 'Edit mode: Specials menu'], +['W', 'UV Image Editor: Weld/Align'], +['WX', 'UV Image Editor: Weld/Align X axis'], +['WY', 'UV Image Editor: Weld/Align Y axis'], +['Ctrl-W', 'Save current file'] , +['Ctrl-W', 'Nurbs: Switch direction'] , +['Shift-W', 'Warp/bend selected vertices around cursor'] ], "X":[ ['X', 'Delete menu'] , -['CTRL-X', 'Restore default state (Erase all)'] ], +['Ctrl-X', 'Restore default state (Erase all)'] ], "Y":[ ['Y', 'Mesh: Split selected vertices/faces from the rest'] ], "Z":[ +['Z', 'Render Window: 200% zoom from mouse position'], ['Z', 'Switch 3d draw type : solide/ wireframe (see also D)'], ['Alt-Z', 'Switch 3d draw type : solid / textured (see also D)'], +['Ctrl-Z', 'Switch 3d draw type : shaded (see also D)'], ['Shift-Z', 'Switch 3d draw type : shaded / wireframe (see also D)'], ]}]} +up=128 +down=129 +UP=0 for k in hotkeys.keys(): hotkeys[k].append(Create(0)) @@ -343,7 +462,7 @@ def trace_rectangle3(r,c,c1): glCl3(c1[0],c1[1],c1[2]) def draw(): - global r,c,c1,hotkeys, hot, hotL + global r,c,c1,hotkeys, hot, hotL, up, down, UP size=Buffer(GL_FLOAT, 4) glGetFloatv(GL_SCISSOR_BOX, size) @@ -351,76 +470,113 @@ def draw(): for s in [0,1,2,3]: size[s]=int(size[s]) - c=[0.9,0.95,0.95,0.0] - c1=[0.95,0.95,0.9,0.0] + c=[0.75,0.75,0.75,0] + c1=[0.6,0.6,0.6,0] r=[0,size[3],size[2],0] trace_rectangle4(r,c) - c=[0.7,0.7,0.9,0.0] + c=[0.64,0.64,0.64,0] c1=[0.95,0.95,0.9,0.0] - r=[0,size[3],size[2],size[3]-20] + r=[0,size[3],size[2],size[3]-40] trace_rectangle4(r,c) c1=[0.7,0.7,0.9,0.0] c=[0.2,0.2,0.4,0.0] - c2=[0.87,0.87,0.95,0.0] - - r=[0,size[3]-20,size[2],size[3]-44] - trace_rectangle4(r,c) + c2=[0.71,0.71,0.71,0.0] - glColor3f(0.1, 0.1, 0.15) - glRasterPos2f(10, size[3]-16) + glColor3f(1, 1, 1) + glRasterPos2f(42, size[3]-25) - Text("HotKey") + Text("HotKey and MouseAction Reference") l=0 listed=0 Llisted=0 + size[3]=size[3]-18 + for k in hot: - hotkeys[k][-1]=Toggle(k, hot.index(k)+10, 4+(20*26)/6*hot.index(k), size[3]-(40), len(k)*8, 20, hotkeys[k][-1].val ) + #hotkeys[k][-1]=Toggle(k, hot.index(k)+10, 4+(20*26)/6*hot.index(k), size[3]-(42), len(k)*8, 20, hotkeys[k][-1].val ) + hotkeys[k][-1]=Toggle(k, hot.index(k)+10, 78*hot.index(k), size[3]-(47), 78, 24, hotkeys[k][-1].val ) + l+=len(k) + if hotkeys[k][-1].val==1.0: listed=hot.index(k) - #print listed l=0 + size[3]=size[3]-4 if hot[listed]!='Letters ': - for n in hotkeys[hot[listed]][:-1]: + size[3]=size[3]-8 + SCROLL=size[3]/21 + END=-1 + if SCROLL < len(hotkeys[hot[listed]][:-1]): + Button('/\\',up,4,size[3]+8,20,14,'Scroll up') + Button('\\/',down,4,size[3]-8,20,14,'Scroll down') + if (SCROLL+UP)<len(hotkeys[hot[listed]][:-1]): + END=(UP+SCROLL) + else: + END=-1 + UP=len(hotkeys[hot[listed]][:-1])-SCROLL + else : + UP=0 + + for n in hotkeys[hot[listed]][:-1][UP:END]: + if l%2==0: - r=[4,size[3]-(18*l+66), - 8+(21*26), size[3]-(46+18*l)] + r=[0,size[3]-(21*l+66), + size[2], size[3]-(21*l+43)] trace_rectangle4(r,c2) - glColor3f(0.1, 0.1, 0.15) - glRasterPos2f(4+8, size[3]-(58+18*l)) + glColor3f(0,0,0) + glRasterPos2f(4+8, size[3]-(58+21*l)) Text(n[0]) - glRasterPos2f(4+8*15, size[3]-(58+18*l)) + glRasterPos2f(4+8*15, size[3]-(58+21*l)) Text(' : '+n[1]) l+=1 else: for k in hotL: pos=hotL.index(k) - hotkeys['Letters '][0][k][-1]=Toggle(k,pos+20,4+hotL.index(k)*21, size[3]-(52+18), 20, 20, hotkeys['Letters '][0][k][-1].val ) + hotkeys['Letters '][0][k][-1]=Toggle(k,pos+20,hotL.index(k)*21, size[3]-(52+18), 21, 18, hotkeys['Letters '][0][k][-1].val ) if hotkeys['Letters '][0][k][-1].val==1.0: Llisted=pos - for n in hotkeys['Letters '][0][hotL[Llisted]][:-1]: + + size[3]=size[3]-8 + + SCROLL=(size[3]-88)/21 + END=-1 + if SCROLL < len(hotkeys['Letters '][0][hotL[Llisted]]): + Button('/\\',up,4,size[3]+8,20,14,'Scroll up') + Button('\\/',down,4,size[3]-8,20,14,'Scroll down') + if (UP+SCROLL)<len(hotkeys['Letters '][0][hotL[Llisted]]): + END=(UP+SCROLL) + else: + END=-1 + UP=len(hotkeys['Letters '][0][hotL[Llisted]])-SCROLL + else : + UP=0 + + for n in hotkeys['Letters '][0][hotL[Llisted]][UP:END]: if l%2==0: - r=[4,size[3]-(18*l+92), - 8+(21*26), size[3]-(74+18*l)] + r=[4,size[3]-(21*l+92), + size[2], size[3]-(69+21*l+1)] trace_rectangle4(r,c2) + glColor3f(0.1, 0.1, 0.15) - glRasterPos2f(4+8, size[3]-(88+18*l)) + glRasterPos2f(4+8, (size[3]-(88+21*l))+3) Text(n[0]) - glRasterPos2f(4+8*15, size[3]-(88+18*l)) + glRasterPos2f(4+8*15, (size[3]-(88+21*l))+3) Text(' : '+n[1]) l+=1 def event(evt, val): - global hotkeys - if ((evt== QKEY or evt== ESCKEY) and not val): Exit() + global hotkeys, UP + if ((evt== QKEY or evt== ESCKEY) and not val): + Exit() + def bevent(evt): - global hotkeysmhot, hotL + global hotkeysmhot, hotL, up,down,UP + if (evt== 1): Exit() @@ -428,14 +584,22 @@ def bevent(evt): for k in hot: if hot.index(k)+10!=evt: hotkeys[k][-1].val=0 - + UP=0 Blender.Window.Redraw() elif (evt in range(20,46,1)): for k in hotL: if hotL.index(k)+20!=evt: hotkeys['Letters '][0][k][-1].val=0 - + UP=0 Blender.Window.Redraw() + elif (evt==up): + UP+=1 + Blender.Window.Redraw() + + elif (evt==down): + if UP>0: UP-=1 + Blender.Window.Redraw() + Register(draw, event, bevent) diff --git a/release/scripts/kloputils.py b/release/scripts/kloputils.py index 2d8cf3294c0..5ded017ed03 100644 --- a/release/scripts/kloputils.py +++ b/release/scripts/kloputils.py @@ -7,6 +7,70 @@ Group: 'Wizards' Tip: 'Set of object aligning, modifying tools' """ +__author__ = "Carlos López (klopez)" +__url__ = ("elysiun", "Author's web page, http://klopes.tk", +"Script's homepage, http://www.iespana.es/klopes/enchufes-guiri.htm", +"Thread on elYsiun with links to English and Spanish webpage and pdf docs,\ +http://www.elysiun.com/forum/viewtopic.php?t=25736") +__version__ = "3.1" + +__bpydoc__ = """\ +This Wizard script contains customizable tools to align and modify mesh +objects. + +Edited freely from a post by the author to elYsiun (last link button above): + +These tools are initially oriented as a help for the general design of objects +in 2D and 3D (architecture, industrial...), and this is the paradigm the +program will be developed around. + +The utilities in the program are separated in 4 areas, accessible through the +top menu in the GUI: + +- Alignment:<br> + + fitting an object between two others;<br> + + setting to an object the absolute size of another one;<br> + + aligning selected objects, according to several criteria: location, +rotation, scale (scale can be changed either additive or multiplicatively);<br> + + location separation can be referenced either by centers, baricenters, +origins or limits. + +- Object creation:<br> + + circunference passing through 3 points;<br> + + arc passing through 3 points;<br> + + arc based on angles and radius (interactive). + +- Mesh modification (affects vertices, faces and edges):<br> + + edges subdivision in any number of parts;<br> + + projection onto an arbitrary plane, in an arbitrary direction;<br> + + transformation of position, rotation, scale values (new matrix) of an +object, though it looks unaffected. + +- 3D objects modifications (affects transform matrices):<br> + + translating / rotating / scaling randomly the selected objects;<br> + + moving selected objects closer or away from the active one, setting them at +a fixed distance or translating by a fixed or proportional value. + +Notes:<br> + All numeric / vectorial values used during the program can be copied and +pasted with the help of a buffer, which can contain: a position vector, an +Euler list or a scaling vector and can store: numbers entered by user, values +acquired from objects (matrices averages, distances, differences of position or +rotation angles between two objects). Buffer contents can also be pasted to +the console window as text. + +Usage: + +Open the script from the "Scripts->Wizards" menu of the Scripts window, then +one choose from the available languages. The script has a GUI where specific +tools can be selected and configured before being applied. + +Notes:<br> + Kloputils has many useful tools. To get a better idea of what it can do, +besides reading the tooltips for each button, users can check its online +documentation. +""" + # $Id$ # ################################################## diff --git a/release/scripts/knife.py b/release/scripts/knife.py index f9f8aedf72b..c58c8b4dada 100644 --- a/release/scripts/knife.py +++ b/release/scripts/knife.py @@ -3,10 +3,34 @@ """ Name: 'Blender Knife Tool' Blender: 232 -Group: 'Mesh' +Group: 'Object' Tooltip: 'Cut selected mesh(es) along an active plane w/o creating doubles' """ +__author__ = ["Stefano <S68> Selleri", "Wim Van Hoydonck"] +__url__ = ("blender", "elysiun") +__version__ = "0.0.8a 03/31/04" + +__bpydoc__ = """\ +"Blender Knife Tool" uses the active mesh plane to cut all selected meshes. + +Usage: + +Create, resize and position a "cutting plane", which will be used to cut +the mesh(es), then: + +- select mesh(es) to be cut;<br> +- select cutting plane (it will be the active object);<br> +- run this script from 3d View's "Object->Scripts" menu. + +Options: + +- edit object: knife creates new vertices in the selected mesh(es);<br> +- create new object: knife duplicates objects and creates new vertices in the +new objects;<br> +- create two new objects: knife creates two new separate objects. +""" + # $Id$ # ################################################################### diff --git a/release/scripts/lightwave_export.py b/release/scripts/lightwave_export.py index 3fcb759062d..1df2cec66fa 100644 --- a/release/scripts/lightwave_export.py +++ b/release/scripts/lightwave_export.py @@ -7,6 +7,19 @@ Group: 'Export' Tooltip: 'Export selected meshes to LightWave File Format (.lwo)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script exports meshes to LightWave file format. + +Usage: + +Select meshes to be exported and run this script from "File->Export" menu. +""" + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/lightwave_import.py b/release/scripts/lightwave_import.py index 6b8cee36370..758c3b0229a 100644 --- a/release/scripts/lightwave_import.py +++ b/release/scripts/lightwave_import.py @@ -7,6 +7,20 @@ Group: 'Import' Tooltip: 'Import LightWave Object File Format (.lwo)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script imports LightWave files to Blender. + +Usage: + +Execute this script from the "File->Import" menu and choose a LightWave file to +open. +""" + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/nendo_export.py b/release/scripts/nendo_export.py index 80ce4f96c5d..4f0aac905fa 100644 --- a/release/scripts/nendo_export.py +++ b/release/scripts/nendo_export.py @@ -7,6 +7,20 @@ Group: 'Export' Tooltip: 'Export selected mesh to Nendo File Format (*.ndo)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script exports meshes to Nendo file format. + +Usage: + +Select meshes to be exported and run this script from "File->Export" menu. +""" + + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/nendo_import.py b/release/scripts/nendo_import.py index d65bd20376a..2d041aadd53 100644 --- a/release/scripts/nendo_import.py +++ b/release/scripts/nendo_import.py @@ -7,6 +7,21 @@ Group: 'Import' Tooltip: 'Import Nendo Object File Format (.ndo)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script imports Nendo files to Blender. + +Usage: + +Execute this script from the "File->Import" menu and choose a Nendo file to +open. +""" + + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/obdatacopier.py b/release/scripts/obdatacopier.py index 82cabdb8b36..13b5e7a1bb0 100644 --- a/release/scripts/obdatacopier.py +++ b/release/scripts/obdatacopier.py @@ -7,6 +7,26 @@ Group: 'Object' Tip: 'Copy data from active object to other selected ones.' """ +__author__ = "Jean-Michel Soler (jms)" +__url__ = ("blender", "elysiun", +"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_lampdatacopier.htm", +"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender") +__version__ = "0.1.1" + +__bpydoc__ = """\ +Use "Data Copier" to copy attributes from the active object to other selected ones of +its same type. + +This script is still in an early version but is already useful for copying +attributes for some types of objects like lamps and cameras. + +Usage: + +Select the objects that will be updated, select the object whose data will +be copied (they must all be of the same type, of course), then run this script. +Toggle the buttons representing the attributes to be copied and press "Copy". +""" + # ---------------------------------------------------------- # Object DATA copier 0.1.1 # (c) 2004 jean-michel soler diff --git a/release/scripts/obj_export.py b/release/scripts/obj_export.py index 3650409e6e7..d39d9969859 100644 --- a/release/scripts/obj_export.py +++ b/release/scripts/obj_export.py @@ -7,6 +7,19 @@ Group: 'Export' Tooltip: 'Save a Wavefront OBJ File' """ +__author__ = "Campbell Barton" +__url__ = ["blender", "elysiun"] +__version__ = "0.9" + +__bpydoc__ = """\ +This script is an exporter to OBJ file format. + +Usage: + +Run this script from "File->Export" menu to export all meshes. +""" + + # -------------------------------------------------------------------------- # OBJ Export v0.9 by Campbell Barton (AKA Ideasman) # -------------------------------------------------------------------------- diff --git a/release/scripts/obj_import.py b/release/scripts/obj_import.py index e4761da3889..c860a9707df 100644 --- a/release/scripts/obj_import.py +++ b/release/scripts/obj_import.py @@ -7,6 +7,18 @@ Group: 'Import' Tooltip: 'Load a Wavefront OBJ File' """ +__author__ = "Campbell Barton" +__url__ = ["blender", "elysiun"] +__version__ = "0.9" + +__bpydoc__ = """\ +This script imports OBJ files to Blender. + +Usage: + +Run this script from "File->Import" menu and then load the desired OBJ file. +""" + # $Id$ # # -------------------------------------------------------------------------- diff --git a/release/scripts/off_export.py b/release/scripts/off_export.py index d5f6e943ece..328854d39f8 100644 --- a/release/scripts/off_export.py +++ b/release/scripts/off_export.py @@ -7,6 +7,19 @@ Group: 'Export' Tooltip: 'Export selected mesh to Object File Format (*.off)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script exports meshes to Object File Format. + +Usage: + +Select meshes to be exported and run this script from "File->Export" menu. +""" + # +---------------------------------------------------------+ # | Copyright (c) 2002 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/off_import.py b/release/scripts/off_import.py index 3d5f996a472..b70a935b4a9 100644 --- a/release/scripts/off_import.py +++ b/release/scripts/off_import.py @@ -7,6 +7,21 @@ Group: 'Import' Tooltip: 'Import Object File Format (*.off)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script imports Object File Format files to Blender. + +Usage: + +Execute this script from the "File->Import" menu and choose an OFF file to +open. +""" + + # +---------------------------------------------------------+ # | Copyright (c) 2002 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/paths_import.py b/release/scripts/paths_import.py index 89535e2b872..0ec2b4e2f8a 100644 --- a/release/scripts/paths_import.py +++ b/release/scripts/paths_import.py @@ -12,6 +12,35 @@ Submenu: 'Postscript (.eps/.ps) PS-Adobe-2.0' EPS Tip: 'Import a path from any of a set of formats (still experimental)' """ +__author__ = "Jean-Michel Soler (jms)" +__url__ = ("blender", "elysiun", +"AI importer's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_import_ai.htm", +"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender") +__version__ = "0.1.1" + +__bpydoc__ = """\ +Paths Import imports paths from a selection of different formats: + +- Gimp 1.0 -> 1.2.5;<br> +- Gimp 2.0;<br> +- AI PS-Adobe 2.0;<br> +- Inkscape (svg);<br> +- Postscript (ps/eps) + +Usage: + Run the script from "File->Import", select the desired format from the +pop-up menu and select the file to open. + +Notes:<br> + Mac AI files have different line endings. The author wrote a version of +the importer that supports them, check forum or site links above. +""" + +#---------------------------------------------- +# (c) jm soler juillet 2004, released under Blender Artistic Licence +# for the Blender 2.34 Python Scripts Bundle. +#---------------------------------------------- + import Blender argv=__script__['arg'] diff --git a/release/scripts/radiosity_export.py b/release/scripts/radiosity_export.py index 48b315eaf63..27a32c810d0 100644 --- a/release/scripts/radiosity_export.py +++ b/release/scripts/radiosity_export.py @@ -7,6 +7,20 @@ Group: 'Export' Tooltip: 'Export selected mesh (with vertex colors) to Radiosity File Format (.radio)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script exports meshes to Radiosity file format. + +Usage: + +Select meshes to be exported and run this script from "File->Export" menu. +""" + + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/radiosity_import.py b/release/scripts/radiosity_import.py index 7a848b45ca6..3966a9be88a 100644 --- a/release/scripts/radiosity_import.py +++ b/release/scripts/radiosity_import.py @@ -7,6 +7,21 @@ Group: 'Import' Tooltip: 'Import Radiosity File Format (.radio) with vertex colors' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script imports Radiosity files to Blender. + +Usage: + +Execute this script from the "File->Import" menu and choose a Radiosity file to +open. +""" + + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/raw_export.py b/release/scripts/raw_export.py index a5d42ef5794..843c3f6d32c 100644 --- a/release/scripts/raw_export.py +++ b/release/scripts/raw_export.py @@ -7,6 +7,20 @@ Group: 'Export' Tooltip: 'Export selected mesh to Raw Triangle Format (.raw)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script exports meshes to Raw Triangle file format. + +Usage: + +Select meshes to be exported and run this script from "File->Export" menu. +""" + + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/raw_import.py b/release/scripts/raw_import.py index cc6cdc12480..d650d11a23c 100644 --- a/release/scripts/raw_import.py +++ b/release/scripts/raw_import.py @@ -7,6 +7,21 @@ Group: 'Import' Tooltip: 'Import Raw Triangle File Format (.raw)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script imports Raw Triangle File format files to Blender. + +Usage: + +Execute this script from the "File->Import" menu and choose a Raw file to +open. +""" + + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/renameobjectbyblock.py b/release/scripts/renameobjectbyblock.py index daa3e1c960a..77437926522 100644 --- a/release/scripts/renameobjectbyblock.py +++ b/release/scripts/renameobjectbyblock.py @@ -7,6 +7,22 @@ Group: 'Object' Tip: 'GUI to select and rename objects.' """ +__author__ = "Jean-Michel Soler (jms)" +__url__ = ("blender", "elysiun", +"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_renameobjectgui.htm", +"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender") +__version__ = "233" + +__bpydoc__ = """\ +This script offers a GUI to rename selected objects according to a given +rule. + +Usage: + +Open it from the 3d View's "Object->Scripts" menu and select the objects to +rename and the rule from the buttons in its GUI. +""" + # ---------------------------------------------------------- # Name OBJECT changer # (c) 2004 jean-michel soler diff --git a/release/scripts/rvk1_torvk2.py b/release/scripts/rvk1_torvk2.py index 2987c15ca2b..6a7f31fb252 100644 --- a/release/scripts/rvk1_torvk2.py +++ b/release/scripts/rvk1_torvk2.py @@ -7,6 +7,25 @@ Group: 'Mesh' Tip: 'Copy deform data (not surf. subdiv) of active obj to rvk of the 2nd selected obj' """ +__author__ = "Jean-Michel Soler (jms)" +__url__ = ("blender", "elysiun", +"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_rvk1versrvk2.htm", +"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender") +__version__ = "2004/05" + +__bpydoc__ = """\ +"RVK1 to RVK2" copies deform data (except surface subdivision) of the active +object to the RVK (relative vertex key) of the other selected object. + +Usage: + +Select the object that will receive the rvk info, then select the deformed +object, enter Edit Mode and run this script from the "Mesh->Scripts" menu of +the 3d View. If the active object has subsurf turned on and nonzero subdiv +level, the script will ask if it should change that. Before copying data to +the rvk it will also ask whether it should replace or add a new vertex group. +""" + # $Id$ # #---------------------------------------------- @@ -104,7 +123,7 @@ def rvk2rvk(): Blender.Redraw() except: - Draw.PupMenu('Error| You need to select two meshes.') + Draw.PupMenu('Error%t|You need to select two meshes.') Blender.Window.EditMode(0) diff --git a/release/scripts/save_theme.py b/release/scripts/save_theme.py index 73c23087cec..4b8f06c348f 100644 --- a/release/scripts/save_theme.py +++ b/release/scripts/save_theme.py @@ -3,10 +3,39 @@ """ Name: 'Save Current Theme' Blender: 234 -Group: 'Help' +Group: 'Export' Tooltip: 'Save current theme as a bpython script' """ +__author__ = "Willian P. Germano" +__url__ = ("blender", "elysiun") +__version__ = "1.0 11/05/04" + +__bpydoc__ = """\ +This script saves the current Theme in Blender as a Blender Python script. + +Usage: + +Use Blender's Theme tab in the User Preferences window to create and name your +theme, then run this script from the File->Export menu to save it. + +It is saved as a bpython script, meaning that you can simply run it to change +the current theme. By default it is currently saved under the +"Misc" group, available only from the Scripts window "Scripts->Misc" menu. + +To appear in the menu, a theme saved with this script must be put in your +Blender's scripts dir, that's what happens by default when you save one by +yourself. If you don't know where this dir is, running + +import Blender<br>print Blender.Get("scriptsdir") + +on the Text Editor window (use menu or ALT+P to run it) will write the path on +the console. + +Remember to edit your exported theme's source file to put your name and +some information on it before sharing it with others. +""" + # $Id$ # # -------------------------------------------------------------------------- @@ -29,6 +58,7 @@ theme = Theme.Get()[0] # get current theme # default filename: theme's name + '_theme.py' in user's scripts dir: default_fname = Blender.Get("scriptsdir") default_fname = Blender.sys.join(default_fname, theme.name + '_theme.py') +default_fname = default_fname.replace(' ','_') def write_theme(filename): "Write the current theme as a bpython script" @@ -39,11 +69,22 @@ def write_theme(filename): fout.write("""#!BPY -\"\"\" -Name: '%s' -Blender: 234 -Group: 'Theme' -Tooltip: 'Change current theme' +# \"\"\" +# Name: '%s' +# Blender: 234 +# Group: 'Theme' +# Tooltip: 'Change current theme' +# \"\"\" + +__%s__ = "????" +__%s__ = "1.0" +__%s__ = [""] +__%s__ = \"\"\"\\ +You can edit this section to write something about your script that can +be read then with the Scripts Help Browser script in Blender. + +Remember to also set author, version and possibly url(s) above. You can also +define an __email__ tag, check some bundled script's source for examples. \"\"\" # This script was automatically generated by the save_theme.py bpython script. @@ -55,7 +96,7 @@ import Blender from Blender.Window import Theme theme = Theme.New('%s') -""" % (theme.name, theme.name)) +""" % (theme.name, "author", "version", "url", "bpydoc", theme.name)) for tsp in theme.get(): # command = "\n%s = theme.get('%s')" % (tsp, tsp) diff --git a/release/scripts/sel_same.py b/release/scripts/sel_same.py index ff489c1ebae..f37d1083c48 100644 --- a/release/scripts/sel_same.py +++ b/release/scripts/sel_same.py @@ -7,6 +7,38 @@ Group: 'UV' Tooltip: 'Select faces if attributes match the active' """ +__author__ = "Campbell Barton" +__url__ = ["blender", "elysiun"] +__version__ = "1.0" + +__bpydoc__ = """\ +This script selects faces matching a given attribute of the currently +active face. + +Usage: + +Enter "UV Face Select" mode and make the desired face active. Then run this +script and choose the selection rule: by same (or similar for some itens): + +- material;<br> +- texture image;<br> +- mode;<br> +- vertex colors;<br> +- uv coordinates;<br> +- area;<br> +- proportions;<br> +- normal vector;<br> +- co-planar. + +Another menu will ask if the script should add, subtract, overwrite or +overwrite inverse of current current selection. For some choices like vcolors, +area, etc., a pop-up will ask for a maximum threshold value. + +Notes:<br> + Again, to select / deselect faces, enter "UV Face Select" mode. This is not +the same as selecting faces in edit mode (new feature in Blender 2.35). +""" + # $Id$ # #===============================================# diff --git a/release/scripts/skin.py b/release/scripts/skin.py index 77792c1326b..7bc97e37f64 100644 --- a/release/scripts/skin.py +++ b/release/scripts/skin.py @@ -11,6 +11,22 @@ Submenu: 'Loft-segment - even method' B2 Tooltip: 'Select 2 or more vert loops, then run this script' """ +__author__ = "Campbell Barton" +__url__ = ["blender", "elysiun"] +__version__ = "1.0 2004/04/25" + +__bpydoc__ = """\ +With this script vertex loops can be skinned: faces are created to connect the +selected loops of vertices. + +Usage: + +In mesh Edit mode select the vertices of the loops (closed paths / curves of +vertices: circles, for example) that should be skinned, then run this script. +A pop-up will provide further options, if the results of a method are not adequate try one of the others. +""" + + # $Id$ # # -------------------------------------------------------------------------- diff --git a/release/scripts/slp_import.py b/release/scripts/slp_import.py index ed81a5d0e4b..f9ab52b3724 100644 --- a/release/scripts/slp_import.py +++ b/release/scripts/slp_import.py @@ -7,6 +7,20 @@ Group: 'Import' Tooltip: 'Import Pro Engineer (.slp) File Format' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script imports Pro Engineer files to Blender. + +Usage: + +Execute this script from the "File->Import" menu and choose an SLP file to +open. +""" + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/sysinfo.py b/release/scripts/sysinfo.py index 50aed881329..04d31ccec16 100644 --- a/release/scripts/sysinfo.py +++ b/release/scripts/sysinfo.py @@ -1,4 +1,5 @@ #!BPY + """ Name: 'System Information...' Blender: 234 @@ -6,10 +7,24 @@ Group: 'HelpSystem' Tooltip: 'Information about your Blender environment, useful to diagnose problems.' """ +__author__ = "Willian P. Germano" +__url__ = ("blender", "elysiun") +__version__ = "1.0" +__bpydoc__ = """\ +This script creates a text in Blender's Text Editor with information +about your OS, video card, OpenGL driver, Blender and Python versions and +more. + +If you are experiencing trouble running Blender or its scripts in general, +this information can be useful for online searches (like checking if there +are known issues related to your video card) or to get help from other users +or the program's developers. +""" + # $Id$ # # -------------------------------------------------------------------------- -# sysinfo.py version 0.1 Jun 09, 2004 +# sysinfo.py version 1.0 Jun 09, 2004 # -------------------------------------------------------------------------- # ***** BEGIN GPL LICENSE BLOCK ***** # @@ -85,13 +100,12 @@ for p in sys.path: output.write(p + '\n') output.write("\n- Default folder for registered scripts:\n\n") -scriptsdir = Blender.Get("datadir") -if scriptsdir: - scriptsdir = scriptsdir.replace("/bpydata","/scripts") - output.write(scriptsdir) -else: +scriptsdir = Blender.Get("scriptsdir") +if not scriptsdir: output.write("<WARNING> -- not found") warnings += 1 +else: + output.write(scriptsdir) missing_mods = [] # missing basic modules @@ -143,7 +157,7 @@ if (warnings): output.write("\n(*) Found %d warning" % warnings) if (warnings > 1): output.write("s") # (blush) output.write(", documented in the text above.") -else: output.write("\n==\nNo problems were found.") +else: output.write("\n==\nNo problems were found (scroll up for details).") Blender.Window.WaitCursor(0) exitmsg = "Done!|Please check the text %s in the Text Editor window" % output.name diff --git a/release/scripts/tex2uvbaker.py b/release/scripts/tex2uvbaker.py index 45dbb2e5b11..7a172ee5868 100644 --- a/release/scripts/tex2uvbaker.py +++ b/release/scripts/tex2uvbaker.py @@ -7,6 +7,31 @@ Group: 'UV' Tooltip: 'Procedural to uvmapped texture baker' """ +__author__ = "Jean-Michel Soler (jms)" +__url__ = ("blender", "elysiun", +"Script online, http://jmsoler.free.fr/util/blenderfile/py/text2uvbaker.py", +"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender") +__version__ = "0.2.2 2004/08/01" + +__bpydoc__ = """\ +This script "bakes" Blender procedural materials (including textures): it saves +them as 2d uv-mapped images. + +This script saves an uv texture layout of the chosen mesh, that can be used as +an uv map for it. It is a way to export procedurals from Blender as normal +image textures that can be edited with a 2d image manipulation program or used +with the mesh in games and other 3d applications. + +Usage: + +a) Enter face mode and define uv coordinates for your mesh;<br> +b) Define its materials and textures and set "Map Input" coordinates to UV; +c) Run this script and check the console. + +Notes:<br> + This script was based on a suggestion by Martin (Theeth) Poirier;<br> +""" + #--------------------------------------------- # Last release : 0.2.2 , 2004/08/01 , 22h13 #--------------------------------------------- diff --git a/release/scripts/truespace_export.py b/release/scripts/truespace_export.py index ad2a6bcd1d5..df96552467f 100644 --- a/release/scripts/truespace_export.py +++ b/release/scripts/truespace_export.py @@ -7,6 +7,20 @@ Group: 'Export' Tooltip: 'Export selected meshes to TrueSpace File Format (.cob)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script exports meshes to TrueSpace file format. + +Usage: + +Select meshes to be exported and run this script from "File->Export" menu. +""" + + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/truespace_import.py b/release/scripts/truespace_import.py index 3ec917773b0..5250c5e24af 100644 --- a/release/scripts/truespace_import.py +++ b/release/scripts/truespace_import.py @@ -7,6 +7,20 @@ Group: 'Import' Tooltip: 'Import TrueSpace Object File Format (.cob)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script imports TrueSpace files to Blender. + +Usage: + +Execute this script from the "File->Import" menu and choose a TrueSpace file to +open. +""" + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/unweld044.py b/release/scripts/unweld044.py index ab23cdc546d..12a00b0fc89 100644 --- a/release/scripts/unweld044.py +++ b/release/scripts/unweld044.py @@ -6,6 +6,29 @@ Group: 'Mesh' Tip: 'Unweld all faces from a selected and common vertex. Made vertex bevelling' """ +__author__ = "Jean-Michel Soler (jms)" +__url__ = ("blender", "elysiun", +"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_faces2vertex.htm#exemple", +"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender") +__version__ = "0.4.4 beta" + +__bpydoc__ = """\ +This script unwelds faces from a selected vertex. + +There's also experimental support for static or dynamic (move mouse in the +Scripts window) vertex bevel. + +Usage: + +Select a vertex, then run this script. Its options are: + +- unbind points;<br> +- with noise;<br> +- middle face;<br> +- static bevel vertex;<br> +- moving bevel vertex; +""" + # $Id$ # # ------------------------------------------ diff --git a/release/scripts/uv_export.py b/release/scripts/uv_export.py index bbd2cb8eba8..f1f8b628366 100644 --- a/release/scripts/uv_export.py +++ b/release/scripts/uv_export.py @@ -7,6 +7,29 @@ Group: 'UV' Tooltip: 'Export the UV face layout of the selected object to a .TGA file' """ +__author__ = "Martin (Theeth) Poirier" +__url__ = ("blender", "elysiun") +__version__ = "1.3a" + +__bpydoc__ = """\ +This script exports the UV face layout of the selected mesh object to +a TGA image file. Then you can, for example, paint details in this image using +an external 2d paint program of your choice and bring it back to be used as a +texture for the mesh. + +Usage: + +Open this script from UV/Image Editor's "UVs" menu, make sure there is a mesh +selected, define size and wire size parameters and push "Export" button. + +There are more options to configure, like setting export path, if image should +use object's name and more. + +Notes:<br> + Jean-Michel Soler (jms) wrote TGA functions used by this script. +""" + + # $Id$ # # -------------------------------------------------------------------------- diff --git a/release/scripts/videoscape_export.py b/release/scripts/videoscape_export.py index 239f75faa9b..362ecdc0d60 100644 --- a/release/scripts/videoscape_export.py +++ b/release/scripts/videoscape_export.py @@ -7,6 +7,20 @@ Group: 'Export' Tooltip: 'Export selected mesh to VideoScape File Format (.obj)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script exports meshes (including vertex colors) to VideoScape File Format. + +Usage: + +Select meshes to be exported and run this script from "File->Export" menu. +""" + + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/wings_export.py b/release/scripts/wings_export.py index 3ad3f33b327..3fb02673ed3 100644 --- a/release/scripts/wings_export.py +++ b/release/scripts/wings_export.py @@ -7,6 +7,21 @@ Group: 'Export' Tooltip: 'Export selected mesh to Wings3D File Format (.wings)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius", +"Wings 3D, http://www.wings3d.com") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script exports meshes to Wings 3D file format. + +Usage: + +Select meshes to be exported and run this script from "File->Export" menu. +""" + + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/wings_import.py b/release/scripts/wings_import.py index 432bb43b088..9633c94355e 100644 --- a/release/scripts/wings_import.py +++ b/release/scripts/wings_import.py @@ -7,6 +7,21 @@ Group: 'Import' Tooltip: 'Import Wings3D File Format (.wings)' """ +__author__ = "Anthony D'Agostino (Scorpius)" +__url__ = ("blender", "elysiun", +"Author's homepage, http://www.redrival.com/scorpius", +"Wings 3D, http://www.wings3d.com") +__version__ = "Part of IOSuite 0.5" + +__bpydoc__ = """\ +This script imports Wings 3d files to Blender. + +Usage: + +Execute this script from the "File->Import" menu and choose a Wings file to +open. +""" + # $Id$ # # +---------------------------------------------------------+ diff --git a/release/scripts/wrl2export.py b/release/scripts/wrl2export.py index 5ab2e3be85b..e962789f9db 100644 --- a/release/scripts/wrl2export.py +++ b/release/scripts/wrl2export.py @@ -8,6 +8,32 @@ Submenu: 'Selected Objects...' selected Tooltip: 'Export to VRML2 (.wrl) file.' """ +__author__ = ("Rick Kimball", "Ken Miller", "Steve Matthews") +__url__ = ["blender", "elysiun", +"Author's (Rick) homepage, http://kimballsoftware.com/blender", +"Show your VRML world at vrmlworld.net, http://vrmlworld.net"] +__version__ = "2004/01/19" + +__bpydoc__ = """\ +This script exports to VRML 2.0 format. + +Usage: + +Run this script from "File->Export" menu. A pop-up will ask whether you +want to export only selected or all relevant objects. + +Known issues:<br> + Doesn't handle multiple materials (don't use material indices);<br> + Doesn't handle multiple UV textures on a single mesh (create a mesh +for each texture);<br> + Material colors need work;<br> + Spotlight softness needs work;<br> + Can't get the texture array associated with material * not the UV ones;<br> + Can't set smoothing, crease angle and mesh smoothing * setting not + accessible. +""" + + # $Id$ # #------------------------------------------------------------------------ |