[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15065] branches/soc-2008-jaguarandi: Merge from trunk
André Pinto
andresusanopinto at gmail.com
Fri May 30 22:33:33 CEST 2008
Revision: 15065
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15065
Author: jaguarandi
Date: 2008-05-30 22:33:33 +0200 (Fri, 30 May 2008)
Log Message:
-----------
Merge from trunk
svn merge -r 14954:15064 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Modified Paths:
--------------
branches/soc-2008-jaguarandi/config/win32-vc-config.py
branches/soc-2008-jaguarandi/intern/ghost/intern/GHOST_WindowWin32.cpp
branches/soc-2008-jaguarandi/release/scripts/3ds_import.py
branches/soc-2008-jaguarandi/release/scripts/uv_seams_from_islands.py
branches/soc-2008-jaguarandi/release/scripts/uvcalc_lightmap.py
branches/soc-2008-jaguarandi/release/windows/installer/00.sconsblender.nsi
branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_curve.h
branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/curve.c
branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/displist.c
branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/font.c
branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c
branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/object.c
branches/soc-2008-jaguarandi/source/blender/blenlib/intern/freetypefont.c
branches/soc-2008-jaguarandi/source/blender/blenlib/intern/psfont.c
branches/soc-2008-jaguarandi/source/blender/blenlib/intern/util.c
branches/soc-2008-jaguarandi/source/blender/include/BDR_editcurve.h
branches/soc-2008-jaguarandi/source/blender/include/transform.h
branches/soc-2008-jaguarandi/source/blender/makesdna/intern/makesdna.c
branches/soc-2008-jaguarandi/source/blender/nodes/intern/Makefile
branches/soc-2008-jaguarandi/source/blender/python/api2_2x/Draw.c
branches/soc-2008-jaguarandi/source/blender/python/api2_2x/Node.c
branches/soc-2008-jaguarandi/source/blender/python/api2_2x/Object.c
branches/soc-2008-jaguarandi/source/blender/python/api2_2x/Particle.c
branches/soc-2008-jaguarandi/source/blender/python/api2_2x/Scene.c
branches/soc-2008-jaguarandi/source/blender/python/api2_2x/doc/Object.py
branches/soc-2008-jaguarandi/source/blender/python/api2_2x/sceneRender.c
branches/soc-2008-jaguarandi/source/blender/render/extern/include/RE_raytrace.h
branches/soc-2008-jaguarandi/source/blender/render/intern/source/envmap.c
branches/soc-2008-jaguarandi/source/blender/render/intern/source/pipeline.c
branches/soc-2008-jaguarandi/source/blender/render/intern/source/rayshade.c
branches/soc-2008-jaguarandi/source/blender/src/buttons_editing.c
branches/soc-2008-jaguarandi/source/blender/src/buttons_shading.c
branches/soc-2008-jaguarandi/source/blender/src/drawobject.c
branches/soc-2008-jaguarandi/source/blender/src/drawview.c
branches/soc-2008-jaguarandi/source/blender/src/editarmature.c
branches/soc-2008-jaguarandi/source/blender/src/editcurve.c
branches/soc-2008-jaguarandi/source/blender/src/editnode.c
branches/soc-2008-jaguarandi/source/blender/src/interface.c
branches/soc-2008-jaguarandi/source/blender/src/meshtools.c
branches/soc-2008-jaguarandi/source/blender/src/poseobject.c
branches/soc-2008-jaguarandi/source/blender/src/sequence.c
branches/soc-2008-jaguarandi/source/blender/src/toets.c
branches/soc-2008-jaguarandi/source/blender/src/transform_conversions.c
branches/soc-2008-jaguarandi/source/blender/src/transform_manipulator.c
branches/soc-2008-jaguarandi/source/blender/src/transform_orientations.c
branches/soc-2008-jaguarandi/source/blender/src/view.c
branches/soc-2008-jaguarandi/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
branches/soc-2008-jaguarandi/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
branches/soc-2008-jaguarandi/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
branches/soc-2008-jaguarandi/source/gameengine/GamePlayer/common/GPC_RenderTools.h
branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_GameObject.cpp
branches/soc-2008-jaguarandi/source/gameengine/Ketsji/KX_GameObject.h
branches/soc-2008-jaguarandi/source/gameengine/Rasterizer/RAS_IRenderTools.h
branches/soc-2008-jaguarandi/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
Removed Paths:
-------------
branches/soc-2008-jaguarandi/release/scripts/uv_from_adjacent.py
Modified: branches/soc-2008-jaguarandi/config/win32-vc-config.py
===================================================================
--- branches/soc-2008-jaguarandi/config/win32-vc-config.py 2008-05-30 20:04:52 UTC (rev 15064)
+++ branches/soc-2008-jaguarandi/config/win32-vc-config.py 2008-05-30 20:33:33 UTC (rev 15065)
@@ -157,7 +157,7 @@
C_WARN = []
CC_WARN = []
-LLIBS = 'ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid'
+LLIBS = 'ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid'
PLATFORM_LINKFLAGS = '''
/SUBSYSTEM:CONSOLE
Modified: branches/soc-2008-jaguarandi/intern/ghost/intern/GHOST_WindowWin32.cpp
===================================================================
--- branches/soc-2008-jaguarandi/intern/ghost/intern/GHOST_WindowWin32.cpp 2008-05-30 20:04:52 UTC (rev 15064)
+++ branches/soc-2008-jaguarandi/intern/ghost/intern/GHOST_WindowWin32.cpp 2008-05-30 20:33:33 UTC (rev 15065)
@@ -871,12 +871,25 @@
for(i=1; i<=n; i++) { /* not the idiom, but it's right */
::DescribePixelFormat( hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd );
w = WeightPixelFormat(pfd);
- if(w > weight) {
- weight = w;
- iPixelFormat = i;
+ // be strict on stereo
+ if (!((sPreferredFormat.dwFlags ^ pfd.dwFlags) & PFD_STEREO)) {
+ if(w > weight) {
+ weight = w;
+ iPixelFormat = i;
+ }
}
}
-
+ if (weight == 0) {
+ // we could find the correct stereo setting, just find any suitable format
+ for(i=1; i<=n; i++) { /* not the idiom, but it's right */
+ ::DescribePixelFormat( hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd );
+ w = WeightPixelFormat(pfd);
+ if(w > weight) {
+ weight = w;
+ iPixelFormat = i;
+ }
+ }
+ }
return iPixelFormat;
}
Modified: branches/soc-2008-jaguarandi/release/scripts/3ds_import.py
===================================================================
--- branches/soc-2008-jaguarandi/release/scripts/3ds_import.py 2008-05-30 20:04:52 UTC (rev 15064)
+++ branches/soc-2008-jaguarandi/release/scripts/3ds_import.py 2008-05-30 20:33:33 UTC (rev 15065)
@@ -419,7 +419,7 @@
ob.setMatrix(contextMatrix_rot)
importedObjects.append(ob)
-
+ bmesh.calcNormals()
for matName, faces in myContextMeshMaterials.iteritems():
makeMeshMaterialCopy(matName, faces)
@@ -664,9 +664,8 @@
#print contextLamp.name,
elif (new_chunk.ID==OBJECT_MESH):
- ## @@ PATCH
- print 'Found an OBJECT_MESH chunk'
-
+ # print 'Found an OBJECT_MESH chunk'
+ pass
elif (new_chunk.ID==OBJECT_VERTICES):
'''
Worldspace vertex locations
Deleted: branches/soc-2008-jaguarandi/release/scripts/uv_from_adjacent.py
===================================================================
--- branches/soc-2008-jaguarandi/release/scripts/uv_from_adjacent.py 2008-05-30 20:04:52 UTC (rev 15064)
+++ branches/soc-2008-jaguarandi/release/scripts/uv_from_adjacent.py 2008-05-30 20:33:33 UTC (rev 15065)
@@ -1,129 +0,0 @@
-#!BPY
-"""
-Name: 'UVs from unselected adjacent'
-Blender: 242
-Group: 'UVCalculation'
-Tooltip: 'Assign UVs to selected faces from surrounding unselected faces.'
-"""
-__author__ = "Campbell Barton"
-__url__ = ("blender", "blenderartists.org")
-__version__ = "1.0 2006/02/07"
-
-__bpydoc__ = """\
-This script sets the UV mapping and image of selected faces from adjacent unselected faces.
-
-Use this script in face select mode for texturing between textured faces.
-"""
-
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# Script copyright (C) Campbell J Barton
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-
-from Blender import *
-import bpy
-
-def mostUsedImage(imageList): # Returns the image most used in the list.
- if not imageList:
- return None
- elif len(imageList) < 3:
- return imageList[0]
-
- # 3+ Images, Get the most used image for surrounding faces.
- imageCount = {}
- for image in imageList:
- if image:
- image_key= image.name
- else:
- image_key = None
-
- try:
- imageCount[image_key]['imageCount'] +=1 # an extra user of this image
- except:
- imageCount[image_key] = {'imageCount':1, 'blenderImage':image} # start with 1 user.
-
- # Now a list of tuples, (imageName, {imageCount, image})
- imageCount = imageCount.items()
-
- try: imageCount.sort(key=lambda a: a[1])
- except: imageCount.sort(lambda a,b: cmp(a[1], b[1]))
-
-
- return imageCount[-1][1]['blenderImage']
-
-
-def main():
- sce = bpy.data.scenes.active
- ob = sce.objects.active
-
- if ob == None or ob.type != 'Mesh':
- Draw.PupMenu('ERROR: No mesh object in face select mode.')
- return
- me = ob.getData(mesh=1)
-
- if not me.faceUV:
- Draw.PupMenu('ERROR: No mesh object in face select mode.')
- return
-
- selfaces = [f for f in me.faces if f.sel]
- unselfaces = [f for f in me.faces if not f.sel]
-
-
- # Gather per Vert UV and Image, store in vertUvAverage
- vertUvAverage = [[[],[]] for i in xrange(len(me.verts))]
-
- for f in unselfaces: # Unselected faces only.
- fuv = f.uv
- for i,v in enumerate(f):
- vertUvAverage[v.index][0].append(fuv[i])
- vertUvAverage[v.index][1].append(f.image)
-
- # Average per vectex UV coords
- for vertUvData in vertUvAverage:
- uvList = vertUvData[0]
- if uvList:
- # Convert from a list of vectors into 1 vector.
- vertUvData[0] = reduce(lambda a,b: a+b, uvList, Mathutils.Vector(0,0)) * (1.0/len(uvList))
- else:
- vertUvData[0] = None
-
- # Assign to selected faces
- TEX_FLAG = Mesh.FaceModes['TEX']
- for f in selfaces:
- uvlist = []
- imageList = []
- for i,v in enumerate(f):
- uv, vImages = vertUvAverage[v.index]
- uvlist.append( uv )
- imageList.extend(vImages)
-
- if None not in uvlist:
- # all the faces images used by this faces vert. some faces will be added twice but thats ok.
- # Get the most used image and assign to the face.
- image = mostUsedImage(imageList)
- f.uv = uvlist
-
- if image:
- f.image = image
- f.mode |= TEX_FLAG
- Window.RedrawAll()
-
-if __name__ == '__main__':
- main()
\ No newline at end of file
Modified: branches/soc-2008-jaguarandi/release/scripts/uv_seams_from_islands.py
===================================================================
--- branches/soc-2008-jaguarandi/release/scripts/uv_seams_from_islands.py 2008-05-30 20:04:52 UTC (rev 15064)
+++ branches/soc-2008-jaguarandi/release/scripts/uv_seams_from_islands.py 2008-05-30 20:33:33 UTC (rev 15065)
@@ -1,12 +1,31 @@
#!BPY
"""
Name: 'Seams from Islands'
-Blender: 243
+Blender: 246
Group: 'UV'
Tooltip: 'Add seams onto the mesh at the bounds of UV islands'
"""
-# Add a licence here if you wish to re-distribute, we recommend the GPL
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# Script copyright (C) Campbell Barton
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
from Blender import Scene, Mesh, Window, sys
import BPyMessages
@@ -37,8 +56,11 @@
# add seams
SEAM = Mesh.EdgeFlags.SEAM
for ed in me.edges:
- if len(set(edge_uvs[ed.key])) > 1:
- ed.flag |= SEAM
+ try: # the edge might not be in a face
+ if len(set(edge_uvs[ed.key])) > 1:
+ ed.flag |= SEAM
+ except:
+ pass
def main():
Modified: branches/soc-2008-jaguarandi/release/scripts/uvcalc_lightmap.py
===================================================================
--- branches/soc-2008-jaguarandi/release/scripts/uvcalc_lightmap.py 2008-05-30 20:04:52 UTC (rev 15064)
+++ branches/soc-2008-jaguarandi/release/scripts/uvcalc_lightmap.py 2008-05-30 20:33:33 UTC (rev 15065)
@@ -41,6 +41,12 @@
from math import sqrt
+def AngleBetweenVecs(a1,a2):
+ try:
+ return Mathutils.AngleBetweenVecs(a1,a2)
+ except:
+ return 180.0
+
class prettyface(object):
__slots__ = 'uv', 'width', 'height', 'children', 'xoff', 'yoff', 'has_parent', 'rot'
def __init__(self, data):
@@ -148,9 +154,9 @@
if len(uv) == 2:
# match the order of angle sizes of the 3d verts with the UV angles and rotate.
def get_tri_angles(v1,v2,v3):
- a1= Mathutils.AngleBetweenVecs(v2-v1,v3-v1)
- a2= Mathutils.AngleBetweenVecs(v1-v2,v3-v2)
- a3 = 180 - (a1+a2) #a3= Mathutils.AngleBetweenVecs(v2-v3,v1-v3)
+ a1= AngleBetweenVecs(v2-v1,v3-v1)
+ a2= AngleBetweenVecs(v1-v2,v3-v2)
+ a3 = 180 - (a1+a2) #a3= AngleBetweenVecs(v2-v3,v1-v3)
return [(a1,0),(a2,1),(a3,2)]
@@ -237,8 +243,17 @@
face_groups.append(faces)
if PREF_NEW_UVLAYER:
- me.addUVLayer('lightmap')
- me.activeUVLayer = 'lightmap'
+ uvname_org = uvname = 'lightmap'
+ uvnames = me.getUVLayerNames()
+ i = 1
+ while uvname in uvnames:
+ uvname = '%s.%03d' % (uvname_org, i)
+ i+=1
+
+ me.addUVLayer(uvname)
+ me.activeUVLayer = uvname
+
+ del uvnames, uvname_org, uvname
for face_sel in face_groups:
print "\nStarting unwrap"
@@ -402,11 +417,14 @@
# ...limiting this is needed or you end up with bug unused texture spaces
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list