diff --git a/release/scripts/DirectXExporter.py b/release/scripts/DirectXExporter.py index 6e5436df27b0e2ec3fa2217c5f375c046eaaf4ba..60f802e538b9c67918b729552372ab46cdfc6a3a 100644 --- a/release/scripts/DirectXExporter.py +++ b/release/scripts/DirectXExporter.py @@ -8,6 +8,8 @@ Submenu: 'Only mesh data...' mesh Submenu: 'Animation(not armature yet)...' anim Tip: 'Export to DirectX text file format format.' """ +# $Id$ +# # DirectX.py version 1.0 # Copyright (C) 2003 Arben OMARI -- aromari@tin.it # @@ -28,7 +30,6 @@ Tip: 'Export to DirectX text file format format.' import Blender from Blender import Types, Object, NMesh, Material -#import string from math import * @@ -114,9 +115,6 @@ class xExport: self.file.write("%s;\n" % (mat.spec)) self.file.write("%s; %s; %s;;\n" % (mat.specR, mat.specG, mat.specB)) self.file.write("0.0; 0.0; 0.0;;\n") - self.file.write("TextureFilename {\n") - self.file.write('none ;') - self.file.write("}\n") self.file.write("}\n") self.writeTextures(name, tex) @@ -198,18 +196,18 @@ class xExport: coun += 1 if coun == numface: if len(face.v) == 3: - self.file.write("3; %s; %s; %s;;\n" % (counter, counter + 1, counter + 2)) + self.file.write("3; %s, %s, %s;;\n" % (counter, counter + 1, counter + 2)) counter += 3 else : - self.file.write("4; %s; %s; %s; %s;;\n" % (counter, counter + 1, counter + 2, counter + 3)) + self.file.write("4; %s, %s, %s, %s;;\n" % (counter, counter + 1, counter + 2, counter + 3)) counter += 4 else: if len(face.v) == 3: - self.file.write("3; %s; %s; %s;,\n" % (counter, counter + 1, counter + 2)) + self.file.write("3; %s, %s, %s;,\n" % (counter, counter + 1, counter + 2)) counter += 3 else : - self.file.write("4; %s; %s; %s; %s;,\n" % (counter, counter + 1, counter + 2, counter + 3)) + self.file.write("4; %s, %s, %s, %s;,\n" % (counter, counter + 1, counter + 2, counter + 3)) counter += 4 @@ -280,14 +278,14 @@ class xExport: counter += 1 if counter == numfaces: if len(face.v) == 3: - self.file.write("3; %s; %s; %s;;\n" % (face[0].index, face[1].index, face[2].index)) + self.file.write("3; %s, %s, %s;;\n" % (face[0].index, face[1].index, face[2].index)) elif len(face.v) == 4: - self.file.write("4; %s; %s; %s; %s;;\n" % (face[0].index, face[1].index, face[2].index, face[3].index)) + self.file.write("4; %s, %s, %s, %s;;\n" % (face[0].index, face[1].index, face[2].index, face[3].index)) else: if len(face.v) == 3: - self.file.write("3; %s; %s; %s;,\n" % (face[0].index, face[1].index, face[2].index)) + self.file.write("3; %s, %s, %s;,\n" % (face[0].index, face[1].index, face[2].index)) elif len(face.v) == 4 : - self.file.write("4; %s; %s; %s; %s;,\n" % (face[0].index, face[1].index, face[2].index, face[3].index)) + self.file.write("4; %s, %s, %s, %s;,\n" % (face[0].index, face[1].index, face[2].index, face[3].index)) self.file.write("}\n") #*********************************************** #MESH TEXTURE COORDS @@ -298,6 +296,7 @@ class xExport: #VERTICES NUMBER mesh = name.data numvert = 0 + numfaces=len(obj.faces) for face in mesh.faces: numvert = numvert + len(face.v) self.file.write("%s;\n" % (numvert)) @@ -305,15 +304,26 @@ class xExport: counter = -1 for face in mesh.faces: counter += 1 - if len(face.v) == 4: - self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[0][0], -mesh.faces[counter].uv[0][1])) - self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[1][0], -mesh.faces[counter].uv[1][1])) - self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[2][0], -mesh.faces[counter].uv[2][1])) - self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[3][0], -mesh.faces[counter].uv[3][1])) - elif len(face.v) == 3: - self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[0][0], -mesh.faces[counter].uv[0][1])) - self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[1][0], -mesh.faces[counter].uv[1][1])) - self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[2][0], -mesh.faces[counter].uv[2][1])) + if counter == numfaces - 1: + if len(face.v) == 4: + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[0][0], -mesh.faces[counter].uv[0][1])) + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[1][0], -mesh.faces[counter].uv[1][1])) + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[2][0], -mesh.faces[counter].uv[2][1])) + self.file.write("%s;%s;;\n" % (mesh.faces[counter].uv[3][0], -mesh.faces[counter].uv[3][1])) + elif len(face.v) == 3: + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[0][0], -mesh.faces[counter].uv[0][1])) + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[1][0], -mesh.faces[counter].uv[1][1])) + self.file.write("%s;%s;;\n" % (mesh.faces[counter].uv[2][0], -mesh.faces[counter].uv[2][1])) + else : + if len(face.v) == 4: + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[0][0], -mesh.faces[counter].uv[0][1])) + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[1][0], -mesh.faces[counter].uv[1][1])) + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[2][0], -mesh.faces[counter].uv[2][1])) + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[3][0], -mesh.faces[counter].uv[3][1])) + elif len(face.v) == 3: + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[0][0], -mesh.faces[counter].uv[0][1])) + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[1][0], -mesh.faces[counter].uv[1][1])) + self.file.write("%s;%s;,\n" % (mesh.faces[counter].uv[2][0], -mesh.faces[counter].uv[2][1])) self.file.write("}\n") diff --git a/release/scripts/UVpaint05.py b/release/scripts/UVpaint05.py index b994be23871f77ee8366e5e056dba59c76622898..40902a4909f918133cce86593d1e81ba4389caf2 100644 --- a/release/scripts/UVpaint05.py +++ b/release/scripts/UVpaint05.py @@ -5,7 +5,8 @@ Blender: 232 Group: 'UV' Tip: 'Use vertex paint color value to fill uvmapping.' """ - +# $Id$ +# #---------------------------------------------- # uvpainter script (c) 04/2004 jean-michel soler # http://jmsoler.free.fr/util/blenderfile/py/UVpaint05.zip diff --git a/release/scripts/ac3d_export.py b/release/scripts/ac3d_export.py index 04da0d38cab4b165e387ac22a6e113b30ee3dc9a..9e45d8ab109ab6715885d61803c9e829c0df21e6 100644 --- a/release/scripts/ac3d_export.py +++ b/release/scripts/ac3d_export.py @@ -10,6 +10,8 @@ Submenu: 'Configure +' config Tip: 'Export to AC3D (.ac) format.' """ +# $Id$ +# # -------------------------------------------------------------------------- # AC3DExport version 2.32-1 Jan 21, 2004 # Program versions: Blender 2.32+ and AC3Db files (means version 0xb) @@ -62,7 +64,7 @@ def update_RegistryInfo(): d['ADD_DEFAULT_MAT'] = ADD_DEFAULT_MAT Blender.Registry.SetKey('AC3DExport', d) -# The default material to be used when necessary (see right above) +# The default material to be used when necessary (see ADD_DEFAULT_MAT) DEFAULT_MAT = \ 'MATERIAL "DefaultWhite" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.5 0.5 0.5 shi 64 trans 0' @@ -329,23 +331,19 @@ def gui(): BGL.glClearColor(0.6,0.6,0.9,1) BGL.glClear(BGL.GL_COLOR_BUFFER_BIT) BGL.glColor3f(1,1,1) - BGL.glRasterPos2i(20, 270) - Draw.Text("AC3D Exporter") - BGL.glRasterPos2i(30, 250) + BGL.glRasterPos2i(18, 150) Draw.Text("AC3D is a simple, affordable commercial 3d modeller that can be found at www.ac3d.org .") - BGL.glRasterPos2i(30, 230) + BGL.glRasterPos2i(18, 130) Draw.Text("It uses a nice text file format (extension .ac) which supports uv-textured meshes") - BGL.glRasterPos2i(30, 210) + BGL.glRasterPos2i(18, 110) Draw.Text("with parenting (grouping) information.") - BGL.glRasterPos2i(30, 190) + BGL.glRasterPos2i(18, 90) Draw.Text("Notes: AC3D has a 'data' token that assigns a string to each mesh, useful for games,") - BGL.glRasterPos2i(67, 170) + BGL.glRasterPos2i(55, 70) Draw.Text("for example. You can use Blender's mesh datablock name for that.") - BGL.glRasterPos2i(67, 150) - Draw.Text("The .ac format is well supported by the PLib 3d gaming library. You can use this") - BGL.glRasterPos2i(67, 130) - Draw.Text("exporter to have your Blender models in games and other apps written with PLib.") - Draw.Button("Ok", 21, 285, 80, 100, 40, "Click to return to previous screen.") + BGL.glRasterPos2i(55, 50) + Draw.Text("The .ac format is well supported by the PLib 3d gaming library.") + Draw.Button("Ok", 21, 285, 10, 45, 20, "Click to return to previous screen.") else: BGL.glClearColor(0,0,1,1) BGL.glClear(BGL.GL_COLOR_BUFFER_BIT) diff --git a/release/scripts/ac3d_import.py b/release/scripts/ac3d_import.py index 3dc8af7ad2c04d7e89b3799a4bc064de195df89f..2cc8f6ad08a96cad580dfa6be1a186ce1d37008d 100644 --- a/release/scripts/ac3d_import.py +++ b/release/scripts/ac3d_import.py @@ -6,7 +6,8 @@ Blender: 232 Group: 'Import' Tip: 'Import an AC3D (.ac) file.' """ - +# $Id$ +# # -------------------------------------------------------------------------- # AC3DImport version 2.32-1 Jan 21, 2004 # Program versions: Blender 2.32+ and AC3Db files (means version 0xb) diff --git a/release/scripts/blender2cal3d.py b/release/scripts/blender2cal3d.py index 9d0d7295512bde715e1d0f4a562b9becf35fa5c6..7e81529d26bf6d9c11471bc5478f777e75854e12 100644 --- a/release/scripts/blender2cal3d.py +++ b/release/scripts/blender2cal3d.py @@ -6,7 +6,8 @@ Blender: 232 Group: 'Export' Tip: 'Export armature/bone data to the Cal3D library.' """ - +# $Id$ +# # blender2cal3D.py version 0.5 # Copyright (C) 2003 Jean-Baptiste LAMY -- jiba@tuxfamily.org # diff --git a/release/scripts/bvh_export.py b/release/scripts/bvh_export.py index 8c0f95fdc258b5c0492fe78fc491535241c2648e..7f6ad856c046eac795aa9d3b8ffe1a63ccc9e784 100644 --- a/release/scripts/bvh_export.py +++ b/release/scripts/bvh_export.py @@ -6,6 +6,9 @@ Blender: 232 Group: 'Export' Tip: 'Export a (*.bvh) motion capture file' """ + +# $Id$ +# #===============================================# # BVH Export script 1.0 by Campbell Barton # # Copyright MetaVR 30/03/2004, # @@ -381,4 +384,4 @@ def saveBVH(filename): file.close() print 'done' -Blender.Window.FileSelector(saveBVH, 'SELECT NEW BVH FILE') \ No newline at end of file +Blender.Window.FileSelector(saveBVH, 'SELECT NEW BVH FILE') diff --git a/release/scripts/bvh_import.py b/release/scripts/bvh_import.py index c677906f79ebe56fa478bb74dc7e016353650739..cde0e0dfde867bc6379c40af4afc3ef59ff1a72c 100644 --- a/release/scripts/bvh_import.py +++ b/release/scripts/bvh_import.py @@ -7,6 +7,8 @@ Group: 'Import' Tip: 'Import a (*.bvh) motion capture file' """ +# $Id$ +# #===============================================# # BVH Import script 1.0 by Campbell Barton # # 25/03/2004, euler rotation code taken from # @@ -439,4 +441,4 @@ def loadBVH(filename): # Main file loop lineIdx += 1 -Blender.Window.FileSelector(loadBVH) \ No newline at end of file +Blender.Window.FileSelector(loadBVH) diff --git a/release/scripts/disp_paint233f.py b/release/scripts/disp_paint233f.py index cf60f4ecfae103e00872e3726cb92ed693af87e8..e3e6636f63fcd09e41ac9fd97e087ffc87d1706e 100644 --- a/release/scripts/disp_paint233f.py +++ b/release/scripts/disp_paint233f.py @@ -7,6 +7,8 @@ Group: 'Modifiers' Tip: 'use vertex paint color value to modify shape displacing vertices along normal.' """ +# $Id$ +# #---------------------------------------------- # jm soler, displacement paint 03/2002 - > 05/2004: disp_paintf #---------------------------------------------- diff --git a/release/scripts/fixfromarmature.py b/release/scripts/fixfromarmature.py index 564e56ff66ead90e13b167c7bec345e946ef4dbc..24757f7fa209742940ed81bab64088123ac486f7 100644 --- a/release/scripts/fixfromarmature.py +++ b/release/scripts/fixfromarmature.py @@ -6,7 +6,8 @@ Blender: 232 Group: 'Generators' Tip: 'Fix armature deformation.' """ - +# $Id$ +# #---------------------------------------------- # jm soler 05/2004 : 'FixfromArmature' #---------------------------------------------- diff --git a/release/scripts/lightwave_export.py b/release/scripts/lightwave_export.py index 6ed96300673e055cf4ac1947656932a3ae18ff75..56e137cc380792230bf7076da17bfa3b08f63d45 100644 --- a/release/scripts/lightwave_export.py +++ b/release/scripts/lightwave_export.py @@ -7,6 +7,8 @@ Group: 'Export' Tooltip: 'Export selected meshes to LightWave File Format (*.lwo)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2002 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/lightwave_import.py b/release/scripts/lightwave_import.py index 5bfef5c907ac380916048b381a62b64bc59b840a..583e57191e6cb688b12f4d5cefd5b5fbd9db38d8 100644 --- a/release/scripts/lightwave_import.py +++ b/release/scripts/lightwave_import.py @@ -7,6 +7,8 @@ Group: 'Import' Tooltip: 'Import LightWave Object File Format (*.lwo)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2002 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/mod_blender.py b/release/scripts/mod_blender.py new file mode 100644 index 0000000000000000000000000000000000000000..fd1e376182c64199dd8265f5772391481bb5a1d0 --- /dev/null +++ b/release/scripts/mod_blender.py @@ -0,0 +1,39 @@ +# $Id$ +# +# -------------------------------------------------------------------------- +# mod_blender.py version 0.1 Jun 09, 2004 +# -------------------------------------------------------------------------- +# helper functions to be used by other scripts +# -------------------------------------------------------------------------- +# ***** 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 ***** +# -------------------------------------------------------------------------- + +# Basic set of modules Blender should have in all supported platforms: +# XXX still incomplete +basic_modules = [ +'Blender', +'sys', +'os', +'math', +'chunk', +'gzip', +'string' +] diff --git a/release/scripts/mod_meshtools.py b/release/scripts/mod_meshtools.py index 95dae16b5622110fc1db167b7d0dabe167a4d1b5..6409f7ad72b85d60086589da4e0d274ae0753b85 100644 --- a/release/scripts/mod_meshtools.py +++ b/release/scripts/mod_meshtools.py @@ -1,3 +1,5 @@ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2001 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/nendo_export.py b/release/scripts/nendo_export.py index 97796f03207ca44f1bb3c22eb2d17edcb91140ce..5fd6db87d533b22183b08968a1d3219adb71cacb 100644 --- a/release/scripts/nendo_export.py +++ b/release/scripts/nendo_export.py @@ -7,6 +7,8 @@ Group: 'Export' Tooltip: 'Export selected mesh to Nendo File Format (*.ndo)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2001 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/nendo_import.py b/release/scripts/nendo_import.py index d14d99d87ab2ed04a5ddba7e9fd4abbbe76bddb3..3d42f4bfc51a17b794b33bff55e13fec8366f9c2 100644 --- a/release/scripts/nendo_import.py +++ b/release/scripts/nendo_import.py @@ -7,6 +7,8 @@ Group: 'Import' Tooltip: 'Import Nendo Object File Format (*.ndo)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2001 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/obj_export.py b/release/scripts/obj_export.py index c260e619b97768d1adfb460060c079051b9dfdec..ecf081cf55cc9bc0d8e33d469f9d99b98ba31d44 100644 --- a/release/scripts/obj_export.py +++ b/release/scripts/obj_export.py @@ -7,6 +7,8 @@ Group: 'Export' Tooltip: 'Save a Wavefront OBJ File' """ +# $Id$ +# # -------------------------------------------------------------------------- # OBJ Export v0.9 by Campbell Barton (AKA Ideasman) # -------------------------------------------------------------------------- diff --git a/release/scripts/obj_import.py b/release/scripts/obj_import.py index 1b015db50892b5b8d834de43d2b8a2c2cca10f64..364fbc590befe47d099c18edb10e74d5003ab005 100644 --- a/release/scripts/obj_import.py +++ b/release/scripts/obj_import.py @@ -7,6 +7,8 @@ Group: 'Import' Tooltip: 'Load a Wavefront OBJ File' """ +# $Id$ +# # -------------------------------------------------------------------------- # OBJ Import v0.9 by Campbell Barton (AKA Ideasman) # -------------------------------------------------------------------------- diff --git a/release/scripts/radiosity_export.py b/release/scripts/radiosity_export.py index 34c913dc1ef385a421c1441341fd69d1d002fcc2..85b8ae8e59861a7a95330e3390a404edd61aac83 100644 --- a/release/scripts/radiosity_export.py +++ b/release/scripts/radiosity_export.py @@ -7,6 +7,8 @@ Group: 'Export' Tooltip: 'Export selected mesh (with vertex colors) to Radiosity File Format (*.radio)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2002 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/radiosity_import.py b/release/scripts/radiosity_import.py index 467058552857e67f081885670c7bfc843bf7fcbe..8aeb66fd7d01fa1eeffaf536ab8fc80d38858ccb 100644 --- a/release/scripts/radiosity_import.py +++ b/release/scripts/radiosity_import.py @@ -7,6 +7,8 @@ Group: 'Import' Tooltip: 'Import Radiosity File Format (*.radio) with vertex colors' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2002 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/raw_export.py b/release/scripts/raw_export.py index 9c2407c41a7f865363fb3aa3ab5207933c4f1eaf..4493a6bc46382a133c67de211e724a344f825235 100644 --- a/release/scripts/raw_export.py +++ b/release/scripts/raw_export.py @@ -7,6 +7,8 @@ Group: 'Export' Tooltip: 'Export selected mesh to Raw Triangle Format (*.raw)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2002 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/raw_import.py b/release/scripts/raw_import.py index f1b6cc511e4ccf8d19064ab89cc5664cdbd681de..a195a5dfa308a369a569bf7baa07c23abf1c83ae 100644 --- a/release/scripts/raw_import.py +++ b/release/scripts/raw_import.py @@ -7,6 +7,8 @@ Group: 'Import' Tooltip: 'Import Raw Triangle File Format (*.raw)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2002 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/rvk1_torvk2.py b/release/scripts/rvk1_torvk2.py index efe6c9a95590922535b9a6fdcc0636b3de1a8e24..601d8c0a1ad46be3e27ac410b145061a8ab2f3f2 100644 --- a/release/scripts/rvk1_torvk2.py +++ b/release/scripts/rvk1_torvk2.py @@ -7,6 +7,8 @@ Group: 'Animation' Tip: 'Copy deform data (not surf. subdiv) of active obj to rvk of the 2nd selected obj.' """ +# $Id$ +# #---------------------------------------------- # jm soler (c) 05/2004 : 'Rvk1toRvk2' release under blender artistic licence #---------------------------------------------- diff --git a/release/scripts/slp_import.py b/release/scripts/slp_import.py index a066e333445b71a92cf94200d38344f2a2d223df..acd3531f11806a69b2896cfa20d060594e8ca02b 100644 --- a/release/scripts/slp_import.py +++ b/release/scripts/slp_import.py @@ -7,6 +7,8 @@ Group: 'Import' Tooltip: 'Import SLP (Pro Engineer) File Format (*.raw)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2004 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/sysinfo.py b/release/scripts/sysinfo.py new file mode 100644 index 0000000000000000000000000000000000000000..736eb78a961803ca2d7b4129e1199676f356e943 --- /dev/null +++ b/release/scripts/sysinfo.py @@ -0,0 +1,148 @@ +#!BPY +""" +Name: 'System Info' +Blender: 233 +Group: 'Utils' +Tooltip: 'Information about your Blender environment, useful to diagnose problems.' +""" + +# $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.BGL import * +import sys + +# has_textwrap = 1 # see commented code below +output_filename = "system-info.txt" +warnings = 0 + +def cutPoint(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 textWrap(text, length = 70): + lines = [] + while len(text) > 70: + cpt = cutPoint(text, length) + line, text = text[:cpt], text[cpt + 1:] + lines.append(line) + lines.append(text) + return lines + +## Better use our own text wrap functions here +#try: +# import textwrap +#except: +# has_textwrap = 0 +# msg = sys.exc_info()[1].__str__().split()[3] +# Blender.Draw.PupMenu("Python error:|This script requires the %s module" %msg) + +header = "= Blender %s System Information =" % Blender.Get("version") +lilies = len(header)*"="+"\n" +header = lilies + header + "\n" + lilies + +output = Blender.Text.New(output_filename) + +output.write(header + "\n\n") + +output.write("Platform: %s\n========\n\n" % sys.platform) + +output.write("Python:\n======\n\n") +output.write("- Version: %s\n\n" % sys.version) +output.write("- Path:\n\n") +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: + output.write("<WARNING> -- not found") + warnings += 1 + +missing_mods = [] # missing basic modules + +try: + from mod_blender import basic_modules + for m in basic_modules: + try: exec ("import %s" % m) + except: missing_mods.append(m) + + if missing_mods: + output.write("\n\n<WARNING>:\n\nSome expected modules were not found.\n") + output.write("Because of that some scripts bundled with Blender may not work.\n") + output.write("Please read the FAQ in the Readme.html file shipped with Blender\n") + output.write("for information about how to fix the problem.\n\n") + output.write("The missing modules:\n") + warnings += 1 + for m in missing_mods: + output.write('-> ' + m + '\n') + else: + output.write("\n\n- Modules: all basic ones were found.\n") + +except: + output.write("\n\n<WARNING>:\nCouldn't find mod_blender.py in scripts dir.") + output.write("\nBasic modules availability won't be tested.\n") + warnings += 1 + + +output.write("\nOpenGL:\n======\n\n") +output.write("- Renderer: %s\n" % glGetString(GL_RENDERER)) +output.write("- Vendor: %s\n" % glGetString(GL_VENDOR)) +output.write("- Version: %s\n\n" % glGetString(GL_VERSION)) +output.write("- Extensions:\n\n") + +glext = glGetString(GL_EXTENSIONS) +glext = textWrap(glext, 70) + +for l in glext: + output.write(l + "\n") + +output.write("\n\n- Simplistic almost useless benchmark:\n\n") +t = Blender.sys.time() +nredraws = 10 +for i in range(nredraws): + Blender.Redraw(-1) # redraw all windows +result = str(Blender.sys.time() - t) +output.write("Redrawing all areas %s times took %s seconds.\n" % (nredraws, result)) + +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.") + +exitmsg = "Done!|Please check the text %s at the Text Editor window." % output.name +Blender.Draw.PupMenu(exitmsg) diff --git a/release/scripts/truespace_export.py b/release/scripts/truespace_export.py index 8013278e52829317a348196d75a840e647fe825f..f50e00f6d8a67583409cf8085a1538d065e32a7f 100644 --- a/release/scripts/truespace_export.py +++ b/release/scripts/truespace_export.py @@ -7,6 +7,8 @@ Group: 'Export' Tooltip: 'Export selected meshes to trueSpace File Format (*.cob)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2001 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/truespace_import.py b/release/scripts/truespace_import.py index 2b4f393d81f02678072342baa7dcd344283358f1..7898fa40fa7c1282023f1751003939c4e8915695 100644 --- a/release/scripts/truespace_import.py +++ b/release/scripts/truespace_import.py @@ -7,6 +7,8 @@ Group: 'Import' Tooltip: 'Import trueSpace Object File Format (*.cob)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2001 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/unweld044.py b/release/scripts/unweld044.py index 481aeab8aa247829f4c3581915dc0ec6d94eece8..469200ad1422df9219d65ed46dc6dac786583000 100644 --- a/release/scripts/unweld044.py +++ b/release/scripts/unweld044.py @@ -6,6 +6,8 @@ Group: 'Modifiers' Tip: 'unweld all faces from one selected and commun vertex. Made vertex bevelling' """ +# $Id$ +# # ------------------------------------------ # Un-Weld script 0.4.4 beta # diff --git a/release/scripts/uv_export.py b/release/scripts/uv_export.py index 5a4949524875d6d39ce8209f916438de844e0119..bbd2cb8eba8a1147e0aee7ca2e79cd4a8f025d0d 100644 --- a/release/scripts/uv_export.py +++ b/release/scripts/uv_export.py @@ -7,6 +7,8 @@ Group: 'UV' Tooltip: 'Export the UV face layout of the selected object to a .TGA file' """ +# $Id$ +# # -------------------------------------------------------------------------- # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/release/scripts/videoscape_export.py b/release/scripts/videoscape_export.py index 6cfbd3e9e1e26f8e1c9d5a91e2d640aea5762901..a647012d10465f9af05acb81b503d30879eceeb5 100644 --- a/release/scripts/videoscape_export.py +++ b/release/scripts/videoscape_export.py @@ -7,6 +7,8 @@ Group: 'Export' Tooltip: 'Export selected mesh to VideoScape File Format (*.obj)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2001 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/wings_export.py b/release/scripts/wings_export.py index 46112ac83fd4b9241efdfdd8b3a1f0eeb4a84e46..df36aec4c9f9c8164a3603adb9d7f6ab6e47faa2 100644 --- a/release/scripts/wings_export.py +++ b/release/scripts/wings_export.py @@ -7,6 +7,8 @@ Group: 'Export' Tooltip: 'Export selected mesh to Wings3D File Format (*.wings)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2002 Anthony D'Agostino | # | http://www.redrival.com/scorpius | @@ -268,6 +270,7 @@ def write(filename): start = time.clock() objects = Blender.Object.GetSelected() + objname = objects[0].name meshname = objects[0].data.name mesh = Blender.NMesh.GetRaw(meshname) @@ -280,28 +283,30 @@ def write(filename): message = "Unable to generate\nEdge Table for mesh.\n" message += "Object name is: " + meshname mod_meshtools.print_boxed(message) - #return - - if 0: - import Tkinter, tkMessageBox - sys.argv=['wings.pyo','wings.pyc'] # ? - - #Tkinter.NoDefaultRoot() - win1 = Tkinter.Tk() - ans = tkMessageBox.showerror("Error", message) - win1.pack() - print ans - if ans: - win1.quit() - win1.mainloop() - - else: - from Tkinter import Label - sys.argv = 'wings.py' - widget = Label(None, text=message) - #widget.title("Error") - widget.pack() - widget.mainloop() + Blender.Draw.PupMenu("Wings Export error|Unable to generate Edge Table for mesh") + return + + +# if 0: +# import Tkinter, tkMessageBox +# sys.argv=['wings.pyo','wings.pyc'] # ? +# +# #Tkinter.NoDefaultRoot() +# win1 = Tkinter.Tk() +# ans = tkMessageBox.showerror("Error", message) +# win1.pack() +# print ans +# if ans: +# win1.quit() +# win1.mainloop() +# +# else: +# from Tkinter import Label +# sys.argv = 'wings.py' +# widget = Label(None, text=message) +# #widget.title("Error") +# widget.pack() +# widget.mainloop() data = generate_data(objname, edge_table, mesh) dsize = len(data) @@ -334,4 +339,8 @@ def fs_callback(filename): if filename.find('.wings', -6) <= 0: filename += '.wings' write(filename) -Blender.Window.FileSelector(fs_callback, "Wings3D Export") + +if Blender.Object.GetSelected()[0].getType() != "Mesh": + Blender.Draw.PupMenu("Wings Export error|Selected object is not a mesh!") +else: + Blender.Window.FileSelector(fs_callback, "Wings3D Export") diff --git a/release/scripts/wings_import.py b/release/scripts/wings_import.py index 85d5fa377ad6797441a478b392ec60ededc7193c..b2e77ab0d16222c7bc6a0ffb9f6f6e59f9712f04 100644 --- a/release/scripts/wings_import.py +++ b/release/scripts/wings_import.py @@ -7,6 +7,8 @@ Group: 'Import' Tooltip: 'Import Wings3D File Format (*.wings)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2002 Anthony D'Agostino | # | http://www.redrival.com/scorpius | diff --git a/release/scripts/wrl2export.py b/release/scripts/wrl2export.py index b45f8e372e1cd30bbcd5f0d46251494a9f165539..2394a640395863b6a59683710c3c3c06a025a799 100644 --- a/release/scripts/wrl2export.py +++ b/release/scripts/wrl2export.py @@ -7,13 +7,14 @@ Submenu: 'All objects...' all Submenu: 'Only selected objects...' selected Tooltip: 'Export to VRML2 (.wrl) file.' """ + +# $Id$ +# #------------------------------------------------------------------------ # VRML2 exporter for blender 2.28a or above # # Source: http://blender.kimballsoftware.com/ # -# $Id$ -# # Authors: Rick Kimball with much inspiration # from the forum at www.elysiun.com # and irc://irc.freenode.net/blenderchat diff --git a/release/text/blender.html b/release/text/blender.html index 1d60be74682cca21779c5026a95c7b98c6150ed4..c7e88fb7064bcc0aefd34120ce13a6e337b0c2c6 100755 --- a/release/text/blender.html +++ b/release/text/blender.html @@ -35,7 +35,7 @@ world-wide community.</p> distribution. It's open-source software, released under a dual GPL / BL licence. The full program sources are available online.</p> -<p>For impatient readers; here the two most important links:</p> +<p>For impatient readers, here the two most important links:</p> <a href="http://www.blender.org">www.blender.org</a> the developement/community website<br> <a href="http://www.blender3d.org">www.blender3d.org</a> the general website<br> @@ -97,7 +97,10 @@ Some downloaded scripts may require extra Python modules not shipped with Blender. Installing the whole Python distribution is a way to solve this issue for most cases except scripts that require extensions (3rd party modules), but we are starting to add more modules to Blender itself so that -most scripts don't depend on full Python installs anymore.</p> +most scripts don't depend on full Python installs anymore. This is mostly +about Windows, in other platforms Python is usually a standard component +nowadays, so unless there's a version mismatch or an incomplete py +installation, there should be no problems.</p> <p>Even if you do have the right version of Python installed you may need to tell the embedded Python interpreter where the installation is. To do that @@ -279,11 +282,15 @@ YafRay and many goodies: sample .blend files with models, textures and animations, plugins, scripts, documentation, etc. It's an extensive reference written by Blender gurus and also a good way to help Blender development.</p> +<p><strong>New</strong>: the new guide's text is now available for download +online and the second edition of the printed book has also been released.</p> + <p>You can learn more about it at the main Blender site: <a href="http://www.blender3d.org">www.blender3d.org</a>. There you'll also find news, online documentation like tutorials, the 2.0 guide, the Blender -Python API Reference for script writers, etc. There are also forums, -galleries of images and movies, games, scripts, plugins, links and more.</p> +Python API Reference for script writers, docs for the newest features added +to the program, etc. There are also forums, galleries of images and movies, +games, scripts, plugins, links for many resources and more.</p> <p>The main Blender community site is elYsiun: <a href="http://www.elysiun.com">www.elysiun.com</a>. There's a lot of @@ -313,12 +320,14 @@ and should be updated on future versions of this text.</p> <dl> <dt><a href="http://www.gimp.org">The Gimp</a></dt> <dd>The mighty GNU Image Manipulation Program. In 3d work it is a valuable -resource to create, convert and, of course, manipulate texture images.</dd> +resource to create, convert and, of course, manipulate texture images. +It is also useful for work with rendered pictures, for example to add 2d text, +logos or to touch-up, apply factory or hand-made effects and compose with other +images.</dd> <dt><a href="http://www.wings3d.com">The Wings 3D modeler</a></dt> <dd>A great mesh modeler, with a different approach. Some things are much easier to model in Wings, others in Blender, making them a powerful combination -for experienced users. -</dd> +for experienced users.</dd> </dl> <h4>Renderers:</h4> @@ -402,6 +411,9 @@ usually the Python & Plugins forum at announcements, questions, suggestions and bug reports related to scripts. It's the recommended place to look first, specially if no site was specified at the script's window or source file(s).</p> +<p>If some or all scripts that should appear in menus are not there, running +Blender in <a href="#trouble_gen">debug mode </a> can possibly inform what is +wrong. Make sure the reported dir(s) really exist.</p> <h3><a name="trouble_bugt">The Bug Tracker</a></h3> @@ -430,6 +442,12 @@ make sure the scene has a camera pointing at your models (camera view is NumPad 0) and at least one light properly placed. Otherwise you'll only get a black rectangle.</p> +<p>Setting texture map input to "uv" in the Material Buttons window is not enough +to assign a texture image and uv data to a mesh. It's necessary to select the mesh, +enter face select mode (modes can be accessed in the 3d view's header), load an +image in the UV/Image Editor window and then define the mapping. Only then +the mesh will have uv data available for exporting.</p> + <p>If you want the fastest possible access to Blender's functionality, remember what a <cite>wise power user</cite> wrote: "keep one hand on the keyboard and the other on the mouse". Learn and use the shortcuts, configure your @@ -498,7 +516,7 @@ as "newbie-friendly". It doesn't come packed with "one-click" or "wizard" functionality, where you get much faster results in detriment of flexibility and value. It also isn't bundled with tens of megabytes of sample models, texture images, tutorials, etc. (which only partly explains how Blender can fit -in a less than 3 MB download).</p> +in a less than 4 MB download).</p> <p>Thankfully, these are not fatal shortcomings. The pace at which features are being added or polished in Blender is impressive, now that it's a well @@ -534,7 +552,7 @@ should not be sent to Blender developers or its bug tracker. Then <hr> <p>Thanks for reading, we hope you enjoy Blender!</p> -<p><font size=-1>Document version 1.0, april 2004</font></p> +<p><font size=-1>Document version 1.01, June 2004</font></p> <p align="right"><a href="#top">back to top</a></p> diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h index 0cc2c0aefc155cf3decb78240dd1fa79894b8cd9..a4a501148414e3f47fb075dd28496397e3d73382 100644 --- a/source/blender/include/blendef.h +++ b/source/blender/include/blendef.h @@ -342,6 +342,7 @@ /* SCRIPT: 525 */ #define B_SCRIPTBROWSE 526 +#define B_SCRIPT2BUTS 527 /* FILE: 550 */ #define B_SORTFILELIST 551 diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 0a2e0dd7cc5b6ae7fa5a9edbba73eaf976bdc498..4a7f347de5bf0757cf10655eb546be60fe7d04f9 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -42,7 +42,8 @@ #include <MEM_guardedalloc.h> #include <BLI_blenlib.h> /* for BLI_last_slash() */ -#include <BIF_interface.h> /* for pupmenu */ +#include <BDR_editobject.h> /* for exit_editmode() */ +#include <BIF_interface.h> /* for pupmenu() */ #include <BIF_space.h> #include <BIF_screen.h> #include <BIF_toolbox.h> @@ -273,10 +274,26 @@ void init_syspath(void) /*****************************************************************************/ void BPY_post_start_python(void) { + PyObject *result, *dict; + if (U.pythondir && U.pythondir[0] != '\0') syspath_append(U.pythondir); /* append to module search path */ BPyMenu_Init(0); /* get dynamic menus (registered scripts) data */ + + dict = PyDict_New(); + + /* here we check if the user has (some of) the expected modules */ + if (dict) { + char *s = "import chunk, gzip, math, os, struct, string"; + result = PyRun_String(s, Py_eval_input, dict, dict); + if (!result) { + PyErr_Clear(); + /*XXX print msg about this, point to readme.html */ + } + else Py_DECREF(result); + Py_DECREF(dict); + } } /*****************************************************************************/ @@ -425,6 +442,10 @@ int BPY_txt_do_python_Text(struct Text* text) return 0; } + /* if in it, leave editmode, since changes a script makes to meshdata + * can be lost otherwise. */ + if (G.obedit) exit_editmode(1); + script->id.us = 1; script->flags = SCRIPT_RUNNING; script->py_draw = NULL; @@ -586,6 +607,30 @@ int BPY_menu_do_python(short menutype, int event) return 0; } + /* if in editmode, leave it, since changes a script makes to meshdata + * can be lost otherwise. */ + if (G.obedit) exit_editmode(1); + + /* let's find a proper area for an eventual script gui: + * preference in order: Script, Buttons (if not a Wizards or Utils script), + * Text, any closest bigger area */ + if (curarea->spacetype != SPACE_SCRIPT) { + ScrArea *sa; + + sa = find_biggest_area_of_type(SPACE_SCRIPT); + + if (!sa) { + if ((menutype != PYMENU_WIZARDS) && (menutype != PYMENU_UTILS)) + sa = find_biggest_area_of_type(SPACE_BUTS); + } + + if (!sa) sa = find_biggest_area_of_type(SPACE_TEXT); + + if (!sa) sa = closest_bigger_area(); + + areawinset(sa->win); + } + script->id.us = 1; script->flags = SCRIPT_RUNNING; script->py_draw = NULL; diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index e8127931fedf62c0c0a6f2fe1bf99a095c833870..6566c19129134434b664ad6e5af329a935b45c5b 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -673,13 +673,6 @@ static uiBlock *info_runtime_optionsmenu(void *arg_unused) static void do_info_file_importmenu(void *arg, int event) { extern int BPY_menu_do_python(short menutype, int event); // BPY_interface.c - ScrArea *sa; - - if(curarea->spacetype==SPACE_INFO) { - sa= find_biggest_area_of_type(SPACE_SCRIPT); - if (!sa) sa= closest_bigger_area(); - areawinset(sa->win); - } BPY_menu_do_python(PYMENU_IMPORT, event); @@ -710,13 +703,6 @@ static uiBlock *info_file_importmenu(void *arg_unused) static void do_info_file_exportmenu(void *arg, int event) { extern int BPY_menu_do_python(short menutype, int event); // BPY_interface.c - ScrArea *sa; - - if(curarea->spacetype==SPACE_INFO) { - sa= find_biggest_area_of_type(SPACE_SCRIPT); - if (!sa) sa= closest_bigger_area(); - areawinset(sa->win); - } /* events >=3 are registered bpython scripts */ if (event >= 3) BPY_menu_do_python(PYMENU_EXPORT, event - 3); diff --git a/source/blender/src/header_script.c b/source/blender/src/header_script.c index 9b1d618ab7ebd26c7af901e37b644103828a6820..0ce38ec98468664a845eb4ad952ad8aed01dade0 100644 --- a/source/blender/src/header_script.c +++ b/source/blender/src/header_script.c @@ -202,6 +202,9 @@ void do_script_buttons(unsigned short event) allqueue(REDRAWHEADERS, 0); } break; + case B_SCRIPT2BUTS: + newspace(curarea, SPACE_BUTS); + break; } return; @@ -267,6 +270,12 @@ void script_buttons(void) xco += 2*XIC; xco= std_libbuttons(block, xco, 0, 0, NULL, B_SCRIPTBROWSE, (ID*)sc->script, 0, &(sc->menunr), 0, 0, 0, 0, 0); + if (sc->script && sc->script->lastspace == SPACE_BUTS) { + xco += 10; + uiDefIconBut(block, BUT, B_SCRIPT2BUTS, ICON_BUTS, xco+=XIC, 0, XIC, YIC, + 0, 0, 0, 0, 0, "Returns to Buttons Window"); + } + /* always as last */ curarea->headbutlen= xco+2*XIC;