[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15021] branches/cloth/blender: Merging revisions 14946-15020 of https://svn.blender.org/svnroot/ bf-blender/trunk/blender
Daniel Genrich
daniel.genrich at gmx.net
Wed May 28 01:15:10 CEST 2008
Revision: 15021
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15021
Author: genscher
Date: 2008-05-28 01:15:08 +0200 (Wed, 28 May 2008)
Log Message:
-----------
Merging revisions 14946-15020 of https://svn.blender.org/svnroot/bf-blender/trunk/blender
Modified Paths:
--------------
branches/cloth/blender/intern/ghost/intern/GHOST_WindowWin32.cpp
branches/cloth/blender/release/scripts/3ds_import.py
branches/cloth/blender/release/scripts/export_fbx.py
branches/cloth/blender/release/scripts/flt_import.py
branches/cloth/blender/release/scripts/uv_seams_from_islands.py
branches/cloth/blender/release/scripts/uvcalc_lightmap.py
branches/cloth/blender/source/blender/blenkernel/BKE_curve.h
branches/cloth/blender/source/blender/blenkernel/intern/curve.c
branches/cloth/blender/source/blender/blenkernel/intern/displist.c
branches/cloth/blender/source/blender/blenkernel/intern/font.c
branches/cloth/blender/source/blender/blenkernel/intern/modifier.c
branches/cloth/blender/source/blender/blenlib/intern/freetypefont.c
branches/cloth/blender/source/blender/blenlib/intern/psfont.c
branches/cloth/blender/source/blender/include/BDR_editcurve.h
branches/cloth/blender/source/blender/nodes/intern/Makefile
branches/cloth/blender/source/blender/python/api2_2x/Draw.c
branches/cloth/blender/source/blender/python/api2_2x/Object.c
branches/cloth/blender/source/blender/python/api2_2x/Particle.c
branches/cloth/blender/source/blender/python/api2_2x/doc/Object.py
branches/cloth/blender/source/blender/render/intern/source/envmap.c
branches/cloth/blender/source/blender/src/buttons_editing.c
branches/cloth/blender/source/blender/src/buttons_shading.c
branches/cloth/blender/source/blender/src/drawobject.c
branches/cloth/blender/source/blender/src/editarmature.c
branches/cloth/blender/source/blender/src/editcurve.c
branches/cloth/blender/source/blender/src/editnode.c
branches/cloth/blender/source/blender/src/interface.c
branches/cloth/blender/source/blender/src/poseobject.c
branches/cloth/blender/source/blender/src/sequence.c
branches/cloth/blender/source/blender/src/toets.c
branches/cloth/blender/source/blender/src/transform_conversions.c
branches/cloth/blender/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
branches/cloth/blender/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
branches/cloth/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp
branches/cloth/blender/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
branches/cloth/blender/source/gameengine/GamePlayer/common/GPC_RenderTools.h
branches/cloth/blender/source/gameengine/Ketsji/KX_Camera.cpp
branches/cloth/blender/source/gameengine/Ketsji/KX_Camera.h
branches/cloth/blender/source/gameengine/Ketsji/KX_GameObject.cpp
branches/cloth/blender/source/gameengine/Ketsji/KX_GameObject.h
branches/cloth/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
branches/cloth/blender/source/gameengine/PyDoc/KX_GameObject.py
branches/cloth/blender/source/gameengine/Rasterizer/RAS_CameraData.h
branches/cloth/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h
branches/cloth/blender/source/gameengine/Rasterizer/RAS_IRenderTools.h
branches/cloth/blender/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
branches/cloth/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
branches/cloth/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
Removed Paths:
-------------
branches/cloth/blender/release/scripts/uv_from_adjacent.py
Modified: branches/cloth/blender/intern/ghost/intern/GHOST_WindowWin32.cpp
===================================================================
--- branches/cloth/blender/intern/ghost/intern/GHOST_WindowWin32.cpp 2008-05-27 22:46:57 UTC (rev 15020)
+++ branches/cloth/blender/intern/ghost/intern/GHOST_WindowWin32.cpp 2008-05-27 23:15:08 UTC (rev 15021)
@@ -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/cloth/blender/release/scripts/3ds_import.py
===================================================================
--- branches/cloth/blender/release/scripts/3ds_import.py 2008-05-27 22:46:57 UTC (rev 15020)
+++ branches/cloth/blender/release/scripts/3ds_import.py 2008-05-27 23:15:08 UTC (rev 15021)
@@ -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
Modified: branches/cloth/blender/release/scripts/export_fbx.py
===================================================================
--- branches/cloth/blender/release/scripts/export_fbx.py 2008-05-27 22:46:57 UTC (rev 15020)
+++ branches/cloth/blender/release/scripts/export_fbx.py 2008-05-27 23:15:08 UTC (rev 15021)
@@ -1101,12 +1101,12 @@
file.write('\n\t\t\tProperty: "ShadingModel", "KString", "", "%s"' % mat_shader)
file.write('\n\t\t\tProperty: "MultiLayer", "bool", "",0')
file.write('\n\t\t\tProperty: "EmissiveColor", "ColorRGB", "",%.4f,%.4f,%.4f' % mat_cold) # emit and diffuse color are he same in blender
- file.write('\n\t\t\tProperty: "EmissiveFactor", "double", "",%.4f' % mat_dif)
+ file.write('\n\t\t\tProperty: "EmissiveFactor", "double", "",%.4f' % mat_emit)
file.write('\n\t\t\tProperty: "AmbientColor", "ColorRGB", "",%.4f,%.4f,%.4f' % mat_colamb)
file.write('\n\t\t\tProperty: "AmbientFactor", "double", "",%.4f' % mat_amb)
file.write('\n\t\t\tProperty: "DiffuseColor", "ColorRGB", "",%.4f,%.4f,%.4f' % mat_cold)
- file.write('\n\t\t\tProperty: "DiffuseFactor", "double", "",%.4f' % mat_emit)
+ file.write('\n\t\t\tProperty: "DiffuseFactor", "double", "",%.4f' % mat_dif)
file.write('\n\t\t\tProperty: "Bump", "Vector3D", "",0,0,0')
file.write('\n\t\t\tProperty: "TransparentColor", "ColorRGB", "",1,1,1')
file.write('\n\t\t\tProperty: "TransparencyFactor", "double", "",%.4f' % (1.0 - mat_alpha))
Modified: branches/cloth/blender/release/scripts/flt_import.py
===================================================================
--- branches/cloth/blender/release/scripts/flt_import.py 2008-05-27 22:46:57 UTC (rev 15020)
+++ branches/cloth/blender/release/scripts/flt_import.py 2008-05-27 23:15:08 UTC (rev 15021)
@@ -16,7 +16,7 @@
registered trademark of MultiGen-Paradigm, Inc.
Feature overview and more availible at:
-http://wiki.blender.org/index.php/Scripts/Manual/Import/openflight_flt
+http://wiki.blender.org/index.php/Scripts/Manual/Import/openflight_fltss
Note: This file is a grab-bag of old and new code. It needs some cleanup still.
"""
@@ -44,6 +44,7 @@
import BPyImage
import flt_filewalker
import flt_properties
+import sys
reload(flt_properties)
from flt_properties import *
@@ -1036,8 +1037,9 @@
else: # fgon
mesh_face_indicies = [i+vert_index for i in xrange(face_len)]
tri_ngons= ngon(self.mesh, mesh_face_indicies)
- new_faces.extend([ [mesh_face_indicies[t] for t in tri] for tri in tri_ngons])
- new_faces_props.extend( [ (None, image, (uvs[tri[0]], uvs[tri[1]], uvs[tri[2]]), [flt_face.uverts[tri[0]], flt_face.uverts[tri[1]], flt_face.uverts[tri[2]]], flt_face.uvlayers, flt_face.color_index, flt_face.props,FLT_OrigIndex,1, flt_face.subfacelevel) for tri in tri_ngons ])
+ if len(tri_ngons) != 1:
+ new_faces.extend([ [mesh_face_indicies[t] for t in tri] for tri in tri_ngons])
+ new_faces_props.extend( [ (None, image, (uvs[tri[0]], uvs[tri[1]], uvs[tri[2]]), [flt_face.uverts[tri[0]], flt_face.uverts[tri[1]], flt_face.uverts[tri[2]]], flt_face.uvlayers, flt_face.color_index, flt_face.props,FLT_OrigIndex,1, flt_face.subfacelevel) for tri in tri_ngons ])
vert_index+= face_len
FLT_OrigIndex+=1
@@ -2296,7 +2298,6 @@
for v in rmesh.verts:
v.co = v.co * smat
-
def reparent(root,childhash,sce):
for child in childhash[root]:
reparent(child,childhash,sce)
@@ -2452,7 +2453,7 @@
select_file(global_prefs['fltfile'], GRR)
except:
import traceback
- FLTWarn = Draw.PupBlock("Export Error", ["See console for output!"])
+ FLTWarn = Draw.PupBlock("Ixport Error", ["See console for output!"])
traceback.print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)
#choose base path for export
Deleted: branches/cloth/blender/release/scripts/uv_from_adjacent.py
===================================================================
--- branches/cloth/blender/release/scripts/uv_from_adjacent.py 2008-05-27 22:46:57 UTC (rev 15020)
+++ branches/cloth/blender/release/scripts/uv_from_adjacent.py 2008-05-27 23:15:08 UTC (rev 15021)
@@ -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/cloth/blender/release/scripts/uv_seams_from_islands.py
===================================================================
--- branches/cloth/blender/release/scripts/uv_seams_from_islands.py 2008-05-27 22:46:57 UTC (rev 15020)
+++ branches/cloth/blender/release/scripts/uv_seams_from_islands.py 2008-05-27 23:15:08 UTC (rev 15021)
@@ -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'
"""
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list