Revision: 15057
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15057
Author:   campbellbarton
Date:     2008-05-30 11:20:34 +0200 (Fri, 30 May 2008)

Log Message:
-----------
svn  merge  -r14995:HEAD 
https://svn.blender.org/svnroot/bf-blender/trunk/blender/

Modified Paths:
--------------
    branches/apricot/config/win32-vc-config.py
    branches/apricot/release/scripts/uv_seams_from_islands.py
    branches/apricot/release/windows/installer/00.sconsblender.nsi
    branches/apricot/source/blender/blenkernel/intern/modifier.c
    branches/apricot/source/blender/blenkernel/intern/object.c
    branches/apricot/source/blender/blenlib/intern/util.c
    branches/apricot/source/blender/include/transform.h
    branches/apricot/source/blender/python/api2_2x/Object.c
    branches/apricot/source/blender/python/api2_2x/Scene.c
    branches/apricot/source/blender/python/api2_2x/doc/Object.py
    branches/apricot/source/blender/python/api2_2x/sceneRender.c
    branches/apricot/source/blender/render/intern/source/envmap.c
    branches/apricot/source/blender/render/intern/source/pipeline.c
    branches/apricot/source/blender/render/intern/source/rayshade.c
    branches/apricot/source/blender/src/drawobject.c
    branches/apricot/source/blender/src/drawview.c
    branches/apricot/source/blender/src/editarmature.c
    branches/apricot/source/blender/src/editnode.c
    branches/apricot/source/blender/src/interface.c
    branches/apricot/source/blender/src/meshtools.c
    branches/apricot/source/blender/src/transform_conversions.c
    branches/apricot/source/blender/src/transform_manipulator.c
    branches/apricot/source/blender/src/transform_orientations.c
    branches/apricot/source/blender/src/view.c

Removed Paths:
-------------
    branches/apricot/release/scripts/uv_from_adjacent.py

Modified: branches/apricot/config/win32-vc-config.py
===================================================================
--- branches/apricot/config/win32-vc-config.py  2008-05-30 09:05:09 UTC (rev 
15056)
+++ branches/apricot/config/win32-vc-config.py  2008-05-30 09:20:34 UTC (rev 
15057)
@@ -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 

Deleted: branches/apricot/release/scripts/uv_from_adjacent.py
===================================================================
--- branches/apricot/release/scripts/uv_from_adjacent.py        2008-05-30 
09:05:09 UTC (rev 15056)
+++ branches/apricot/release/scripts/uv_from_adjacent.py        2008-05-30 
09:20:34 UTC (rev 15057)
@@ -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/apricot/release/scripts/uv_seams_from_islands.py
===================================================================
--- branches/apricot/release/scripts/uv_seams_from_islands.py   2008-05-30 
09:05:09 UTC (rev 15056)
+++ branches/apricot/release/scripts/uv_seams_from_islands.py   2008-05-30 
09:20:34 UTC (rev 15057)
@@ -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/apricot/release/windows/installer/00.sconsblender.nsi
===================================================================
--- branches/apricot/release/windows/installer/00.sconsblender.nsi      
2008-05-30 09:05:09 UTC (rev 15056)
+++ branches/apricot/release/windows/installer/00.sconsblender.nsi      
2008-05-30 09:20:34 UTC (rev 15057)
@@ -32,7 +32,7 @@
     
 !insertmacro MUI_PAGE_DIRECTORY
 Page custom DataLocation DataLocationOnLeave
-Page custom AppDataChoice AppDataChoiceOnLeave
+;Page custom AppDataChoice AppDataChoiceOnLeave
 Page custom PreMigrateUserSettings MigrateUserSettings
 !insertmacro MUI_PAGE_INSTFILES
 !insertmacro MUI_PAGE_FINISH
@@ -271,7 +271,9 @@
        StrCpy $SETUSERCONTEXT "false"
        ${NSD_GetState} $HWND_APPDATA $R0
        ${If} $R0 == "1"
-         StrCpy $SETUSERCONTEXT "true"
+         ; FIXME: disabled 'all users' until fully multi-user compatible
+         ;StrCpy $SETUSERCONTEXT "true"
+         Call SetWinXPPathCurrentUser
        ${Else}
          ${NSD_GetState} $HWND_INSTDIR $R0
          ${If} $R0 == "1"

Modified: branches/apricot/source/blender/blenkernel/intern/modifier.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/modifier.c        
2008-05-30 09:05:09 UTC (rev 15056)
+++ branches/apricot/source/blender/blenkernel/intern/modifier.c        
2008-05-30 09:20:34 UTC (rev 15057)
@@ -6485,12 +6485,14 @@
        MFace *mf=0;
        MVert *dupvert=0;
        ParticleSettings *part=psmd->psys->part;
-       ParticleData *pa, *pars=psmd->psys->particles;
+       ParticleData *pa=NULL, *pars=psmd->psys->particles;
        ParticleKey state;
+       EdgeHash *vertpahash;
+       EdgeHashIterator *ehi;
        float *vertco=0, imat[4][4];
        float loc0[3], nor[3];
        float timestep, cfra;
-       int *facepa=emd->facepa, *vertpa=0;
+       int *facepa=emd->facepa;
        int totdup=0,totvert=0,totface=0,totpart=0;
        int i, j, v, mindex=0;
 
@@ -6505,34 +6507,36 @@
        else
                cfra=bsystem_time(ob,(float)G.scene->r.cfra,0.0);
 
-       /* table for vertice <-> particle relations (row totpart+1 is for yet 
unexploded verts) */
-       vertpa = MEM_callocN(sizeof(int)*(totpart+1)*totvert, 
"explode_vertpatab");
-       for(i=0; i<(totpart+1)*totvert; i++)
-               vertpa[i] = -1;
+       /* hash table for vertice <-> particle relations */
+       vertpahash= BLI_edgehash_new();
 
        for (i=0; i<totface; i++) {
+               /* do mindex + totvert to ensure the vertex index to be the 
first
+                * with BLI_edgehashIterator_getKey */
                if(facepa[i]==totpart || cfra <= (pars+facepa[i])->time)
-                       mindex = totpart*totvert;
+                       mindex = totvert+totpart;
                else 
-                       mindex = facepa[i]*totvert;
+                       mindex = totvert+facepa[i];
 
                mf=CDDM_get_face(dm,i);
 
-               /*set face vertices to exist in particle group*/
-               vertpa[mindex+mf->v1] = 1;
-               vertpa[mindex+mf->v2] = 1;
-               vertpa[mindex+mf->v3] = 1;
+               /* set face vertices to exist in particle group */
+               BLI_edgehash_insert(vertpahash, mf->v1, mindex, NULL);
+               BLI_edgehash_insert(vertpahash, mf->v2, mindex, NULL);
+               BLI_edgehash_insert(vertpahash, mf->v3, mindex, NULL);
                if(mf->v4)
-                       vertpa[mindex+mf->v4] = 1;
+                       BLI_edgehash_insert(vertpahash, mf->v4, mindex, NULL);
        }
 
-       /*make new vertice indexes & count total vertices after duplication*/
-       for(i=0; i<(totpart+1)*totvert; i++){
-               if(vertpa[i] != -1)
-                       vertpa[i] = totdup++;
+       /* make new vertice indexes & count total vertices after duplication */
+       ehi= BLI_edgehashIterator_new(vertpahash);
+       for(; !BLI_edgehashIterator_isDone(ehi); 
BLI_edgehashIterator_step(ehi)) {
+               BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(totdup));
+               totdup++;
        }
+       BLI_edgehashIterator_free(ehi);
 
-       /*the final duplicated vertices*/
+       /* the final duplicated vertices */
        explode= CDDM_from_template(dm, totdup, 0,totface);
        dupvert= CDDM_get_verts(explode);
 
@@ -6541,45 +6545,49 @@
 
        psmd->psys->lattice = psys_get_lattice(ob, psmd->psys);
 
-       /*duplicate & displace vertices*/

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to