[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18742] branches/soc-2007-joeedh: merge with trunk at r17805, doing it in pieces
Joseph Eagar
joeedh at gmail.com
Fri Jan 30 01:22:24 CET 2009
Revision: 18742
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18742
Author: joeedh
Date: 2009-01-30 01:22:17 +0100 (Fri, 30 Jan 2009)
Log Message:
-----------
merge with trunk at r17805, doing it in pieces
Modified Paths:
--------------
branches/soc-2007-joeedh/config/win32-vc-config.py
branches/soc-2007-joeedh/projectfiles_vc9/blender/blender.vcproj
branches/soc-2007-joeedh/projectfiles_vc9/blender/render/BRE_render.vcproj
branches/soc-2007-joeedh/release/scripts/bpymodules/BPyImage.py
branches/soc-2007-joeedh/release/scripts/bpymodules/BPyMathutils.py
branches/soc-2007-joeedh/release/scripts/bpymodules/BPySys.py
branches/soc-2007-joeedh/release/scripts/export_fbx.py
branches/soc-2007-joeedh/release/scripts/import_web3d.py
branches/soc-2007-joeedh/source/blender/blenkernel/intern/curve.c
branches/soc-2007-joeedh/source/blender/blenkernel/intern/displist.c
branches/soc-2007-joeedh/source/blender/include/butspace.h
branches/soc-2007-joeedh/source/blender/makesdna/DNA_scriptlink_types.h
branches/soc-2007-joeedh/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
branches/soc-2007-joeedh/source/blender/python/BPY_interface.c
branches/soc-2007-joeedh/source/blender/python/api2_2x/Blender.c
branches/soc-2007-joeedh/source/blender/python/api2_2x/Sys.c
branches/soc-2007-joeedh/source/blender/python/api2_2x/doc/API_related.py
branches/soc-2007-joeedh/source/blender/python/api2_2x/doc/Sys.py
branches/soc-2007-joeedh/source/blender/render/intern/source/convertblender.c
branches/soc-2007-joeedh/source/blender/render/intern/source/dsm_soft.c
branches/soc-2007-joeedh/source/blender/render/intern/source/shadeoutput.c
branches/soc-2007-joeedh/source/blender/src/buttons_editing.c
branches/soc-2007-joeedh/source/blender/src/buttons_scene.c
branches/soc-2007-joeedh/source/blender/src/drawimage.c
branches/soc-2007-joeedh/source/blender/src/header_view3d.c
branches/soc-2007-joeedh/source/blender/src/playanim.c
branches/soc-2007-joeedh/source/blender/src/space.c
branches/soc-2007-joeedh/source/creator/creator.c
branches/soc-2007-joeedh/source/gameengine/Converter/BL_ShapeActionActuator.cpp
branches/soc-2007-joeedh/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
branches/soc-2007-joeedh/source/gameengine/Ketsji/KX_BulletPhysicsController.h
branches/soc-2007-joeedh/source/gameengine/Ketsji/KX_Camera.cpp
branches/soc-2007-joeedh/source/gameengine/Ketsji/KX_GameObject.cpp
branches/soc-2007-joeedh/source/gameengine/Ketsji/KX_GameObject.h
branches/soc-2007-joeedh/source/gameengine/PyDoc/KX_GameObject.py
branches/soc-2007-joeedh/source/gameengine/VideoTexture/Exception.cpp
branches/soc-2007-joeedh/source/gameengine/VideoTexture/Exception.h
branches/soc-2007-joeedh/source/gameengine/VideoTexture/ImageRender.cpp
branches/soc-2007-joeedh/source/gameengine/VideoTexture/ImageRender.h
branches/soc-2007-joeedh/source/gameengine/VideoTexture/Texture.h
branches/soc-2007-joeedh/source/gameengine/VideoTexture/blendVideoTex.cpp
branches/soc-2007-joeedh/tools/Blender.py
Modified: branches/soc-2007-joeedh/config/win32-vc-config.py
===================================================================
--- branches/soc-2007-joeedh/config/win32-vc-config.py 2009-01-29 23:27:24 UTC (rev 18741)
+++ branches/soc-2007-joeedh/config/win32-vc-config.py 2009-01-30 00:22:17 UTC (rev 18742)
@@ -170,7 +170,7 @@
CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/MT']
CXXFLAGS = ['/EHsc']
-BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']
+BF_DEBUG_CCFLAGS = ['/Zi']
CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-DFTGL_LIBRARY_STATIC', '-D_CRT_SECURE_NO_DEPRECATE']
REL_CFLAGS = ['-O2', '-DNDEBUG']
@@ -187,7 +187,7 @@
/SUBSYSTEM:CONSOLE
/MACHINE:IX86
/ENTRY:mainCRTStartup
- /INCREMENTAL:NO
+ /INCREMENTAL:YES
/NODEFAULTLIB:"msvcprt.lib"
/NODEFAULTLIB:"glut32.lib"
/NODEFAULTLIB:"libc.lib"
Modified: branches/soc-2007-joeedh/projectfiles_vc9/blender/blender.vcproj
===================================================================
--- branches/soc-2007-joeedh/projectfiles_vc9/blender/blender.vcproj 2009-01-29 23:27:24 UTC (rev 18741)
+++ branches/soc-2007-joeedh/projectfiles_vc9/blender/blender.vcproj 2009-01-30 00:22:17 UTC (rev 18742)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="9,00"
+ Version="9.00"
Name="blender"
ProjectGUID="{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}"
RootNamespace="blender"
Modified: branches/soc-2007-joeedh/projectfiles_vc9/blender/render/BRE_render.vcproj
===================================================================
--- branches/soc-2007-joeedh/projectfiles_vc9/blender/render/BRE_render.vcproj 2009-01-29 23:27:24 UTC (rev 18741)
+++ branches/soc-2007-joeedh/projectfiles_vc9/blender/render/BRE_render.vcproj 2009-01-30 00:22:17 UTC (rev 18742)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="9,00"
+ Version="9.00"
Name="BRE_render"
ProjectGUID="{106AE171-0083-41D6-A949-20DB0E8DC251}"
TargetFrameworkVersion="131072"
@@ -177,6 +177,18 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\render\intern\source\dsm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\source\dsm_func.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\source\dsm_soft.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\render\intern\source\envmap.c"
>
</File>
@@ -256,6 +268,34 @@
RelativePath="..\..\..\source\blender\render\intern\source\zbuf.c"
>
</File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\source\zbuf_abuf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\source\zbuf_dsm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\source\zbuf_shade.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\source\zbuf_shadow.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\source\zbuf_solid.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\source\zbuf_sss.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\source\zbuf_strand.c"
+ >
+ </File>
</Filter>
<Filter
Name="Header Files"
Modified: branches/soc-2007-joeedh/release/scripts/bpymodules/BPyImage.py
===================================================================
--- branches/soc-2007-joeedh/release/scripts/bpymodules/BPyImage.py 2009-01-29 23:27:24 UTC (rev 18741)
+++ branches/soc-2007-joeedh/release/scripts/bpymodules/BPyImage.py 2009-01-30 00:22:17 UTC (rev 18742)
@@ -79,7 +79,7 @@
return path + sys.sep
-def comprehensiveImageLoad(imagePath, filePath, PLACE_HOLDER= True, RECURSIVE=True, VERBOSE=False):
+def comprehensiveImageLoad(imagePath, filePath, PLACE_HOLDER= True, RECURSIVE=True, VERBOSE=False, CONVERT_CALLBACK=None):
'''
imagePath: The image filename
If a path precedes it, this will be searched as well.
@@ -93,13 +93,30 @@
RECURSIVE: If True, directories will be recursivly searched.
Be carefull with this if you have files in your root directory because it may take a long time.
+
+ CASE_INSENSITIVE: for non win32 systems, find the correct case for the file.
+
+ CONVERT_CALLBACK: a function that takes an existing path and returns a new one.
+ Use this when loading image formats blender may not support, the CONVERT_CALLBACK
+ can take the path for a GIF (for example), convert it to a PNG and return the PNG's path.
+ For formats blender can read, simply return the path that is given.
'''
+ # VERBOSE = True
+
if VERBOSE: print 'img:', imagePath, 'file:', filePath
+
+ if os == None and CASE_INSENSITIVE:
+ CASE_INSENSITIVE = True
+
# When we have the file load it with this. try/except niceness.
def imageLoad(path):
#if path.endswith('\\') or path.endswith('/'):
# raise 'INVALID PATH'
+
+ if CONVERT_CALLBACK:
+ path = CONVERT_CALLBACK(path)
+
try:
img = bpy.data.images.new(filename=path)
if VERBOSE: print '\t\tImage loaded "%s"' % path
Modified: branches/soc-2007-joeedh/release/scripts/bpymodules/BPyMathutils.py
===================================================================
--- branches/soc-2007-joeedh/release/scripts/bpymodules/BPyMathutils.py 2009-01-29 23:27:24 UTC (rev 18741)
+++ branches/soc-2007-joeedh/release/scripts/bpymodules/BPyMathutils.py 2009-01-30 00:22:17 UTC (rev 18742)
@@ -225,15 +225,5 @@
def angleToLength(angle):
# Alredy accounted for
- if angle < 0.000001:
- return 1.0
-
- angle = 2*pi*angle/360
- x,y = cos(angle), sin(angle)
- # print "YX", x,y
- # 0 d is hoz to the right.
- # 90d is vert upward.
- fac=1/x
- x=x*fac
- y=y*fac
- return sqrt((x*x)+(y*y))
+ if angle < 0.000001: return 1.0
+ else: return abs(1.0 / cos(pi*angle/180));
Modified: branches/soc-2007-joeedh/release/scripts/bpymodules/BPySys.py
===================================================================
--- branches/soc-2007-joeedh/release/scripts/bpymodules/BPySys.py 2009-01-29 23:27:24 UTC (rev 18741)
+++ branches/soc-2007-joeedh/release/scripts/bpymodules/BPySys.py 2009-01-30 00:22:17 UTC (rev 18742)
@@ -12,3 +12,63 @@
for ch in invalid: name = name.replace(ch, '_')
return name
+def caseInsensitivePath(path, RET_FOUND=False):
+ '''
+ Get a case insensitive path on a case sensitive system
+
+ RET_FOUND is for internal use only, to avoid too many calls to os.path.exists
+ # Example usage
+ getCaseInsensitivePath('/hOmE/mE/sOmEpAtH.tXt')
+ '''
+ import os # todo, what happens with no os?
+
+ if os==None:
+ if RET_FOUND: ret = path, True
+ else: ret = path
+ return ret
+
+ if path=='' or os.path.exists(path):
+ if RET_FOUND: ret = path, True
+ else: ret = path
+ return ret
+
+ f = os.path.basename(path) # f may be a directory or a file
+ d = os.path.dirname(path)
+
+ suffix = ''
+ if not f: # dir ends with a slash?
+ if len(d) < len(path):
+ suffix = path[:len(path)-len(d)]
+
+ f = os.path.basename(d)
+ d = os.path.dirname(d)
+
+ if not os.path.exists(d):
+ d, found = caseInsensitivePath(d, True)
+
+ if not found:
+ if RET_FOUND: ret = path, False
+ else: ret = path
+ return ret
+
+ # at this point, the directory exists but not the file
+
+ try: # we are expecting 'd' to be a directory, but it could be a file
+ files = os.listdir(d)
+ except:
+ if RET_FOUND: ret = path, False
+ else: ret = path
+
+ f_low = f.lower()
+
+ try: f_nocase = [fl for fl in files if fl.lower() == f_low][0]
+ except: f_nocase = None
+
+ if f_nocase:
+ if RET_FOUND: ret = os.path.join(d, f_nocase) + suffix, True
+ else: ret = os.path.join(d, f_nocase) + suffix
+ return ret
+ else:
+ if RET_FOUND: ret = path, False
+ else: ret = path
+ return ret # cant find the right one, just return the path as is.
\ No newline at end of file
Modified: branches/soc-2007-joeedh/release/scripts/export_fbx.py
===================================================================
--- branches/soc-2007-joeedh/release/scripts/export_fbx.py 2009-01-29 23:27:24 UTC (rev 18741)
+++ branches/soc-2007-joeedh/release/scripts/export_fbx.py 2009-01-30 00:22:17 UTC (rev 18742)
@@ -66,8 +66,6 @@
import BPySys
import BPyMessages
-import sys
-
## This was used to make V, but faster not to do all that
##valid = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_,.()[]{}'
##v = range(255)
@@ -184,9 +182,21 @@
def sane_takename(data): return sane_name(data, sane_name_mapping_take)
def sane_groupname(data): return sane_name(data, sane_name_mapping_group)
+def derived_paths(fname_orig, basepath, FORCE_CWD=False):
+ '''
+ fname_orig - blender path, can be relative
+ basepath - fname_rel will be relative to this
+ FORCE_CWD - dont use the basepath, just add a ./ to the filename.
+ use when we know the file will be in the basepath.
+ '''
+ fname = Blender.sys.expandpath(fname_orig)
+ fname_strip = strip_path(fname)
+ if FORCE_CWD: fname_rel = '.' + Blender.sys.sep + fname_strip
+ else: fname_rel = Blender.sys.relpath(fname, basepath)
+ if fname_rel.startswith('//'): fname_rel = '.' + Blender.sys.sep + fname_rel[2:]
+ return fname, fname_strip, fname_rel
-
def mat4x4str(mat):
return '%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f' % tuple([ f for v in mat for f in v ])
@@ -342,6 +352,8 @@
# end batch support
+ # Use this for working out paths relative to the export location
+ basepath = Blender.sys.dirname(filename)
# ----------------------------------------------
# storage classes
@@ -1141,10 +1153,9 @@
Property: "Width", "int", "",0
Property: "Height", "int", "",0''')
if tex:
- fname = tex.filename
- fname_strip = strip_path(fname)
+ fname, fname_strip, fname_rel = derived_paths(tex.filename, basepath, EXP_IMAGE_COPY)
else:
- fname = fname_strip = ''
+ fname = fname_strip = fname_rel = ''
file.write('\n\t\t\tProperty: "Path", "charptr", "", "%s"' % fname_strip)
@@ -1163,7 +1174,7 @@
file.write('\n\t\tFilename: "%s"' % fname_strip)
if fname_strip: fname_strip = '/' + fname_strip
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list