Revision: 16064
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16064
Author:   campbellbarton
Date:     2008-08-12 14:57:18 +0200 (Tue, 12 Aug 2008)

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

Modified Paths:
--------------
    branches/apricot/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj
    branches/apricot/release/scripts/flt_export.py
    branches/apricot/release/scripts/flt_palettemanager.py
    branches/apricot/release/scripts/import_dxf.py
    branches/apricot/release/scripts/ply_export.py
    branches/apricot/source/blender/blenkernel/intern/anim.c
    branches/apricot/source/blender/blenkernel/intern/bvhutils.c
    branches/apricot/source/blender/blenkernel/intern/particle_system.c
    branches/apricot/source/blender/blenkernel/intern/softbody.c
    branches/apricot/source/blender/blenlib/intern/BLI_kdopbvh.c
    branches/apricot/source/blender/include/BIF_editarmature.h
    branches/apricot/source/blender/python/api2_2x/Texture.c
    branches/apricot/source/blender/python/api2_2x/doc/Render.py
    branches/apricot/source/blender/python/api2_2x/doc/Texture.py
    branches/apricot/source/blender/render/intern/source/rayshade.c
    branches/apricot/source/blender/src/editarmature.c
    branches/apricot/source/blender/src/editobject.c
    branches/apricot/source/blender/src/poselib.c
    branches/apricot/source/blender/src/transform_conversions.c
    branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp
    branches/apricot/source/gameengine/Expressions/Value.cpp
    branches/apricot/tools/btools.py

Modified: 
branches/apricot/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj
===================================================================
--- branches/apricot/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj  
2008-08-12 12:32:54 UTC (rev 16063)
+++ branches/apricot/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj  
2008-08-12 12:57:18 UTC (rev 16064)
@@ -366,6 +366,9 @@
                                
RelativePath="..\..\..\source\blender\blenkernel\intern\brush.c">
                        </File>
                        <File
+                               
RelativePath="..\..\..\source\blender\blenkernel\intern\bvhutils.c">
+                       </File>
+                       <File
                                
RelativePath="..\..\..\source\blender\blenkernel\intern\CCGSubSurf.c">
                        </File>
                        <File
@@ -577,6 +580,9 @@
                                
RelativePath="..\..\..\source\blender\blenkernel\BKE_brush.h">
                        </File>
                        <File
+                               
RelativePath="..\..\..\source\blender\blenkernel\BKE_bvhutils.h">
+                       </File>
+                       <File
                                
RelativePath="..\..\..\source\blender\blenkernel\BKE_cdderivedmesh.h">
                        </File>
                        <File

Modified: branches/apricot/release/scripts/flt_export.py
===================================================================
--- branches/apricot/release/scripts/flt_export.py      2008-08-12 12:32:54 UTC 
(rev 16063)
+++ branches/apricot/release/scripts/flt_export.py      2008-08-12 12:57:18 UTC 
(rev 16064)
@@ -525,8 +525,8 @@
        def __init__(self):
                self.vertex_index_lst = []
                self.mface = None
-               self.texture_index = -1
-               self.material_index = -1
+               self.texture_index = 65535
+               self.material_index = 65535
                self.color_index = 127
                self.renderstyle = 0
                self.twoside = 0
@@ -979,8 +979,14 @@
                        self.header.fw.write_char(0)                            
        # Reserved
                        self.header.fw.write_char(alpha)                        
            # Template
                        self.header.fw.write_short(-1)                          
        # Detail tex pat index
-                       self.header.fw.write_short(face_desc.texture_index)     
        # Tex pattern index
-                       self.header.fw.write_short(face_desc.material_index)    
        # material index
+                       if face_desc.texture_index == -1:
+                               self.header.fw.write_ushort(65535)
+                       else:
+                               
self.header.fw.write_ushort(face_desc.texture_index)    # Tex pattern index
+                       if face_desc.material_index == -1:
+                               self.header.fw.write_ushort(65535)
+                       else:
+                               
self.header.fw.write_ushort(face_desc.material_index)           # material index
                        self.header.fw.write_short(0)                           
        # SMC code
                        self.header.fw.write_short(0)                           
        # Feature                                       code
                        self.header.fw.write_int(0)                             
        # IR material code
@@ -1015,7 +1021,10 @@
                                self.header.fw.write_ushort(8 + (mtex * 8))     
        # Length
                                self.header.fw.write_uint(uvmask)               
                                                # UV mask
                                for i in xrange(mtex):
-                                       
self.header.fw.write_ushort(face_desc.images[i])                        # Tex 
pattern index
+                                       if face_desc.images[i] == -1:
+                                               
self.header.fw.write_ushort(65535)
+                                       else:
+                                               
self.header.fw.write_ushort(face_desc.images[i])                        # Tex 
pattern index
                                        self.header.fw.write_ushort(0)          
                                                # Tex effect
                                        self.header.fw.write_ushort(0)          
                                                # Tex Mapping index
                                        self.header.fw.write_ushort(0)          
                                                # Tex data. User defined
@@ -1092,7 +1101,7 @@
                                
write_prop(self.header.fw,ftype,self.object.properties['FLT']['EXT'][propname],length)
                        #write extension data
                        for i in xrange(datalen):
-                               
self.header.fw.write_char(self.object.properties['FLT']['EXT']['data'][i])
+                               self.header.fw.write_uchar(struct.unpack('>B', 
struct.pack('>B', self.object.properties['FLT']['EXT']['data'][i]))[0])
                        self.write_pop_extension()
 
 
@@ -1180,8 +1189,8 @@
                        desc = self.GRR.request_vertex_desc(i)
                        self.fw.write_short(70)                         # 
Vertex with color normal and uv opcode.
                        self.fw.write_ushort(64)                        # 
Length of record
-                       self.fw.write_ushort(0)                                 
                # Color name index
-                       self.fw.write_short(0x20000000)                         
        # Flags
+                       self.fw.write_ushort(0)                         # Color 
name index
+                       self.fw.write_short(1 << 14)                    # 
Frozen Normal
                        self.fw.write_double(desc.x)
                        self.fw.write_double(desc.y)
                        self.fw.write_double(desc.z)
@@ -1199,7 +1208,7 @@
                        print 'Writing texture palette.'
                # Write record for texture palette
                for i, img in enumerate(self.GRR.texture_lst):
-                       filename = tex_files[img.name].replace("\\", "/")
+                       filename = tex_files[img.name]
                        self.fw.write_short(64)                                 
        # Texture palette opcode.
                        self.fw.write_short(216)                                
        # Length of record
                        self.fw.write_string(filename, 200) # Filename
@@ -1245,7 +1254,7 @@
                        cpalette = defaultp.pal
                count = len(cpalette)
                for i in xrange(count):
-                       color = 
struct.unpack('>BBBB',struct.pack('>I',cpalette[i]))
+                       color = 
struct.unpack('>BBBB',struct.pack('>i',cpalette[i]))
                        self.fw.write_uchar(color[3])               # alpha
                        self.fw.write_uchar(color[2])               # b
                        self.fw.write_uchar(color[1])               # g

Modified: branches/apricot/release/scripts/flt_palettemanager.py
===================================================================
--- branches/apricot/release/scripts/flt_palettemanager.py      2008-08-12 
12:32:54 UTC (rev 16063)
+++ branches/apricot/release/scripts/flt_palettemanager.py      2008-08-12 
12:57:18 UTC (rev 16064)
@@ -1,388 +1,505 @@
-#!BPY
-
-"""
-Name: 'FLT Palette Manager'
-Blender: 240
-Group: 'Misc'
-Tooltip: 'Manage FLT colors'
-"""
-
-__author__ = "Geoffrey Bantle"
-__version__ = "1.0 11/21/2007"
-__email__ = ('scripts', 'Author, ')
-__url__ = ('blender', 'blenderartists.org')
-
-__bpydoc__ ="""\
-
-This script manages colors in OpenFlight databases. OpenFlight is a
-registered trademark of MultiGen-Paradigm, Inc.
-
-Todo:
--Figure out whats causing the PC speaker to beep when initializing...
-
-Feature overview and more availible at:
-http://wiki.blender.org/index.php/Scripts/Manual/FLTools
-"""
-
-# --------------------------------------------------------------------------
-# flt_palettemanager.py version 0.1 2005/04/08
-# --------------------------------------------------------------------------
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# Copyright (C) 2007: Blender Foundation
-#
-# 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.Draw as Draw
-from Blender.BGL import *
-import Blender
-import flt_properties
-import flt_defaultp as defaultp
-from flt_properties import *
-
-
-palette_size = 12
-palette_x = 0
-palette_y = 0
-
-colors = list()
-curint = 1.0
-curswatch = 0
-#make a default palette, not very useful.
-cinc = 1.0 / 1024.0
-cstep = 0.0
-picker = None
-ptt = ""
-for i in xrange(1024):
-       colors.append([cstep,cstep,cstep])
-       cstep = cstep + cinc
-def update_state():
-       state = dict()
-       state["activeScene"] = Blender.Scene.getCurrent()
-       state["activeObject"] = state["activeScene"].getActiveObject()
-       state["activeMesh"] = None
-       if state["activeObject"] and state["activeObject"].type == 'Mesh':
-               state["activeMesh"] = state["activeObject"].getData(mesh=True)
-       
-       state["activeFace"] = None
-       if state["activeMesh"]:
-               if state["activeMesh"].faceUV and 
state["activeMesh"].activeFace != None:
-                       state["activeFace"] = 
state["activeMesh"].faces[state["activeMesh"].activeFace]
-               
-       return state
-       
-def pack_face_index(index, intensity):
-       return ((127*intensity)+(128*index))
-def unpack_face_index(face_index):
-       index = face_index / 128
-       intensity = float(face_index - 128.0 * index) / 127.0
-       return(index,intensity)
-
-def event(evt,val):
-       global palette_size
-       global palette_x
-       global palette_y
-       global colors
-       global curint
-       global curswatch
-       
-       areas = Blender.Window.GetScreenInfo()
-       curarea = Blender.Window.GetAreaID()
-       curRect = None
-       editmode = 0
-
-       for area in areas:
-               if area['id'] == curarea:
-                       curRect = area['vertices']
-                       break
-               
-       if evt == Draw.LEFTMOUSE:
-               mval = Blender.Window.GetMouseCoords()
-               rastx = mval[0] - curRect[0]
-               rasty = mval[1] - curRect[1]
-               
-               swatchx = (rastx -palette_x) / palette_size #+state["palette_x"]
-               swatchy = (rasty -palette_y) / palette_size #+state["palette_y"]
-                if rastx > palette_x and rastx < (palette_x + palette_size * 
32) and rasty > palette_y and rasty < (palette_y+ palette_size* 32):
-                        if swatchx < 32 and swatchy < 32:
-                                curswatch = (swatchx * 32) + swatchy
-                                Draw.Redraw(1)
-               
-                elif swatchy < 34 and swatchx < 32:
-                        curint = 1.0 - 
(float(rastx-palette_x)/(palette_size*32.0))
-                        Draw.Redraw(1)
-       
-       #copy current color and intensity to selected faces.
-       elif evt == Draw.CKEY:
-               
-               if Blender.Window.EditMode():
-                       Blender.Window.EditMode(0)
-                       editmode = 1
-               state = update_state()
-               
-               #retrieve color from palette
-               color = 
struct.unpack('>BBBB',struct.pack('>I',colors[curswatch]))
-               actmesh = state["activeMesh"]
-               if actmesh: 
-                       if(Blender.Window.GetKeyQualifiers() != 
Blender.Window.Qual["CTRL"]):
-                               selfaces = list()
-                               for face in actmesh.faces:
-                                       if face.sel:
-                                               selfaces.append(face)
-                               
-                               if not "FLT_COL" in actmesh.faces.properties:
-                                       
actmesh.faces.addPropertyLayer("FLT_COL",Blender.Mesh.PropertyTypes["INT"])
-                                       for face in actmesh.faces:
-                                               face.setProperty("FLT_COL",127) 
#default
-                               try:
-                                       actmesh.activeColorLayer = "FLT_Fcol"
-                               except:
-                                       actmesh.addColorLayer("FLT_Fcol")
-                                       actmesh.activeColorLayer = "FLT_Fcol"
-                               
-
-                               for face in selfaces:
-                                       #First append packed index + color and 
store in face property
-                                       
face.setProperty("FLT_COL",int(pack_face_index(curswatch,curint))) 

@@ 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