Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release')
-rw-r--r--release/datafiles/preview.blendbin433792 -> 446288 bytes
-rw-r--r--release/plugins/sequence/dnr.c6
-rw-r--r--release/scripts/animation_bake_constraints.py2
-rw-r--r--release/scripts/console.py65
-rw-r--r--release/scripts/hotkeys.py1
-rw-r--r--release/scripts/import_obj.py8
-rw-r--r--release/scripts/ms3d_import_ascii.py479
-rw-r--r--release/text/blender.html154
8 files changed, 583 insertions, 132 deletions
diff --git a/release/datafiles/preview.blend b/release/datafiles/preview.blend
index 9e09d579b2b..78ced06bba9 100644
--- a/release/datafiles/preview.blend
+++ b/release/datafiles/preview.blend
Binary files differ
diff --git a/release/plugins/sequence/dnr.c b/release/plugins/sequence/dnr.c
index 7e7c168750e..b6a99de0622 100644
--- a/release/plugins/sequence/dnr.c
+++ b/release/plugins/sequence/dnr.c
@@ -110,9 +110,9 @@ static void doit(unsigned char * src_, unsigned char * dst_,
unsigned char * dst = dst_;
while (count--) {
- *dst++ = table[(*src++ << 8) | *dst];
- *dst++ = table[(*src++ << 8) | *dst];
- *dst++ = table[(*src++ << 8) | *dst];
+ *dst = table[(*src++ << 8) | *dst]; dst++;
+ *dst = table[(*src++ << 8) | *dst]; dst++;
+ *dst = table[(*src++ << 8) | *dst]; dst++;
*dst++ = *src++;
}
diff --git a/release/scripts/animation_bake_constraints.py b/release/scripts/animation_bake_constraints.py
index 8a416c3c488..58e9e2b1d02 100644
--- a/release/scripts/animation_bake_constraints.py
+++ b/release/scripts/animation_bake_constraints.py
@@ -602,7 +602,7 @@ def bakeObject(ob): #bakes the core object locrot and assigns the Ipo to a Clone
if ob != None:
# Clone the object - duplicate it, clean the clone, and create an ipo curve for the clone
myob = duplicateLinked(ob) #clone it
- myob.name= usrObjectNamePrefix + ob.getName()
+ myob.setName(usrObjectNamePrefix + ob.getName())
removeConstraintsOb(myob) #my object is a free man
deLinkOb('Ipo',myob) #kids, it's not nice to share. you've been lied to
if ob.getType() != ARMATURE: # baking armatures is based on bones, not object
diff --git a/release/scripts/console.py b/release/scripts/console.py
index 9a18c724d47..0e46f41f581 100644
--- a/release/scripts/console.py
+++ b/release/scripts/console.py
@@ -67,6 +67,8 @@ __FONT_SIZE__ = 2 # index for the list above, normal default.
global __CONSOLE_LINE_OFFSET__
__CONSOLE_LINE_OFFSET__ = 0
+cmdBuffer = [] # dosnt need to be global
+
'''
# Generic Blender functions
def getActScriptWinRect():
@@ -159,19 +161,13 @@ def include(filename):
return compile(filedata, filename, 'exec')
# Writes command line data to a blender text file.
-def writeCmdData(cmdLineList, type):
- if type == 3:
- typeList = [0,1,2, 3, None] # all
- else:
- typeList = [type] # so we can use athe lists 'in' methiod
-
+def writeCmdData(type):
newText = Text.New('command_output.py', 1)
- for myCmd in cmdLineList:
- if myCmd.type in typeList: # user input
- newText.write('%s\n' % myCmd.cmd)
+ if type == 3: newText.write('\n'.join( [ myCmd.cmd for myCmd in cmdBuffer ] ))
+ else: newText.write('\n'.join( [ myCmd.cmd for myCmd in cmdBuffer if myCmd.type is type] ))
Draw.PupMenu('%s written' % newText.name)
-def insertCmdData(cmdBuffer):
+def insertCmdData():
texts = list(bpy.data.texts)
textNames = [tex.name for tex in texts]
if textNames:
@@ -337,7 +333,6 @@ def handle_event(evt, val):
# Insert Char into the cammand line
def insCh(ch): # Instert a char
- global cmdBuffer
global cursor
# Later account for a cursor variable
cmdBuffer[-1].cmd = ('%s%s%s' % ( cmdBuffer[-1].cmd[:cursor], ch, cmdBuffer[-1].cmd[cursor:]))
@@ -346,7 +341,7 @@ def handle_event(evt, val):
# Define Complex Key Actions #
#------------------------------------------------------------------------------#
def actionEnterKey():
- global histIndex, cursor, cmdBuffer
+ global histIndex, cursor
def getIndent(string):
# Gather white space to add in the previous line
@@ -412,14 +407,20 @@ def handle_event(evt, val):
# Clear the output based on __LINE_HISTORY__
if len(cmdBuffer) > __LINE_HISTORY__:
- cmdBuffer = cmdBuffer[-__LINE_HISTORY__:]
+ cmdBuffer[:__LINE_HISTORY__] = []
histIndex = cursor = -1 # Reset cursor and history
def actionUpKey():
- global histIndex, cmdBuffer
+ global histIndex
if abs(histIndex)+1 >= len(cmdBuffer):
histIndex = -1
+
+ # When wrapping allow 1 plank lines
+ if cmdBuffer[-1].cmd != ' ':
+ cmdBuffer[-1].cmd = ' '
+ return
+
histIndex_orig = histIndex
histIndex -= 1
@@ -431,9 +432,15 @@ def handle_event(evt, val):
cmdBuffer[-1].cmd = cmdBuffer[histIndex].cmd
def actionDownKey():
- global histIndex, cmdBuffer
+ global histIndex
if histIndex >= -2:
histIndex = -len(cmdBuffer)
+
+ # When wrapping allow 1 plank lines
+ if cmdBuffer[-1].cmd != ' ':
+ cmdBuffer[-1].cmd = ' '
+ return
+
histIndex_orig = histIndex
histIndex += 1
while (cmdBuffer[histIndex].type != 0 and histIndex != -2) or \
@@ -446,18 +453,18 @@ def handle_event(evt, val):
def actionRightMouse():
global __FONT_SIZE__
- choice = Draw.PupMenu('Console Menu%t|Write Input Data (white)|Write Output Data (blue)|Write Error Data (red)|Write All Text|%l|Insert Blender text|%l|Font Size|%l|Quit')
+ choice = Draw.PupMenu('Console Menu%t|Write Input Data (white)|Write Output Data (blue)|Write Error Data (red)|Write All Text|%l|Insert Blender text|%l|Font Size|%l|Clear Output|Quit')
if choice == 1:
- writeCmdData(cmdBuffer, 0) # type 0 user
+ writeCmdData(0) # type 0 user
elif choice == 2:
- writeCmdData(cmdBuffer, 1) # type 1 user output
+ writeCmdData(1) # type 1 user output
elif choice == 3:
- writeCmdData(cmdBuffer, 2) # type 2 errors
+ writeCmdData(2) # type 2 errors
elif choice == 4:
- writeCmdData(cmdBuffer, 3) # All
+ writeCmdData(3) # All
elif choice == 6:
- insertCmdData(cmdBuffer) # Insert text from Blender and run it.
+ insertCmdData() # Insert text from Blender and run it.
elif choice == 8:
# Fontsize.
font_choice = Draw.PupMenu('Font Size%t|Large|Normal|Small|Tiny')
@@ -471,8 +478,10 @@ def handle_event(evt, val):
elif font_choice == 4:
__FONT_SIZE__ = 0
Draw.Redraw()
-
- elif choice == 10: # Exit
+ elif choice == 10: # Clear all output
+ cmdBuffer[:] = [cmd for cmd in cmdBuffer if cmd.type == 0] # keep user input
+ Draw.Redraw()
+ elif choice == 11: # Exit
Draw.Exit()
@@ -783,7 +792,6 @@ __CONSOLE_VAR_DICT__ = {} # Initialize var dict
# Print Startup lines, add __bpydoc__ to the console startup.
-cmdBuffer = []
for l in __bpydoc__.split('<br>'):
cmdBuffer.append( cmdLine(l, 1, None) )
@@ -827,12 +835,19 @@ def include_console(includeFile):
def standard_imports():
# Write local to global __CONSOLE_VAR_DICT__ for reuse,
+
+ exec('%s%s' % ('__CONSOLE_VAR_DICT__["bpy"]=', 'bpy'))
+ exec('%s%s' % ('__CONSOLE_VAR_DICT__["Blender"]=', 'Blender'))
+
for ls in (dir(), dir(Blender)):
for __TMP_VAR_NAME__ in ls:
# Execute the local > global coversion.
exec('%s%s' % ('__CONSOLE_VAR_DICT__[__TMP_VAR_NAME__]=', __TMP_VAR_NAME__))
- exec('%s%s' % ('__CONSOLE_VAR_DICT__["bpy"]=', 'bpy'))
+ # Add dummy imports to input so output scripts to a text file work as expected
+ cmdBuffer.append(cmdLine('import bpy', 0, 1))
+ cmdBuffer.append(cmdLine('import Blender', 0, 1)) # pretend we have been executed, as we kindof have.
+ cmdBuffer.append(cmdLine('from Blender import *', 0, 1))
if scriptDir and console_autoexec:
include_console(console_autoexec) # pass the blender module
diff --git a/release/scripts/hotkeys.py b/release/scripts/hotkeys.py
index 929132933ec..cb65eef84b2 100644
--- a/release/scripts/hotkeys.py
+++ b/release/scripts/hotkeys.py
@@ -264,6 +264,7 @@ hotkeys={
['Alt-A', 'Play animation in current window'],
['Ctrl-A', 'Apply objects size/rotation to object data'],
['Ctrl-A', 'Text Editor: Select all'],
+['Ctrl-ALT-A', '3D-View: Armature Edit mode, align selected bones to active bone'],
['Shift-A', 'Sequencer: Add menu'],
['Shift-A', '3D-View: Add menu'],
['Shift-ALT-A', 'Play animation in all windows'],
diff --git a/release/scripts/import_obj.py b/release/scripts/import_obj.py
index b467cca112f..6ddfb867a36 100644
--- a/release/scripts/import_obj.py
+++ b/release/scripts/import_obj.py
@@ -182,7 +182,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
else:
#print '\t\tloading mtl: "%s"' % mtlpath
context_material= None
- mtl= open(mtlpath)
+ mtl= open(mtlpath, 'rU')
for line in mtl: #.xreadlines():
if line.startswith('newmtl'):
context_material_name= line_value(line.split())
@@ -194,7 +194,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
elif context_material:
# we need to make a material to assign properties to it.
line_split= line.split()
- line_lower= line.lower()
+ line_lower= line.lower().lstrip()
if line_lower.startswith('ka'):
context_material.setMirCol((float(line_split[1]), float(line_split[2]), float(line_split[3])))
elif line_lower.startswith('kd'):
@@ -588,7 +588,7 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
print '\tpassing obj file "%s"...' % filepath,
time_sub= sys.time()
- file= open(filepath, 'r')
+ file= open(filepath, 'rU')
for line in file: #.xreadlines():
if line.startswith('v '):
@@ -859,7 +859,7 @@ else:
os.system('find /fe/obj -iname "*.obj" > /tmp/temp3ds_list')
print '...Done'
- file= open('/tmp/temp3ds_list', 'r')
+ file= open('/tmp/temp3ds_list', 'rU')
lines= file.readlines()
file.close()
diff --git a/release/scripts/ms3d_import_ascii.py b/release/scripts/ms3d_import_ascii.py
new file mode 100644
index 00000000000..d8c22a1ec99
--- /dev/null
+++ b/release/scripts/ms3d_import_ascii.py
@@ -0,0 +1,479 @@
+#!BPY
+"""
+Name: 'MilkShape3D ASCII (.txt)...'
+Blender: 245
+Group: 'Import'
+Tooltip: 'Import from a MilkShape3D ASCII file format (.txt)'
+"""
+#
+# Author: Markus Ilmola
+# Email: markus.ilmola@pp.inet.fi
+#
+# 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.
+#
+
+# import needed stuff
+import os.path
+import re
+import math
+from math import *
+import Blender
+from Blender import Mathutils
+from Blender.Mathutils import *
+
+
+
+# Converts ms3d euler angles to a rotation matrix
+def RM(a):
+ sy = sin(a[2])
+ cy = cos(a[2])
+ sp = sin(a[1])
+ cp = cos(a[1])
+ sr = sin(a[0])
+ cr = cos(a[0])
+ return Matrix([cp*cy, cp*sy, -sp], [sr*sp*cy+cr*-sy, sr*sp*sy+cr*cy, sr*cp],[cr*sp*cy+-sr*-sy, cr*sp*sy+-sr*cy, cr*cp])
+
+
+# Converts ms3d euler angles to a quaternion
+def RQ(a):
+ angle = a[2] * 0.5;
+ sy = sin(angle);
+ cy = cos(angle);
+ angle = a[1] * 0.5;
+ sp = sin(angle);
+ cp = cos(angle);
+ angle = a[0] * 0.5;
+ sr = sin(angle);
+ cr = cos(angle);
+ return Quaternion(cr*cp*cy+sr*sp*sy, sr*cp*cy-cr*sp*sy, cr*sp*cy+sr*cp*sy, cr*cp*sy-sr*sp*cy)
+
+
+# takes a texture filename and tries to load it
+def loadImage(path, filename):
+ image = None
+ try:
+ image = Blender.Image.Load(os.path.abspath(filename))
+ except IOError:
+ print "Warning: Failed to load image: " + filename + ". Trying short path instead...\n"
+ try:
+ image = Blender.Image.Load(os.path.dirname(path) + "/" + os.path.basename(filename))
+ except IOError:
+ print "Warning: Failed to load image: " + os.path.basename(filename) + "!\n"
+ return image
+
+
+
+# returns the next non-empty, non-comment line from the file
+def getNextLine(file):
+ ready = False
+ while ready==False:
+ line = file.readline()
+ if len(line)==0:
+ print "Warning: End of file reached."
+ return line
+ ready = True
+ line = line.strip()
+ if len(line)==0 or line.isspace():
+ ready = False
+ if len(line)>=2 and line[0]=='/' and line[1]=='/':
+ ready = False
+ return line
+
+
+
+# imports a MilkShape3D ascii file to the current scene
+def import_ms3d_ascii(path):
+ # limits
+ MAX_NUMMESHES = 1000
+ MAX_NUMVERTS = 100000
+ MAX_NUMNORMALS = 100000
+ MAX_NUMTRIS = 100000
+ MAX_NUMMATS = 16
+ MAX_NUMBONES = 100
+ MAX_NUMPOSKEYS = 1000
+ MAX_NUMROTKEYS = 1000
+
+ # get scene
+ scn = Blender.Scene.GetCurrent()
+ if scn==None:
+ return "No scene to import to!"
+
+ # open the file
+ try:
+ file = open(path, 'r')
+ except IOError:
+ return "Failed to open the file!"
+
+ # Read frame info
+ try:
+ lines = getNextLine(file).split()
+ if len(lines) != 2 or lines[0] != "Frames:":
+ raise ValueError
+ lines = getNextLine(file).split()
+ if len(lines) != 2 or lines[0] != "Frame:":
+ raise ValueError
+ except ValueError:
+ return "Frame information is invalid!"
+
+ # Create the mesh
+ meshOb = Blender.Object.New('Mesh', "MilkShape3D Object")
+ mesh = Blender.Mesh.New("MilkShape3D Mesh")
+ meshOb.link(mesh)
+ scn.objects.link(meshOb)
+
+ # read the number of meshes
+ try:
+ lines = getNextLine(file).split()
+ if len(lines)!=2 or lines[0]!="Meshes:":
+ raise ValueError
+ numMeshes = int(lines[1])
+ if numMeshes < 0 or numMeshes > MAX_NUMMESHES:
+ raise ValueError
+ except ValueError:
+ return "Number of meshes is invalid!"
+
+ # read meshes
+ vertBase = 0
+ faceBase = 0
+ boneIds = []
+ for i in range(numMeshes):
+ # read name, flags and material
+ try:
+ lines = re.findall(r'\".*\"|[^ ]+', getNextLine(file))
+ if len(lines)!=3:
+ raise ValueError
+ material = int(lines[2])
+ except ValueError:
+ return "Name, flags or material in mesh " + str(i+1) + " are invalid!"
+
+ # read the number of vertices
+ try:
+ numVerts = int(getNextLine(file))
+ if numVerts < 0 or numVerts > MAX_NUMVERTS:
+ raise ValueError
+ except ValueError:
+ return "Number of vertices in mesh " + str(i+1) + " is invalid!"
+
+ # read vertices
+ coords = []
+ uvs = []
+ for j in xrange(numVerts):
+ try:
+ lines = getNextLine(file).split()
+ if len(lines)!=7:
+ raise ValueError
+ coords.append([float(lines[1]), float(lines[2]), float(lines[3])])
+ uvs.append([float(lines[4]), 1-float(lines[5])])
+ boneIds.append(int(lines[6]))
+ except ValueError:
+ return "Vertex " + str(j+1) + " in mesh " + str(i+1) + " is invalid!"
+ mesh.verts.extend(coords)
+
+ # read number of normals
+ try:
+ numNormals = int(getNextLine(file))
+ if numNormals < 0 or numNormals > MAX_NUMNORMALS:
+ raise ValueError
+ except ValueError:
+ return "Number of normals in mesh " + str(i+1) + " is invalid!"
+
+ # read normals
+ normals = []
+ for j in xrange(numNormals):
+ try:
+ lines = getNextLine(file).split()
+ if len(lines)!=3:
+ raise ValueError
+ normals.append([float(lines[0]), float(lines[1]), float(lines[2])])
+ except ValueError:
+ return "Normal " + str(j+1) + " in mesh " + str(i+1) + " is invalid!"
+
+ # read the number of triangles
+ try:
+ numTris = int(getNextLine(file))
+ if numTris < 0 or numTris > MAX_NUMTRIS:
+ raise ValueError
+ except ValueError:
+ return "Number of triangles in mesh " + str(i+1) + " is invalid!"
+
+ # read triangles
+ faces = []
+ for j in xrange(numTris):
+ # read the triangle
+ try:
+ lines = getNextLine(file).split()
+ if len(lines)!=8:
+ raise ValueError
+ v1 = int(lines[1])
+ v2 = int(lines[2])
+ v3 = int(lines[3])
+ faces.append([v1+vertBase, v2+vertBase, v3+vertBase])
+ except ValueError:
+ return "Triangle " + str(j+1) + " in mesh " + str(i+1) + " is invalid!"
+ mesh.faces.extend(faces)
+
+ # set texture coordinates and material
+ for j in xrange(faceBase, len(mesh.faces)):
+ face = mesh.faces[j]
+ face.uv = [Vector(uvs[face.verts[0].index-vertBase]), Vector(uvs[face.verts[1].index-vertBase]), Vector(uvs[face.verts[2].index-vertBase])]
+ if material>=0:
+ face.mat = material
+
+ # increase vertex and face base
+ vertBase = len(mesh.verts)
+ faceBase = len(mesh.faces)
+
+ # read the number of materials
+ try:
+ lines = getNextLine(file).split()
+ if len(lines)!=2 or lines[0]!="Materials:":
+ raise ValueError
+ numMats = int(lines[1])
+ if numMats < 0 or numMats > MAX_NUMMATS:
+ raise ValueError
+ except ValueError:
+ return "Number of materials is invalid!"
+
+ # read the materials
+ for i in range(numMats):
+ # read name
+ name = getNextLine(file)[1:-1]
+
+ # create the material
+ mat = Blender.Material.New(name)
+ mesh.materials += [mat]
+
+ # read ambient color
+ try:
+ lines = getNextLine(file).split()
+ if len(lines)!=4:
+ raise ValueError
+ amb = (float(lines[0])+float(lines[1])+float(lines[2]))/3
+ mat.setAmb(amb)
+ except ValueError:
+ return "Ambient color in material " + str(i+1) + " is invalid!"
+
+ # read diffuse color
+ try:
+ lines = getNextLine(file).split()
+ if len(lines)!=4:
+ raise ValueError
+ mat.setRGBCol([float(lines[0]), float(lines[1]), float(lines[2])])
+ except ValueError:
+ return "Diffuse color in material " + str(i+1) + " is invalid!"
+
+ # read specular color
+ try:
+ lines = getNextLine(file).split()
+ if len(lines)!=4:
+ raise ValueError
+ mat.setSpecCol([float(lines[0]), float(lines[1]), float(lines[2])])
+ except ValueError:
+ return "Specular color in material " + str(i+1) + " is invalid!"
+
+ # read emissive color
+ try:
+ lines = getNextLine(file).split()
+ if len(lines)!=4:
+ raise ValueError
+ emit = (float(lines[0])+float(lines[1])+float(lines[2]))/3
+ mat.setEmit(emit)
+ except ValueError:
+ return "Emissive color in material " + str(i+1) + " is invalid!"
+
+ # read shininess
+ try:
+ shi = float(getNextLine(file))
+ #mat.setHardness(int(shi))
+ except ValueError:
+ return "Shininess in material " + str(i+1) + " is invalid!"
+
+ # read transparency
+ try:
+ alpha = float(getNextLine(file))
+ mat.setAlpha(alpha)
+ if alpha < 1:
+ mat.mode |= Blender.Material.Modes.ZTRANSP
+ except ValueError:
+ return "Transparency in material " + str(i+1) + " is invalid!"
+
+ # read texturemap
+ texturemap = getNextLine(file)[1:-1]
+ if len(texturemap)>0:
+ colorTexture = Blender.Texture.New(name + "_texture")
+ colorTexture.setType('Image')
+ colorTexture.setImage(loadImage(path, texturemap))
+ mat.setTexture(0, colorTexture, Blender.Texture.TexCo.UV, Blender.Texture.MapTo.COL)
+
+ # read alphamap
+ alphamap = getNextLine(file)[1:-1]
+ if len(alphamap)>0:
+ alphaTexture = Blender.Texture.New(name + "_alpha")
+ alphaTexture.setType('Image')
+ alphaTexture.setImage(loadImage(path, alphamap))
+ mat.setTexture(1, alphaTexture, Blender.Texture.TexCo.UV, Blender.Texture.MapTo.ALPHA)
+
+ # read the number of bones
+ try:
+ lines = getNextLine(file).split()
+ if len(lines)!=2 or lines[0]!="Bones:":
+ raise ValueError
+ numBones = int(lines[1])
+ if numBones < 0 or numBones > MAX_NUMBONES:
+ raise ValueError
+ except:
+ return "Number of bones is invalid!"
+
+ # create the armature
+ armature = None
+ armOb = None
+ if numBones > 0:
+ armOb = Blender.Object.New('Armature', "MilkShape3D Skeleton")
+ armature = Blender.Armature.New("MilkShape3D Skeleton")
+ armature.drawType = Blender.Armature.STICK
+ armOb.link(armature)
+ scn.objects.link(armOb)
+ armOb.makeParentDeform([meshOb])
+ armature.makeEditable()
+
+ # read bones
+ posKeys = {}
+ rotKeys = {}
+ for i in range(numBones):
+ # read name
+ name = getNextLine(file)[1:-1]
+
+ # create the bone
+ bone = Blender.Armature.Editbone()
+ armature.bones[name] = bone
+
+ # read parent
+ parent = getNextLine(file)[1:-1]
+ if len(parent)>0:
+ bone.parent = armature.bones[parent]
+
+ # read position and rotation
+ try:
+ lines = getNextLine(file).split()
+ if len(lines) != 7:
+ raise ValueError
+ pos = [float(lines[1]), float(lines[2]), float(lines[3])]
+ rot = [float(lines[4]), float(lines[5]), float(lines[6])]
+ except ValueError:
+ return "Invalid position or orientation in a bone!"
+
+ # set position and orientation
+ if bone.hasParent():
+ bone.head = Vector(pos) * bone.parent.matrix + bone.parent.head
+ bone.tail = bone.head + Vector([1,0,0])
+ tempM = RM(rot) * bone.parent.matrix
+ tempM.transpose;
+ bone.matrix = tempM
+ else:
+ bone.head = Vector(pos)
+ bone.tail = bone.head + Vector([1,0,0])
+ bone.matrix = RM(rot)
+
+ # Create vertex group for this bone
+ mesh.addVertGroup(name)
+ vgroup = []
+ for index, v in enumerate(boneIds):
+ if v==i:
+ vgroup.append(index)
+ mesh.assignVertsToGroup(name, vgroup, 1.0, 1)
+
+ # read the number of position key frames
+ try:
+ numPosKeys = int(getNextLine(file))
+ if numPosKeys < 0 or numPosKeys > MAX_NUMPOSKEYS:
+ raise ValueError
+ except ValueError:
+ return "Invalid number of position key frames!"
+
+ # read position key frames
+ posKeys[name] = []
+ for j in range(numPosKeys):
+ # read time and position
+ try:
+ lines = getNextLine(file).split()
+ if len(lines) != 4:
+ raise ValueError
+ time = float(lines[0])
+ pos = [float(lines[1]), float(lines[2]), float(lines[3])]
+ posKeys[name].append([time, pos])
+ except ValueError:
+ return "Invalid position key frame!"
+
+ # read the number of rotation key frames
+ try:
+ numRotKeys = int(getNextLine(file))
+ if numRotKeys < 0 or numRotKeys > MAX_NUMROTKEYS:
+ raise ValueError
+ except ValueError:
+ return "Invalid number of rotation key frames!"
+
+ # read rotation key frames
+ rotKeys[name] = []
+ for j in range(numRotKeys):
+ # read time and rotation
+ try:
+ lines = getNextLine(file).split()
+ if len(lines) != 4:
+ raise ValueError
+ time = float(lines[0])
+ rot = [float(lines[1]), float(lines[2]), float(lines[3])]
+ rotKeys[name].append([time, rot])
+ except ValueError:
+ return "Invalid rotation key frame!"
+
+ # create action and pose
+ action = None
+ pose = None
+ if armature != None:
+ armature.update()
+ pose = armOb.getPose()
+ action = armOb.getAction()
+ if not action:
+ action = Blender.Armature.NLA.NewAction()
+ action.setActive(armOb)
+
+ # create animation key frames
+ for name, pbone in pose.bones.items():
+ # create position keys
+ for key in posKeys[name]:
+ pbone.loc = Vector(key[1])
+ pbone.insertKey(armOb, int(key[0]+0.5), Blender.Object.Pose.LOC, True)
+
+ # create rotation keys
+ for key in rotKeys[name]:
+ pbone.quat = RQ(key[1])
+ pbone.insertKey(armOb, int(key[0]+0.5), Blender.Object.Pose.ROT, True)
+
+ # set the imported object to be the selected one
+ scn.objects.selected = []
+ meshOb.sel= 1
+ Blender.Redraw()
+
+ # The import was a succes!
+ return ""
+
+
+# load the model
+def fileCallback(filename):
+ error = import_ms3d_ascii(filename)
+ if error!="":
+ Blender.Draw.PupMenu("An error occured during import: " + error + "|Not all data might have been imported succesfully.", 2)
+
+Blender.Window.FileSelector(fileCallback, 'Import')
diff --git a/release/text/blender.html b/release/text/blender.html
index c7e88fb7064..30c8f0b0dc2 100644
--- a/release/text/blender.html
+++ b/release/text/blender.html
@@ -7,7 +7,7 @@
</head>
<body>
-<h1 align="center"><a name="top">Blender v2.3x series</a></h1>
+<h1 align="center"><a name="top">Blender v2.4x series</a></h1>
<br>
<ol>
<li><a href="#intro">About</a></li>
@@ -25,19 +25,19 @@
<h2><a name="intro">1. About</a></h2>
-<p>Welcome to the world of <a href="http://www.blender3d.org">Blender</a>!
+<p>Welcome to the world of <a href="http://www.blender.org">Blender</a>!
The program you have now in your hands is a free and fully functional 3D
-modeling, rendering, animation and game creation suite. It is available for
+modeling, animation, rendering, compositing, video editing and game creation suite. It is available for
Unix-based (Linux, Mac OS X, etc.) and Windows systems and has a large
world-wide community.</p>
<p>Blender is free to be applied for any purpose, including commercial usage and
-distribution. It's open-source software, released under a dual GPL / BL
-licence. The full program sources are available online.</p>
+distribution. It's free and open-source software, released under the GNU GPL
+licence. The full program sources are available on our website.</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>
+<a href="http://www.blender.org">www.blender.org</a> the main website<br>
+<a href="http://wiki.blender.org">wiki.blender.org</a> the documentation website<br>
<p align="right"><a href="#top">back to top</a></p>
@@ -58,7 +58,7 @@ plugins and more.</p>
<p>If you are interested in the development of the program, information for
coders and the CVS repository with the sources can be found at the
-<a href="http://www.blender.org">developer's site.</a></p>
+<a href="http://www.blender.org/development/">developer's section of the site.</a></p>
<h3><a name="start_install">Installation notes:</a></h3>
@@ -108,7 +108,7 @@ it's enough to set a system variable called PYTHON to the full path to the
stand-alone Python executable (to find out execute "import sys; print
sys.executable" inside the stand-alone interpreter, not in Blender). To check
which Python was linked to your Blender binary, execute "import sys; print
-sys.version" at Blender's text editor), it's probably 2.3.something -- only the
+sys.version" at Blender's text editor), it's probably 2.5.something -- only the
two first numbers should have to match with yours.</p>
@@ -130,10 +130,10 @@ Renderman compliant ones. By <strong>animating</strong> the data and rendering
pictures of each successive frame, movie sequences can be created.</p>
<p>In <strong>compositing</strong> a set of techniques is used to add effects
-to movie strips and combine these into a single video. This is how, for
-example, artists add laser beams, glows and dinossaurs to motion
-pictures. Blender is not a specific tool for this purpose, but it has builtin
-support for video sequencing and sound synchronization.</p>
+to rendered images and combine these into a single frame. This is how, for
+example, artists add laser beams, glows and dinosaurs to motion
+pictures. Blender also has builtin
+support for video sequence editing and sound synchronization.</p>
<p>The <strong>game engine</strong> inside Blender lets users create and play
nifty 3d games, complete with 3d graphics, sound, physics and scripted rules.
@@ -158,10 +158,10 @@ yourself for your favorite window manager.</p>
command-line prompt. Try "blender -h" to see all available options.</p>
<p>Blender saves data in its own custom binary format, using ".blend" as
-extension. The default start-up configuration is saved in a file called
+extension. The default start-up configuration is saved in a file in your home directory called
.B.blend. To save your changes to it, click on
<strong>File-&gt;Save Default Settings</strong> or use the Control+u shortcut
-directly. To revert to factory defaults, erase the .B.blend file.</p>
+directly.</p>
<h3><a name="start_1st">First steps:</a></h3>
@@ -173,8 +173,7 @@ syndrome, just relax and <a href="#faq_2">read this part</a> of the F.A.Q. </p>
<p>Hoping the explanations helped, let's start Blender and take a look at it.
At the top header you can see the main menu. Under "File" you'll find entries
to save, load and quit. If <em>someone</em> ever messes with your workspace
-and you can't find your way around: press q to quit. Then erase the .B.blend
-file in your home dir and the program will be back to factory defaults.</p>
+and you can't find your way around: use the menu <strong>File->Load Factory settings</strong>.</p>
<p>Blender's screen is divided in "areas". Each of them has a top or bottom
header and can show any of the available builtin applications (called "spaces",
@@ -265,9 +264,8 @@ each space.</p>
<h2><a name="resources">4. Resources</a></h2>
<ul>
- <li><a href="http://www.blender3d.org">www.blender3d.org</a> - the general site, with documentation and downloads</li>
- <li><a href="http://www.elysiun.com">www.elysiun.com</a> - the user community</li>
- <li><a href="http://www.blender.org">www.blender.org</a> - the developer's site</li>
+ <li><a href="http://www.blender.org">www.blender.org</a> - the general site, with documentation and downloads</li>
+ <li><a href="http://www.blenderartists.org">www.blenderartists.org</a> - the main user community web site</li>
<li><a href="http://projects.blender.org">projects.blender.org</a> - the project's site</li>
</ul>
@@ -276,38 +274,15 @@ each space.</p>
resources you will need. We can't teach you 3D in these few lines of text,
that would take a lengthy book.</p>
-<p>The Blender Foundation has released a new guide, with hundreds of pages of
-illustrated tutorials. It comes with a CD-ROM that has Blender version 2.32,
-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, 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
-activity in its user forums, where newbie and guru users share tips and tricks,
-show their most recent images, movies and scripts, ask for help and generally
-have a good time.</p>
-
<p>Irc users are invited to try #blenderchat on irc.freenode.net .</p>
<p>There are also local Blender community sites in some countries, that should
-be listed at the links section of the main site.</p>
+be listed at the Community section of the main site.</p>
-<p>If you are a coder wanting to get in touch with Blender development, the
-developer's site is at <a href="http://www.blender.org">www.blender.org</a>. A
+<p>If you are a coder wanting to get in touch with Blender development, a good read
+is the "Get Involved" page at <a href="http://www.blender.org/community/get-involved/">www.blender.org</a>. A
good way to start is to follow the mailing lists for a while and check bug
-reports, to see if you can fix one. On irc.freenode.net: #blendersauce (open channel)
-and #blendercoders (official channel, where also meetings take place).</p>
+reports, to see if you can fix one. On irc.freenode.net: #blendercoders you'll find many active developers, here also the weekly meetings take place.</p>
<h3><a name="resources_xtra">Other useful links</a></h3>
@@ -324,17 +299,14 @@ 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>
+
</dl>
<h4>Renderers:</h4>
<dl>
<dt><a href="http://www.yafray.org">YafRay</a></dt>
- <dd>A relatively new and already very impressive program. Blender has builtin
+ <dd>A currently inactive but very impressive program. Blender has builtin
support for it.</dd>
<dt><a href="http://www.povray.org">Povray</a></dt>
<dd>One of the best and most popular renderers in the world. There is a
@@ -384,19 +356,8 @@ buttons and pulldown menus. That means also the 2D options for OpenGL should
work good, something easily ignored or badly tested by 3D card manufacturors, who
target more at the latest SFX features for new 3D games.<br>
In general Blender performs
-very well on 3D cards from renowned brands, such as NVidia, ATI or 3DLabs. Recently
-however, new drivers (especially for ATI) have shown that they're dropping basic
-OpenGL support needed for proper menu drawing in Blender. Downgrading drivers then
-always works, but we're also working on rebuilding the (quite old) code for GUI
-drawing to prevent such errors from ever happening again.</p>
-
-<p>Some useful links to check:<br>
+very well on 3D cards from renowned brands, such as NVidia, ATI or 3DLabs.</p>
-<a href="http://www.blender3d.org/cms/FAQ.194.0.html">The graphics card FAQ</a><br>
-<a href="http://www.blender.org/modules/gfxdatabase/index.php">3D card performance database</a><br>
-
-
-</p>
<h3><a name="trouble_py">Scripts</a></h3>
@@ -407,7 +368,7 @@ one of the submenus there, it refers to a script. Please don't report problems
with scripts to the bug tracker or other normal Blender channels. You should
find the author's site or contact email in the script's text itself, but
usually the Python &amp; Plugins forum at
-<a href="http://www.elysiun.com">elYsiun</a> is used for posting
+<a href="http://www.blenderartists.org">Blenderartists.org</a> is used for posting
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>
@@ -444,8 +405,8 @@ 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
+enter edit mode, indicate face selection mode (modes can be accessed in the 3d view's header), load an
+image in the UV/Image Editor window and then define a mapping (or unwrapping). 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
@@ -455,23 +416,24 @@ workspace to your needs.</p>
<h3><a name="faq_2">What's up with the interface?</a></h3>
-<p>Blender does not follow the most common, somewhat standard rules for user
-interfaces -- it doesn't look like most programs do -- which is not necessarily
-a bad thing. There used to be two sides to this: Blender was both a powerful
-production tool for professionals and enthusiasts who dedicated enough time to
-master it and also a nightmare for some newcomers who might have tried one of
-the commercial 3d modelers first. The main reason for this is that
-Blender was born as an in-house studio tool, optimized to speed up daily heavy
-work, not to please everyone. But it's true that in the past the interface
-was far from newbie-friendly.</p>
-
-<p>Hopefully this is not the case anymore: it has been considerably
-improved for the 2.3x series, exposing most functionality via menus, adding
+<p>Blender uses a couple of innovative paradigms in the UI, not following more common, somewhat standard rules for user
+interfaces. In the past years several of our interface concepts have been adopted in more programs though,
+especially using a configurable non-overlapping subdivision layout and the paradigm to never block the UI from working by
+offering all editors and options in parallel. <br>
+Typically free programs offer easy-to-use interfaces for large audiences. Blender however is, like other high-end 3D tools,
+meant to be a powerful production tool for professionals and 3D enthusiasts, for people who are dedicated to become 3D artists with enough time
+and motivation to master the software. <br>
+This also has its origins in the 90ies, when Blender was born as an in-house studio tool, optimized to speed up daily heavy
+work, and not to please everyone. But it's true that you can consider Blender's interface
+to be not very newbie-friendly. Luckily you only have to learn it once, and once you get the basics it'll feel like 2nd nature!</p>
+
+<p>Blender also has been considerably
+improved since the 2.3x series, exposing most functionality via menus, adding
panels, color "themability", tooltips for all buttons and internationalization
support. This is an ongoing effort or, better, a goal to keep the best ideas
in Blender's design while expanding and making it more user-friendly.</p>
-<p>Too many buttons!</p>
+<p><b>Too many buttons!</b></p>
<p>Again, 3D Computer Graphics is a vast and fun field. If you're only
starting, Blender can seem daunting, specially because of all its packed
@@ -503,38 +465,39 @@ play with. A few more months and you'll probably be back asking for more ...
<p>If you ever get the impression that it's not possible to create great
looking or complex works with Blender, rejoice -- you are just plainly
-uninformed, as browsing galleries and community forums can easily confirm.</p>
+uninformed, as browsing blender.org galleries and community forums can easily confirm.</p>
<h3>How does it compare to other 3d programs?</h3>
<p>In short: it takes considerable dedication to become good, no matter which
program you work with, as long as it is good enough not to get in your way.
-Blender is. And, like the others, has strong and weak points.</p>
+Blender has, like the others, its strong and weak points.</p>
<p>Compared to commercial alternatives, Blender misses some features and isn't
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 4 MB download).</p>
+in such a small download).</p>
-<p>Thankfully, these are not fatal shortcomings. The pace at which features
+<p>Thankfully, these are relatively minor shortcomings. Many of Blender's modeling, animation and
+rendering/compositing features are up-to-par with the industry standards. The pace at which features
are being added or polished in Blender is impressive, now that it's a well
-stablished open source project. More: through plugins and scripting, many
+stablished open source project. We get daily feedback from professionals and studios using Blender, and
+results from the Blender Foundation's Open Movie/Game projects such as <a href="http://www.bigbuckbunny.org">Big Buck Bunny</a>
+and <a href="http://www.yofrankie.org">Yo Frankie!</a> have set a reference standard for what a program like Blender can achieve.
+ More: through plugins and scripting, many
repetitive or otherwise cumbersome tasks can be made trivial. But plugin and
script authors go further, teaching Blender new tricks, from importers and
exporters to more advanced "applications".</p>
<p>About goodies, there are many places where you can get them (check
-<a href="#resources">resources</a>). Besides the book, the main site and
-elYsiun are the best ones to start, specially because some resources you
-find spread on the net are not up-to-date with current program versions. This
-doesn't render old tutorials or books useless -- just a little harder to
-follow, sometimes -- but older scripts probably won't work. For free texture
+<a href="#resources">resources</a>). Besides the many available Blender books, the main site and
+blenderartists.org are the best ones to start. For free texture
images, a simple search for "free textures" should bring many results, just pay
attention to their licenses if you plan to release your work later.</p>
-<p>Commercial packages can make it easier for newbies to produce nice looking
+<p>Commercial packages might make it easier for newbies to produce nice looking
material, but only another newbie would praise the results. There's a huge
difference between what a skilled artist and someone poking at buttons and
using presets can accomplish.</p>
@@ -542,17 +505,10 @@ using presets can accomplish.</p>
<p>Last but best of all: Blender is open-source, free for all to use, study and
improve.</p>
-
-<h3><a name="faq_4">Something doesn't work, what do I do?</a></h3>
-
-<p>First note again that errors and questions related to specific scripts
-should not be sent to Blender developers or its bug tracker. Then
-<a href="#trouble">read this short section thoroughly</a>, please.</p>
-
<hr>
<p>Thanks for reading, we hope you enjoy Blender!</p>
-<p><font size=-1>Document version 1.01, June 2004</font></p>
+<p><font size=-1>Document version 1.1, Sept 2008</font></p>
<p align="right"><a href="#top">back to top</a></p>