Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-05-26 04:55:35 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-05-26 04:55:35 +0400
commit0ff5ea0df87f3fc871044208407e9c3852eab055 (patch)
treee463d6f4bf8eadab770dee7eb4fa147c2bd8cfb1
parent96e79172a010cba6bc826f570832ef4b355ea0cd (diff)
parent244cda6f1ae3a0311c118953197704f1391eb702 (diff)
Merged changes in the trunk up to revision 28984.
-rw-r--r--SConstruct6
-rw-r--r--config/linuxcross-config.py7
-rw-r--r--config/win32-mingw-config.py4
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm8
-rw-r--r--projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj8
-rw-r--r--release/scripts/io/export_fbx.py32
-rw-r--r--release/scripts/modules/add_object_utils.py74
-rw-r--r--release/scripts/modules/bpy_types.py89
-rw-r--r--release/scripts/op/add_mesh_torus.py30
-rw-r--r--release/scripts/op/uv.py22
-rw-r--r--release/scripts/op/uvcalc_follow_active.py2
-rw-r--r--release/scripts/templates/operator_modal_view3d.py9
-rw-r--r--release/scripts/ui/properties_object.py2
-rw-r--r--release/scripts/ui/space_info.py16
-rw-r--r--release/scripts/ui/space_view3d.py13
-rw-r--r--source/blender/blenkernel/BKE_utildefines.h5
-rw-r--r--source/blender/blenkernel/intern/anim.c1
-rw-r--r--source/blender/blenkernel/intern/blender.c2
-rw-r--r--source/blender/blenkernel/intern/cloth.c7
-rw-r--r--source/blender/blenkernel/intern/collision.c32
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c21
-rw-r--r--source/blender/blenkernel/intern/image.c49
-rw-r--r--source/blender/blenkernel/intern/implicit.c65
-rw-r--r--source/blender/blenlib/BLI_args.h12
-rw-r--r--source/blender/blenlib/intern/BLI_args.c97
-rw-r--r--source/blender/blenlib/intern/bpath.c6
-rw-r--r--source/blender/blenloader/BLO_writefile.h4
-rw-r--r--source/blender/blenloader/intern/readfile.c39
-rw-r--r--source/blender/blenloader/intern/writefile.c24
-rw-r--r--source/blender/editors/armature/poselib.c2
-rw-r--r--source/blender/editors/curve/curve_intern.h6
-rw-r--r--source/blender/editors/curve/curve_ops.c10
-rw-r--r--source/blender/editors/curve/editcurve.c160
-rw-r--r--source/blender/editors/interface/interface_regions.c4
-rw-r--r--source/blender/editors/object/object_add.c91
-rw-r--r--source/blender/editors/object/object_edit.c115
-rw-r--r--source/blender/editors/object/object_intern.h1
-rw-r--r--source/blender/editors/object/object_ops.c1
-rw-r--r--source/blender/editors/render/render_internal.c2
-rw-r--r--source/blender/editors/render/render_opengl.c102
-rw-r--r--source/blender/editors/space_file/filelist.c6
-rw-r--r--source/blender/editors/space_graph/graph_select.c2
-rw-r--r--source/blender/editors/space_text/space_text.c2
-rw-r--r--source/blender/editors/space_view3d/drawobject.c32
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c4
-rw-r--r--source/blender/imbuf/IMB_thumbs.h7
-rw-r--r--source/blender/imbuf/intern/anim.c1
-rw-r--r--source/blender/imbuf/intern/thumbs.c25
-rw-r--r--source/blender/imbuf/intern/thumbs_blend.c129
-rw-r--r--source/blender/imbuf/intern/tiff.c3
-rw-r--r--source/blender/makesrna/intern/rna_internal.h1
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_object.c6
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c20
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c6
-rw-r--r--source/blender/render/intern/source/pipeline.c2
-rw-r--r--source/blender/render/intern/source/texture.c3
-rw-r--r--source/blender/windowmanager/intern/wm_files.c63
-rw-r--r--source/creator/creator.c330
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp6
-rw-r--r--source/gameengine/Converter/BL_ModifierDeformer.cpp16
-rw-r--r--source/gameengine/Converter/BL_ModifierDeformer.h1
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp4
-rw-r--r--source/nan_definitions.mk23
-rw-r--r--source/nan_link.mk2
-rw-r--r--tools/btools.py6
-rw-r--r--tools/crossmingw.py1
67 files changed, 1319 insertions, 570 deletions
diff --git a/SConstruct b/SConstruct
index 30d8788f040..ffcfdc10436 100644
--- a/SConstruct
+++ b/SConstruct
@@ -182,7 +182,7 @@ if os.path.exists(userconfig):
else:
print B.bc.WARNING + userconfig + " not found, no user overrides" + B.bc.ENDC
-opts = btools.read_opts(optfiles, B.arguments)
+opts = btools.read_opts(env, optfiles, B.arguments)
opts.Update(env)
if not env['BF_FANCY']:
@@ -572,7 +572,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
dllsources += ['${BF_PNG_LIBPATH}/libpng.dll',
'${BF_ZLIB_LIBPATH}/zlib.dll']
- dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
+ # Used when linking to libtiff was dynamic
+ # keep it here until compilation on all platform would be ok
+ # dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
if env['OURPLATFORM'] != 'linuxcross':
# pthreads library is already added
diff --git a/config/linuxcross-config.py b/config/linuxcross-config.py
index fe5e954f3bc..2fb1a4a39d6 100644
--- a/config/linuxcross-config.py
+++ b/config/linuxcross-config.py
@@ -75,9 +75,9 @@ BF_PNG_LIB = 'png'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
-BF_TIFF = LIBDIR + '/tiff'
+BF_TIFF = LIBDIR + '/gcc/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
-BF_TIFF_LIB = 'libtiff'
+BF_TIFF_LIB = 'tiff'
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
WITH_BF_ZLIB = True
@@ -174,9 +174,6 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib ${BF_ICONV_LIBPATH}'
WITH_BF_RAYOPTIMIZATION = False
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
-CC = 'i586-mingw32msvc-gcc'
-CXX = 'i586-mingw32msvc-g++'
-
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS']
diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py
index 319c9b264f2..491652ab133 100644
--- a/config/win32-mingw-config.py
+++ b/config/win32-mingw-config.py
@@ -74,9 +74,9 @@ BF_PNG_LIB = 'png'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
-BF_TIFF = LIBDIR + '/tiff'
+BF_TIFF = LIBDIR + '/gcc/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
-BF_TIFF_LIB = 'libtiff'
+BF_TIFF_LIB = 'tiff'
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
WITH_BF_ZLIB = True
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index eb89258e1dd..2cec24714be 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1106,7 +1106,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
{
droppedStr = [droppedArray objectAtIndex:i];
- pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
+ pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1);
if (!temp_buff) {
@@ -1114,7 +1114,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
break;
}
- strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSISOLatin1StringEncoding], pastedTextSize);
+ strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
temp_buff[pastedTextSize] = '\0';
strArray->strings[i] = temp_buff;
@@ -1125,7 +1125,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
case GHOST_kDragnDropTypeString:
droppedStr = (NSString*)data;
- pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
+ pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1);
@@ -1133,7 +1133,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
return GHOST_kFailure;
}
- strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSISOLatin1StringEncoding], pastedTextSize);
+ strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
temp_buff[pastedTextSize] = '\0';
diff --git a/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj b/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj
index fdee6ca9228..97a950fb8ce 100644
--- a/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj
+++ b/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj
@@ -494,10 +494,6 @@
>
</File>
<File
- RelativePath="..\..\..\source\blender\imbuf\intern\dynlibtiff.c"
- >
- </File>
- <File
RelativePath="..\..\..\source\blender\imbuf\intern\filetype.c"
>
</File>
@@ -748,10 +744,6 @@
Filter="h;hpp;hxx;hm;inl"
>
<File
- RelativePath="..\..\..\source\blender\imbuf\intern\dynlibtiff.h"
- >
- </File>
- <File
RelativePath="..\..\..\source\blender\imbuf\intern\IMB_allocimbuf.h"
>
</File>
diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py
index ee92399287f..f0b20837e26 100644
--- a/release/scripts/io/export_fbx.py
+++ b/release/scripts/io/export_fbx.py
@@ -1504,17 +1504,14 @@ def write(filename, batch_objects = None, \
file.write('\n\t\tPolygonVertexIndex: ')
i=-1
for f in me.faces:
- fi = [v for v in f.verts]
- # fi = [v_index for j, v_index in enumerate(f.verts) if v_index != 0 or j != 3]
-# fi = [v.index for v in f]
+ fi = f.verts[:]
- # flip the last index, odd but it looks like
- # this is how fbx tells one face from another
- fi[-1] = -(fi[-1]+1)
+ # last index XORd w. -1 indicates end of face
+ fi[-1] = fi[-1] ^ -1
fi = tuple(fi)
+
if i==-1:
if len(fi) == 3: file.write('%i,%i,%i' % fi )
-# if len(f) == 3: file.write('%i,%i,%i' % fi )
else: file.write('%i,%i,%i,%i' % fi )
i=0
else:
@@ -1522,10 +1519,26 @@ def write(filename, batch_objects = None, \
file.write('\n\t\t')
i=0
if len(fi) == 3: file.write(',%i,%i,%i' % fi )
-# if len(f) == 3: file.write(',%i,%i,%i' % fi )
else: file.write(',%i,%i,%i,%i' % fi )
i+=1
+ # write loose edges as faces.
+ for ed in me.edges:
+ if ed.loose:
+ ed_val = ed.verts[:]
+ ed_val = ed_val[0], ed_val[-1] ^ -1
+
+ if i==-1:
+ file.write('%i,%i' % ed_val)
+ i=0
+ else:
+ if i==13:
+ file.write('\n\t\t')
+ i=0
+ file.write(',%i,%i' % ed_val)
+ i+=1
+
+
file.write('\n\t\tEdges: ')
i=-1
for ed in me.edges:
@@ -2960,8 +2973,7 @@ Takes: {''')
# --------------------------- Footer
if world:
m = world.mist
- has_mist = m.enabled
-# has_mist = world.mode & 1
+ has_mist = m.use_mist
mist_intense = m.intensity
mist_start = m.start
mist_end = m.depth
diff --git a/release/scripts/modules/add_object_utils.py b/release/scripts/modules/add_object_utils.py
new file mode 100644
index 00000000000..e4130d9136a
--- /dev/null
+++ b/release/scripts/modules/add_object_utils.py
@@ -0,0 +1,74 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+import bpy
+import mathutils
+
+def _align_matrix(context):
+ # TODO, local view cursor!
+ location = mathutils.TranslationMatrix(context.scene.cursor_location)
+
+ if context.user_preferences.edit.object_align == 'VIEW' and context.space_data.type == 'VIEW_3D':
+ rotation = context.space_data.region_3d.view_matrix.rotation_part().invert().resize4x4()
+ else:
+ rotation = mathutils.Matrix()
+
+ align_matrix = location * rotation
+
+ return align_matrix
+
+
+def add_object_data(obdata, context):
+
+ scene = context.scene
+
+ # ugh, could be made nicer
+ for ob in scene.objects:
+ ob.selected = False
+
+ obj_new = bpy.data.objects.new(obdata.name, obdata)
+
+ base = scene.objects.link(obj_new)
+ base.selected = True
+
+ if context.space_data and context.space_data.type == 'VIEW_3D':
+ base.layers_from_view(context.space_data)
+
+
+ obj_new.matrix = _align_matrix(context)
+
+ obj_act = scene.objects.active
+
+ if obj_act and obj_act.mode == 'EDIT' and obj_act.type == obj_new.type:
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+ obj_act.selected = True
+ scene.update() # apply location
+ #scene.objects.active = obj_new
+
+ bpy.ops.object.join() # join into the active.
+
+ bpy.ops.object.mode_set(mode='EDIT')
+ else:
+ scene.objects.active = obj_new
+ if context.user_preferences.edit.enter_edit_mode:
+ bpy.ops.object.mode_set(mode='EDIT')
+
+ return base
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index edead35dafe..28a30c232a9 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -38,6 +38,16 @@ class Context(StructRNA):
return new_context
+class Group(bpy_types.ID):
+ __slots__ = ()
+
+ @property
+ def users_dupli_object(self):
+ """The dupli group this group is used in, XXX, TODO, WHY DOESNT THIS WORK???"""
+ import bpy
+ return tuple(obj for obj in bpy.data.objects if self == obj.dupli_object)
+
+
class Object(bpy_types.ID):
__slots__ = ()
@@ -48,18 +58,16 @@ class Object(bpy_types.ID):
return tuple(child for child in bpy.data.objects if child.parent == self)
@property
- def group_users(self):
+ def users_group(self):
"""The groups this object is in"""
import bpy
- name = self.name
- return tuple(group for group in bpy.data.groups if name in group.objects)
+ return tuple(group for group in bpy.data.groups if self in group.objects[:])
@property
- def scene_users(self):
+ def users_scene(self):
"""The scenes this object is in"""
import bpy
- name = self.name
- return tuple(scene for scene in bpy.data.scenes if name in scene.objects)
+ return tuple(scene for scene in bpy.data.scenes if self in scene.objects[:])
class _GenericBone:
@@ -303,7 +311,7 @@ class Mesh(bpy_types.ID):
edge_face_count_dict = self.edge_face_count_dict
return [edge_face_count_dict.get(ed.key, 0) for ed in self.edges]
- def edge_loops(self, faces=None, seams=()):
+ def edge_loops_from_faces(self, faces=None, seams=()):
"""
Edge loops defined by faces
@@ -314,7 +322,7 @@ class Mesh(bpy_types.ID):
return a list of edge key lists
[ [(0,1), (4, 8), (3,8)], ...]
- optionaly, seams are edge keys that will be removed
+ return a list of edge vertex index lists
"""
OTHER_INDEX = 2, 3, 0, 1 # opposite face index
@@ -379,6 +387,71 @@ class Mesh(bpy_types.ID):
return edge_loops
+ def edge_loops_from_edges(self, edges=None):
+ """
+ Edge loops defined by edges
+
+ Takes me.edges or a list of edges and returns the edge loops
+
+ return a list of vertex indices.
+ [ [1, 6, 7, 2], ...]
+
+ closed loops have matching start and end values.
+ """
+ line_polys = []
+
+ # Get edges not used by a face
+ if edges is None:
+ edges = self.edges
+
+ if not hasattr(edges, "pop"):
+ edges = edges[:]
+
+ edge_dict= dict((ed.key, ed) for ed in self.edges if ed.selected)
+
+ while edges:
+ current_edge= edges.pop()
+ vert_end, vert_start = current_edge.verts[:]
+ line_poly = [vert_start, vert_end]
+
+ ok = True
+ while ok:
+ ok = False
+ #for i, ed in enumerate(edges):
+ i = len(edges)
+ while i:
+ i -= 1
+ ed = edges[i]
+ v1, v2 = ed.verts
+ if v1 == vert_end:
+ line_poly.append(v2)
+ vert_end = line_poly[-1]
+ ok = 1
+ del edges[i]
+ #break
+ elif v2 == vert_end:
+ line_poly.append(v1)
+ vert_end = line_poly[-1]
+ ok = 1
+ del edges[i]
+ #break
+ elif v1 == vert_start:
+ line_poly.insert(0, v2)
+ vert_start = line_poly[0]
+ ok = 1
+ del edges[i]
+ #break
+ elif v2 == vert_start:
+ line_poly.insert(0, v1)
+ vert_start = line_poly[0]
+ ok = 1
+ del edges[i]
+ #break
+ line_polys.append(line_poly)
+
+ return line_polys
+
+
class MeshEdge(StructRNA):
__slots__ = ()
diff --git a/release/scripts/op/add_mesh_torus.py b/release/scripts/op/add_mesh_torus.py
index f9ca0f60468..d79cbcf3e64 100644
--- a/release/scripts/op/add_mesh_torus.py
+++ b/release/scripts/op/add_mesh_torus.py
@@ -120,36 +120,10 @@ class AddTorus(bpy.types.Operator):
mesh.add_geometry(int(len(verts_loc) / 3), 0, int(len(faces) / 4))
mesh.verts.foreach_set("co", verts_loc)
mesh.faces.foreach_set("verts_raw", faces)
-
- scene = context.scene
-
- # ugh
- for ob in scene.objects:
- ob.selected = False
-
mesh.update()
- ob_new = bpy.data.objects.new("Torus", mesh)
- scene.objects.link(ob_new)
- ob_new.selected = True
-
- ob_new.location = scene.cursor_location
-
- obj_act = scene.objects.active
-
- if obj_act and obj_act.mode == 'EDIT':
- bpy.ops.object.mode_set(mode='OBJECT')
-
- obj_act.selected = True
- scene.update() # apply location
- #scene.objects.active = ob_new
-
- bpy.ops.object.join() # join into the active.
- bpy.ops.object.mode_set(mode='EDIT')
- else:
- scene.objects.active = ob_new
- if context.user_preferences.edit.enter_edit_mode:
- bpy.ops.object.mode_set(mode='EDIT')
+ import add_object_utils
+ add_object_utils.add_object_data(mesh, context)
return {'FINISHED'}
diff --git a/release/scripts/op/uv.py b/release/scripts/op/uv.py
index f22db9d87a8..ad25553a41c 100644
--- a/release/scripts/op/uv.py
+++ b/release/scripts/op/uv.py
@@ -167,18 +167,34 @@ class ExportUVLayout(bpy.types.Operator):
fw('1 setlinewidth\n')
fw('1 setlinejoin\n')
fw('1 setlinecap\n')
+ fw('/DRAW {')
+ # can remove from here to next comment to disable filling, aparently alpha is not supported
+ fw('gsave\n')
+ fw('0.7 setgray\n')
+ fw('fill\n')
+ fw('grestore\n')
+ fw('0 setgray\n')
+ # remove to here
+ fw('stroke\n')
+ fw('} def\n')
fw('newpath\n')
-
+
+ firstline = True
for i, uvs in self._face_uv_iter(context):
for j, uv in enumerate(uvs):
x, y = uv[0], uv[1]
if j == 0:
+ if not firstline:
+ fw('closepath\n')
+ fw('DRAW\n')
+ fw('newpath\n')
+ firstline = False
fw('%.5f %.5f moveto\n' % (x * image_width, y * image_height))
else:
fw('%.5f %.5f lineto\n' % (x * image_width, y * image_height))
fw('closepath\n')
- fw('stroke\n')
+ fw('DRAW\n')
fw('showpage\n')
fw('%%EOF\n')
@@ -203,7 +219,7 @@ def register():
bpy.types.IMAGE_MT_uvs.append(menu_func)
-def unreguster():
+def unregister():
bpy.types.unregister(ExportUVLayout)
bpy.types.IMAGE_MT_uvs.remove(menu_func)
diff --git a/release/scripts/op/uvcalc_follow_active.py b/release/scripts/op/uvcalc_follow_active.py
index c8a13441048..81229f73461 100644
--- a/release/scripts/op/uvcalc_follow_active.py
+++ b/release/scripts/op/uvcalc_follow_active.py
@@ -180,7 +180,7 @@ def extend(obj, operator, EXTEND_MODE):
#SEAM = me.edges.seam
if EXTEND_MODE == 'LENGTH':
- edge_loops = me.edge_loops(face_sel, [ed.key for ed in me.edges if ed.seam])
+ edge_loops = me.edge_loops_from_faces(face_sel, [ed.key for ed in me.edges if ed.seam])
me_verts = me.verts
for loop in edge_loops:
looplen = [0.0]
diff --git a/release/scripts/templates/operator_modal_view3d.py b/release/scripts/templates/operator_modal_view3d.py
index 2158d9dcc3f..afe179376ed 100644
--- a/release/scripts/templates/operator_modal_view3d.py
+++ b/release/scripts/templates/operator_modal_view3d.py
@@ -10,13 +10,13 @@ class ViewOperator(bpy.types.Operator):
def execute(self, context):
- v3d = context.area.spaces[0]
+ v3d = context.space_data
rv3d = v3d.region_3d
rv3d.view_location = self._initial_location + Vector(self.properties.offset)
def modal(self, context, event):
- v3d = context.area.spaces[0]
+ v3d = context.space_data
rv3d = v3d.region_3d
if event.type == 'MOUSEMOVE':
@@ -33,10 +33,9 @@ class ViewOperator(bpy.types.Operator):
return {'RUNNING_MODAL'}
def invoke(self, context, event):
- active_space = context.area.spaces[0]
- if active_space.type == 'VIEW_3D':
- v3d = active_space
+ if context.space_data.type == 'VIEW_3D':
+ v3d = context.space_data
rv3d = v3d.region_3d
context.manager.add_modal_handler(self)
diff --git a/release/scripts/ui/properties_object.py b/release/scripts/ui/properties_object.py
index 6dbfe269436..f1b3e63f7ab 100644
--- a/release/scripts/ui/properties_object.py
+++ b/release/scripts/ui/properties_object.py
@@ -182,7 +182,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
col.prop(group, "dupli_offset", text="")
prop = col.operator("wm.context_set_value", text="From Cursor")
- prop.path = "object.group_users[%d].dupli_offset" % index
+ prop.path = "object.users_group[%d].dupli_offset" % index
prop.value = value
index += 1
diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py
index 4c504cd69c9..3ffe10ffeac 100644
--- a/release/scripts/ui/space_info.py
+++ b/release/scripts/ui/space_info.py
@@ -199,6 +199,18 @@ class INFO_MT_mesh_add(bpy.types.Menu):
layout.operator("mesh.primitive_grid_add", icon='MESH_GRID', text="Grid")
layout.operator("mesh.primitive_monkey_add", icon='MESH_MONKEY', text="Monkey")
+class INFO_MT_curve_add(bpy.types.Menu):
+ bl_idname = "INFO_MT_curve_add"
+ bl_label = "Curve"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator_context = 'INVOKE_REGION_WIN'
+ layout.operator("curve.primitive_bezier_curve_add", icon='CURVE_BEZCURVE', text="Bezier")
+ layout.operator("curve.primitive_bezier_circle_add", icon='CURVE_BEZCIRCLE', text="Circle")
+ layout.operator("curve.primitive_nurbs_curve_add", icon='CURVE_NCURVE', text="Nurbs Curve")
+ layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle")
+ layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
class INFO_MT_armature_add(bpy.types.Menu):
bl_idname = "INFO_MT_armature_add"
@@ -221,7 +233,8 @@ class INFO_MT_add(bpy.types.Menu):
#layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH')
- layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
+ #layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
+ layout.menu("INFO_MT_curve_add", icon='OUTLINER_OB_CURVE')
layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
layout.operator_menu_enum("object.metaball_add", "type", text="Metaball", icon='OUTLINER_OB_META')
layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
@@ -416,6 +429,7 @@ classes = [
INFO_MT_file_external_data,
INFO_MT_add,
INFO_MT_mesh_add,
+ INFO_MT_curve_add,
INFO_MT_armature_add,
INFO_MT_game,
INFO_MT_render,
diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py
index 538a13536bc..8f44d00581f 100644
--- a/release/scripts/ui/space_view3d.py
+++ b/release/scripts/ui/space_view3d.py
@@ -675,6 +675,7 @@ class VIEW3D_MT_object(bpy.types.Menu):
layout.menu("VIEW3D_MT_object_track")
layout.menu("VIEW3D_MT_object_group")
layout.menu("VIEW3D_MT_object_constraints")
+ layout.menu("VIEW3D_MT_object_game_properties")
layout.separator()
@@ -843,6 +844,17 @@ class VIEW3D_MT_make_links(bpy.types.Menu):
layout.operator_enums("object.make_links_data", "type") # inline
+class VIEW3D_MT_object_game_properties(bpy.types.Menu):
+ bl_label = "Game Properties"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.operator("object.game_property_copy", text="Replace").operation="REPLACE"
+ layout.operator("object.game_property_copy", text="Merge").operation="MERGE"
+ # layout.operator("object.game_property_copy").operation="CLEAR" doesn't really belong as part of copy...
+ layout.operator_menu_enum("object.game_property_copy", "property", text="Copy...")
+
# ********** Vertex paint menu **********
@@ -2208,6 +2220,7 @@ classes = [
VIEW3D_MT_object_track,
VIEW3D_MT_object_group,
VIEW3D_MT_object_constraints,
+ VIEW3D_MT_object_game_properties,
VIEW3D_MT_object_showhide,
VIEW3D_MT_make_single_user,
VIEW3D_MT_make_links,
diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h
index 0b3fce9408c..925b1d7171a 100644
--- a/source/blender/blenkernel/BKE_utildefines.h
+++ b/source/blender/blenkernel/BKE_utildefines.h
@@ -38,6 +38,9 @@
#define TRUE 1
#endif
+/* Macro to convert a value to string in the preprocessor */
+#define QUOTE(x) #x
+
/* these values need to be hardcoded in structs, dna does not recognize defines */
/* also defined in DNA_space_types.h */
#ifndef FILE_MAXDIR
@@ -163,7 +166,7 @@
#define IMAG MAKE_ID('I','M','A','G')
#define DNA1 MAKE_ID('D','N','A','1')
-#define TEST MAKE_ID('T','E','S','T')
+#define TEST MAKE_ID('T','E','S','T') /* used as preview between 'REND' and 'GLOB' */
#define REND MAKE_ID('R','E','N','D')
#define USER MAKE_ID('U','S','E','R')
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 313d79cf3b9..1c86bd57e2e 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -63,6 +63,7 @@
#include "BKE_particle.h"
#include "BKE_scene.h"
#include "BKE_utildefines.h"
+#include "BKE_depsgraph.h"
// XXX bad level call...
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 5d12675952c..046b8de2431 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -534,7 +534,7 @@ void BKE_write_undo(bContext *C, char *name)
sprintf(numstr, "%d.blend", counter);
BLI_make_file_string("/", tstr, btempdir, numstr);
- success= BLO_write_file(CTX_data_main(C), tstr, G.fileflags, NULL);
+ success= BLO_write_file(CTX_data_main(C), tstr, G.fileflags, NULL, NULL);
strcpy(curundo->str, tstr);
}
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 2b11c4bdfa0..ce5bca1da56 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -27,16 +27,13 @@
#include "MEM_guardedalloc.h"
-#include "BKE_cloth.h"
-
#include "BKE_cdderivedmesh.h"
+#include "BKE_cloth.h"
#include "BKE_effect.h"
#include "BKE_global.h"
#include "BKE_modifier.h"
-#include "BKE_utildefines.h"
-
#include "BKE_pointcache.h"
-
+#include "BKE_utildefines.h"
#ifdef _WIN32
void tstart ( void )
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index ffd504f5945..a77ac9b8e24 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -59,7 +59,7 @@ Collision modifier code start
/* step is limited from 0 (frame start position) to 1 (frame end position) */
void collision_move_object ( CollisionModifierData *collmd, float step, float prevstep )
{
- float tv[3] = {0,0,0};
+ float tv[3] = {0, 0, 0};
unsigned int i = 0;
for ( i = 0; i < collmd->numverts; i++ )
@@ -69,6 +69,7 @@ void collision_move_object ( CollisionModifierData *collmd, float step, float pr
VECADDS ( collmd->current_xnew[i].co, collmd->x[i].co, tv, step );
VECSUB ( collmd->current_v[i].co, collmd->current_xnew[i].co, collmd->current_x[i].co );
}
+
bvhtree_update_from_mvert ( collmd->bvhtree, collmd->mfaces, collmd->numfaces, collmd->current_x, collmd->current_xnew, collmd->numverts, 1 );
}
@@ -527,7 +528,7 @@ int cloth_collision_response_static ( ClothModifierData *clmd, CollisionModifier
float magtangent = 0, repulse = 0, d = 0;
double impulse = 0.0;
float vrel_t_pre[3];
- float temp[3];
+ float temp[3], spf;
// calculate tangential velocity
VECCOPY ( temp, collpair->normal );
@@ -565,10 +566,12 @@ int cloth_collision_response_static ( ClothModifierData *clmd, CollisionModifier
// Apply repulse impulse if distance too short
// I_r = -min(dt*kd, m(0,1d/dt - v_n))
+ spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
+
d = clmd->coll_parms->epsilon*8.0/9.0 + epsilon2*8.0/9.0 - collpair->distance;
- if ( ( magrelVel < 0.1*d*clmd->sim_parms->stepsPerFrame ) && ( d > ALMOST_ZERO ) )
+ if ( ( magrelVel < 0.1*d*spf ) && ( d > ALMOST_ZERO ) )
{
- repulse = MIN2 ( d*1.0/clmd->sim_parms->stepsPerFrame, 0.1*d*clmd->sim_parms->stepsPerFrame - magrelVel );
+ repulse = MIN2 ( d*1.0/spf, 0.1*d*spf - magrelVel );
// stay on the safe side and clamp repulse
if ( impulse > ALMOST_ZERO )
@@ -1541,20 +1544,15 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
overlap = BLI_bvhtree_overlap ( cloth_bvh, collmd->bvhtree, &result );
// go to next object if no overlap is there
- if(!result || !overlap)
- {
- if ( overlap )
- MEM_freeN ( overlap );
- continue;
- }
-
- /* check if collisions really happen (costly near check) */
- cloth_bvh_objcollisions_nearcheck ( clmd, collmd, &collisions[i], &collisions_index[i], result, overlap);
-
- // resolve nearby collisions
- ret += cloth_bvh_objcollisions_resolve ( clmd, collmd, collisions[i], collisions_index[i]);
- ret2 += ret;
+ if( result && overlap ) {
+ /* check if collisions really happen (costly near check) */
+ cloth_bvh_objcollisions_nearcheck ( clmd, collmd, &collisions[i], &collisions_index[i], result, overlap);
+ // resolve nearby collisions
+ ret += cloth_bvh_objcollisions_resolve ( clmd, collmd, collisions[i], collisions_index[i]);
+ ret2 += ret;
+ }
+
if ( overlap )
MEM_freeN ( overlap );
}
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 1e5f276ba95..0568050950f 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2250,6 +2250,16 @@ void DAG_on_load_update(void)
}
}
+static void dag_id_flush_update__isDependentTexture(void *userData, Object *ob, ID **idpoin)
+{
+ struct { ID *id; int is_dependent; } *data = userData;
+
+ if(*idpoin && GS((*idpoin)->name)==ID_TE) {
+ if (data->id == (*idpoin))
+ data->is_dependent = 1;
+ }
+}
+
void DAG_id_flush_update(ID *id, short flag)
{
Main *bmain= G.main;
@@ -2304,6 +2314,17 @@ void DAG_id_flush_update(ID *id, short flag)
}
}
+ /* set flags based on textures - can influence depgraph via modifiers */
+ if(idtype == ID_TE) {
+ for(obt=bmain->object.first; obt; obt= obt->id.next) {
+ struct { ID *id; int is_dependent; } data = {id, 0};
+
+ modifiers_foreachIDLink(obt, dag_id_flush_update__isDependentTexture, &data);
+ if (data.is_dependent)
+ obt->recalc |= OB_RECALC_DATA;
+ }
+ }
+
/* set flags based on ShapeKey */
if(idtype == ID_KE) {
for(obt=bmain->object.first; obt; obt= obt->id.next) {
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 5588c8df161..39efd9fe72e 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -982,6 +982,7 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
struct StampData stamp_data;
float w, h, pad;
int x, y;
+ float h_fixed;
if (!rect && !rectf)
return;
@@ -998,16 +999,24 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
BLF_buffer_col(mono, scene->r.fg_stamp[0], scene->r.fg_stamp[1], scene->r.fg_stamp[2], 1.0);
pad= BLF_width(mono, "--");
+ /* use 'h_fixed' rather then 'h', aligns better */
+ // BLF_width_and_height(mono, "^|/_AgPpJjlYy", &w, &h_fixed);
+ {
+ rctf box;
+ BLF_boundbox(mono, "^|/_AgPpJjlYy", &box);
+ h_fixed= box.ymax - box.ymin;
+ }
+
x= 0;
y= height;
if (stamp_data.file[0]) {
/* Top left corner */
- BLF_width_and_height(mono, stamp_data.file, &w, &h);
+ BLF_width_and_height(mono, stamp_data.file, &w, &h); h= h_fixed;
y -= h;
/* also a little of space to the background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, w+3, y+h+2);
/* and draw the text. */
BLF_position(mono, x, y, 0.0);
@@ -1019,11 +1028,11 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
/* Top left corner, below File */
if (stamp_data.note[0]) {
- BLF_width_and_height(mono, stamp_data.note, &w, &h);
+ BLF_width_and_height(mono, stamp_data.note, &w, &h); h= h_fixed;
y -= h;
/* and space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-2, w+3, y+h+2);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
BLF_position(mono, x, y+1, 0.0);
BLF_draw_buffer(mono, stamp_data.note);
@@ -1034,11 +1043,11 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
/* Top left corner, below File (or Note) */
if (stamp_data.date[0]) {
- BLF_width_and_height(mono, stamp_data.date, &w, &h);
+ BLF_width_and_height(mono, stamp_data.date, &w, &h); h= h_fixed;
y -= h;
/* and space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
BLF_position(mono, x, y, 0.0);
BLF_draw_buffer(mono, stamp_data.date);
@@ -1049,11 +1058,11 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
/* Top left corner, below File, Date or Note */
if (stamp_data.rendertime[0]) {
- BLF_width_and_height(mono, stamp_data.rendertime, &w, &h);
+ BLF_width_and_height(mono, stamp_data.rendertime, &w, &h); h= h_fixed;
y -= h;
/* and space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
BLF_position(mono, x, y, 0.0);
BLF_draw_buffer(mono, stamp_data.rendertime);
@@ -1064,10 +1073,10 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
/* Bottom left corner, leaving space for timing */
if (stamp_data.marker[0]) {
- BLF_width_and_height(mono, stamp_data.marker, &w, &h);
+ BLF_width_and_height(mono, stamp_data.marker, &w, &h); h= h_fixed;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, w+2, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1079,10 +1088,10 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
/* Left bottom corner */
if (stamp_data.time[0]) {
- BLF_width_and_height(mono, stamp_data.time, &w, &h);
+ BLF_width_and_height(mono, stamp_data.time, &w, &h); h= h_fixed;
/* extra space for background */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1093,10 +1102,10 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
}
if (stamp_data.frame[0]) {
- BLF_width_and_height(mono, stamp_data.frame, &w, &h);
+ BLF_width_and_height(mono, stamp_data.frame, &w, &h); h= h_fixed;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1107,22 +1116,22 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
}
if (stamp_data.camera[0]) {
- BLF_width_and_height(mono, stamp_data.camera, &w, &h);
+ BLF_width_and_height(mono, stamp_data.camera, &w, &h); h= h_fixed;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
BLF_position(mono, x, y+3, 0.0);
BLF_draw_buffer(mono, stamp_data.camera);
}
if (stamp_data.scene[0]) {
- BLF_width_and_height(mono, stamp_data.scene, &w, &h);
+ BLF_width_and_height(mono, stamp_data.scene, &w, &h); h= h_fixed;
/* Bottom right corner, with an extra space because blenfont is too strict! */
x= width - w - 2;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+3, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1130,14 +1139,14 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
}
if (stamp_data.strip[0]) {
- BLF_width_and_height(mono, stamp_data.scene, &w, &h);
+ BLF_width_and_height(mono, stamp_data.scene, &w, &h); h= h_fixed;
/* Top right corner, with an extra space because blenfont is too strict! */
x= width - w - pad;
y= height - h;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, x+w+pad, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, x+w+pad, y+h+2);
BLF_position(mono, x, y, 0.0);
BLF_draw_buffer(mono, stamp_data.strip);
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index c625fb28840..902965bd2f6 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -37,6 +37,10 @@
#include "BKE_global.h"
#include "BKE_utildefines.h"
+#include "BLI_threads.h"
+
+#define CLOTH_OPENMP_LIMIT 25
+
#ifdef _WIN32
#include <windows.h>
static LARGE_INTEGER _itstart, _itend;
@@ -230,8 +234,11 @@ DO_INLINE float dot_lfvector(float (*fLongVectorA)[3], float (*fLongVectorB)[3],
{
long i = 0;
float temp = 0.0;
+// XXX brecht, disabled this for now (first schedule line was already disabled),
+// due to non-commutative nature of floating point ops this makes the sim give
+// different results each time you run it!
// schedule(guided, 2)
-#pragma omp parallel for reduction(+: temp)
+//#pragma omp parallel for reduction(+: temp) if(verts > CLOTH_OPENMP_LIMIT)
for(i = 0; i < (long)verts; i++)
{
temp += INPR(fLongVectorA[i], fLongVectorB[i]);
@@ -577,11 +584,12 @@ DO_INLINE void mul_bfmatrix_S(fmatrix3x3 *matrix, float scalar)
DO_INLINE void mul_bfmatrix_lfvector( float (*to)[3], fmatrix3x3 *from, lfVector *fLongVector)
{
unsigned int i = 0;
- lfVector *temp = create_lfvector(from[0].vcount);
+ unsigned int vcount = from[0].vcount;
+ lfVector *temp = create_lfvector(vcount);
- zero_lfvector(to, from[0].vcount);
+ zero_lfvector(to, vcount);
-#pragma omp parallel sections private(i)
+#pragma omp parallel sections private(i) if(vcount > CLOTH_OPENMP_LIMIT)
{
#pragma omp section
{
@@ -962,7 +970,7 @@ DO_INLINE void BuildPPinv(fmatrix3x3 *lA, fmatrix3x3 *P, fmatrix3x3 *Pinv)
unsigned int i = 0;
// Take only the diagonal blocks of A
-// #pragma omp parallel for private(i)
+// #pragma omp parallel for private(i) if(lA[0].vcount > CLOTH_OPENMP_LIMIT)
for(i = 0; i<lA[0].vcount; i++)
{
// block diagonalizer
@@ -1460,6 +1468,8 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
i = HAIR_GRID_INDEX(lX[v], gmin, gmax, 0);
j = HAIR_GRID_INDEX(lX[v], gmin, gmax, 1);
k = HAIR_GRID_INDEX(lX[v], gmin, gmax, 2);
+ if (i < 0 || j < 0 || k < 0 || i > 10 || j >= 10 || k >= 10)
+ continue;
grid[i][j][k].velocity[0] += lV[v][0];
grid[i][j][k].velocity[1] += lV[v][1];
@@ -1523,6 +1533,8 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
i = HAIR_GRID_INDEX(lX[v], gmin, gmax, 0);
j = HAIR_GRID_INDEX(lX[v], gmin, gmax, 1);
k = HAIR_GRID_INDEX(lX[v], gmin, gmax, 2);
+ if (i < 0 || j < 0 || k < 0 || i > 10 || j >= 10 || k >= 10)
+ continue;
lF[v][0] += smoothfac * (grid[i][j][k].velocity[0] - lV[v][0]);
lF[v][1] += smoothfac * (grid[i][j][k].velocity[1] - lV[v][1]);
@@ -1537,6 +1549,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
free_collider_cache(&colliders);
}
+
static void cloth_calc_force(ClothModifierData *clmd, float frame, lfVector *lF, lfVector *lX, lfVector *lV, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, ListBase *effectors, float time, fmatrix3x3 *M)
{
/* Collect forces and derivatives: F,dFdX,dFdV */
@@ -1731,9 +1744,10 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
ClothVertex *verts = cloth->verts;
unsigned int numverts = cloth->numverts;
float dt = clmd->sim_parms->timescale / clmd->sim_parms->stepsPerFrame;
+ float spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
Implicit_Data *id = cloth->implicit;
- int result = 0;
-
+ int do_extra_solve;
+
if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) /* do goal stuff */
{
for(i = 0; i < numverts; i++)
@@ -1778,60 +1792,50 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
if(clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED && clmd->clothObject->bvhtree)
{
- float temp = clmd->sim_parms->stepsPerFrame;
- /* not too nice hack, but collisions need this correction -jahka */
- clmd->sim_parms->stepsPerFrame /= clmd->sim_parms->timescale;
-
// collisions
// itstart();
// update verts to current positions
for(i = 0; i < numverts; i++)
- {
+ {
VECCOPY(verts[i].tx, id->Xnew[i]);
-
+
VECSUB(verts[i].tv, verts[i].tx, verts[i].txold);
VECCOPY(verts[i].v, verts[i].tv);
}
-
+
// call collision function
// TODO: check if "step" or "step+dt" is correct - dg
- result = cloth_bvh_objcollision(ob, clmd, step/clmd->sim_parms->timescale, dt/clmd->sim_parms->timescale);
-
- // correct velocity again, just to be sure we had to change it due to adaptive collisions
- for(i = 0; i < numverts; i++)
- {
- VECSUB(verts[i].tv, verts[i].tx, id->X[i]);
- }
+ do_extra_solve = cloth_bvh_objcollision(ob, clmd, step/clmd->sim_parms->timescale, dt/clmd->sim_parms->timescale);
// copy corrected positions back to simulation
for(i = 0; i < numverts; i++)
{
- if(result)
+ // correct velocity again, just to be sure we had to change it due to adaptive collisions
+ VECSUB(verts[i].tv, verts[i].tx, id->X[i]);
+
+ if(do_extra_solve)
{
if((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && (verts [i].flags & CLOTH_VERT_FLAG_PINNED))
continue;
-
+
VECCOPY(id->Xnew[i], verts[i].tx);
VECCOPY(id->Vnew[i], verts[i].tv);
- mul_v3_fl(id->Vnew[i], clmd->sim_parms->stepsPerFrame);
+ mul_v3_fl(id->Vnew[i], spf);
}
}
- /* restore original stepsPerFrame */
- clmd->sim_parms->stepsPerFrame = temp;
-
// X = Xnew;
cp_lfvector(id->X, id->Xnew, numverts);
-
+
// if there were collisions, advance the velocity from v_n+1/2 to v_n+1
- if(result)
+ if(do_extra_solve)
{
// V = Vnew;
cp_lfvector(id->V, id->Vnew, numverts);
-
+
// calculate
cloth_calc_force(clmd, frame, id->F, id->X, id->V, id->dFdV, id->dFdX, effectors, step+dt, id->M);
@@ -1851,7 +1855,6 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
cp_lfvector(id->V, id->Vnew, numverts);
step += dt;
-
}
for(i = 0; i < numverts; i++)
diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h
index 61f83ccf6f9..cc4d65980c9 100644
--- a/source/blender/blenlib/BLI_args.h
+++ b/source/blender/blenlib/BLI_args.h
@@ -41,12 +41,18 @@ typedef int (*BA_ArgCallback)(int argc, char **argv, void *data);
struct bArgs *BLI_argsInit(int argc, char **argv);
void BLI_argsFree(struct bArgs *ba);
-/* pass starts at 1, -1 means valid all the time */
-void BLI_argsAdd(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data);
-void BLI_argsAddCase(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data); /* not case specific */
+/* pass starts at 1, -1 means valid all the time
+ * short_arg or long_arg can be null to specify no short or long versions
+ * */
+void BLI_argsAdd(struct bArgs *ba, int pass, char *short_arg, char *long_arg, char *doc, BA_ArgCallback cb, void *data);
+/* short_case and long_case specify if those arguments are case specific */
+void BLI_argsAddCase(struct bArgs *ba, int pass, char *short_arg, int short_case, char *long_arg, int long_case, char *doc, BA_ArgCallback cb, void *data);
void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *data);
+void BLI_argsPrintArgDoc(struct bArgs *ba, char *arg);
+void BLI_argsPrintOtherDoc(struct bArgs *ba);
+
void BLI_argsPrint(struct bArgs *ba);
char **BLI_argsArgv(struct bArgs *ba);
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c
index 61ddf8314e5..dc964639e68 100644
--- a/source/blender/blenlib/intern/BLI_args.c
+++ b/source/blender/blenlib/intern/BLI_args.c
@@ -33,10 +33,22 @@
#include "MEM_guardedalloc.h"
+#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_args.h"
#include "BLI_ghash.h"
+char NO_DOCS[] = "NO DOCUMENTATION SPECIFIED";
+
+struct bArgDoc;
+typedef struct bArgDoc {
+ struct bArgDoc *next, *prev;
+ char *short_arg;
+ char *long_arg;
+ char *documentation;
+ int done;
+} bArgDoc;
+
typedef struct bAKey {
char *arg;
uintptr_t pass; /* cast easier */
@@ -47,9 +59,11 @@ typedef struct bArgument {
bAKey *key;
BA_ArgCallback func;
void *data;
+ bArgDoc *doc;
} bArgument;
struct bArgs {
+ ListBase docs;
GHash *items;
int argc;
char **argv;
@@ -70,7 +84,7 @@ static unsigned int case_strhash(void *ptr) {
static unsigned int keyhash(void *ptr)
{
bAKey *k = ptr;
- return case_strhash(k->arg) ^ BLI_ghashutil_inthash((void*)k->pass);
+ return case_strhash(k->arg); // ^ BLI_ghashutil_inthash((void*)k->pass);
}
static int keycmp(void *a, void *b)
@@ -103,6 +117,7 @@ bArgs *BLI_argsInit(int argc, char **argv)
bArgs *ba = MEM_callocN(sizeof(bArgs), "bArgs");
ba->passes = MEM_callocN(sizeof(int) * argc, "bArgs passes");
ba->items = BLI_ghash_new(keyhash, keycmp, "bArgs passes gh");
+ ba->docs.first = ba->docs.last = NULL;
ba->argc = argc;
ba->argv = argv;
@@ -118,6 +133,7 @@ void BLI_argsFree(struct bArgs *ba)
{
BLI_ghash_free(ba->items, freeItem, freeItem);
MEM_freeN(ba->passes);
+ BLI_freelistN(&ba->docs);
MEM_freeN(ba);
}
@@ -134,7 +150,25 @@ char **BLI_argsArgv(struct bArgs *ba)
return ba->argv;
}
-static void internalAdd(struct bArgs *ba, char *arg, int pass, int case_str, BA_ArgCallback cb, void *data)
+static bArgDoc *internalDocs(struct bArgs *ba, char *short_arg, char *long_arg, char *doc)
+{
+ bArgDoc *d;
+
+ d = MEM_callocN(sizeof(bArgDoc), "bArgDoc");
+
+ if (doc == NULL)
+ doc = NO_DOCS;
+
+ d->short_arg = short_arg;
+ d->long_arg = long_arg;
+ d->documentation = doc;
+
+ BLI_addtail(&ba->docs, d);
+
+ return d;
+}
+
+static void internalAdd(struct bArgs *ba, char *arg, int pass, int case_str, BA_ArgCallback cb, void *data, bArgDoc *d)
{
bArgument *a;
bAKey *key;
@@ -157,30 +191,73 @@ static void internalAdd(struct bArgs *ba, char *arg, int pass, int case_str, BA_
a->key = key;
a->func = cb;
a->data = data;
+ a->doc = d;
BLI_ghash_insert(ba->items, key, a);
}
-void BLI_argsAdd(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data)
+void BLI_argsAddCase(struct bArgs *ba, int pass, char *short_arg, int short_case, char *long_arg, int long_case, char *doc, BA_ArgCallback cb, void *data)
+{
+ bArgDoc *d = internalDocs(ba, short_arg, long_arg, doc);
+
+ if (short_arg)
+ internalAdd(ba, short_arg, pass, short_case, cb, data, d);
+
+ if (long_arg)
+ internalAdd(ba, long_arg, pass, long_case, cb, data, d);
+
+
+}
+
+void BLI_argsAdd(struct bArgs *ba, int pass, char *short_arg, char *long_arg, char *doc, BA_ArgCallback cb, void *data)
{
- internalAdd(ba, arg, pass, 0, cb, data);
+ BLI_argsAddCase(ba, pass, short_arg, 0, long_arg, 0, doc, cb, data);
}
-void BLI_argsAddCase(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data)
+static void internalDocPrint(bArgDoc *d)
{
- internalAdd(ba, arg, pass, 1, cb, data);
+ if (d->short_arg && d->long_arg)
+ printf("%s or %s", d->short_arg, d->long_arg);
+ else if (d->short_arg)
+ printf("%s", d->short_arg);
+ else if (d->long_arg)
+ printf("%s", d->long_arg);
+
+ printf(" %s\n\n", d->documentation);
}
+void BLI_argsPrintArgDoc(struct bArgs *ba, char *arg)
+{
+ bArgument *a = lookUp(ba, arg, -1, -1);
+
+ if (a)
+ {
+ bArgDoc *d = a->doc;
+
+ internalDocPrint(d);
+
+ d->done = 1;
+ }
+}
+
+void BLI_argsPrintOtherDoc(struct bArgs *ba)
+{
+ bArgDoc *d;
+
+ for( d = ba->docs.first; d; d = d->next)
+ {
+ if (d->done == 0)
+ {
+ internalDocPrint(d);
+ }
+ }
+}
void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *default_data)
{
int i = 0;
for( i = 1; i < ba->argc; i++) { /* skip argv[0] */
- /* stop on -- */
- if (BLI_streq(ba->argv[i], "--"))
- break;
-
if (ba->passes[i] == 0) {
/* -1 signal what side of the comparison it is */
bArgument *a = lookUp(ba, ba->argv[i], pass, -1);
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 8ce9511467c..a2bdcfd0076 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -62,7 +62,7 @@
/* for sequence */
//XXX #include "BSE_sequence.h"
//XXX define below from BSE_sequence.h - otherwise potentially odd behaviour
-#define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_IMAGE)
+#define SEQ_HAS_PATH(_seq) ( (_seq)->type==SEQ_MOVIE || (_seq)->type==SEQ_IMAGE || (_seq)->type==SEQ_SOUND )
@@ -262,7 +262,7 @@ static void seq_getpath(struct BPathIterator *bpi, char *path) {
path[0] = '\0'; /* incase we cant get the path */
if (seq==NULL) return;
if (SEQ_HAS_PATH(seq)) {
- if (seq->type == SEQ_IMAGE || seq->type == SEQ_MOVIE) {
+ if (ELEM3(seq->type, SEQ_IMAGE, SEQ_MOVIE, SEQ_SOUND)) {
BLI_strncpy(path, seq->strip->dir, FILE_MAX);
BLI_add_slash(path); /* incase its missing */
if (seq->strip->stripdata) { /* should always be true! */
@@ -281,7 +281,7 @@ static void seq_setpath(struct BPathIterator *bpi, char *path) {
if (seq==NULL) return;
if (SEQ_HAS_PATH(seq)) {
- if (seq->type == SEQ_IMAGE || seq->type == SEQ_MOVIE) {
+ if (ELEM3(seq->type, SEQ_IMAGE, SEQ_MOVIE, SEQ_SOUND)) {
BLI_split_dirfile(path, seq->strip->dir, seq->strip->stripdata->name);
} else {
/* simple case */
diff --git a/source/blender/blenloader/BLO_writefile.h b/source/blender/blenloader/BLO_writefile.h
index a95e5867c7e..182c582cc0f 100644
--- a/source/blender/blenloader/BLO_writefile.h
+++ b/source/blender/blenloader/BLO_writefile.h
@@ -35,10 +35,12 @@ struct MemFile;
struct Main;
struct ReportList;
-extern int BLO_write_file(struct Main *mainvar, char *dir, int write_flags, struct ReportList *reports);
+extern int BLO_write_file(struct Main *mainvar, char *dir, int write_flags, struct ReportList *reports, int *thumb);
extern int BLO_write_file_mem(struct Main *mainvar, struct MemFile *compare, struct MemFile *current,
int write_flags, struct ReportList *reports);
extern int BLO_write_runtime(struct Main *mainvar, char *file, char *exename, struct ReportList *reports);
+#define BLEN_THUMB_SIZE 128
+
#endif
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index e78a66bf999..3b8fad926ac 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -10853,8 +10853,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
+
/* put 2.50 compatibility code here until next subversion bump */
{
+ Object *ob;
bScreen *sc;
for (sc= main->screen.first; sc; sc= sc->id.next) {
@@ -10876,6 +10878,41 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
do_version_mdef_250(fd, lib, main);
+
+ /* parent type to modifier */
+ for(ob = main->object.first; ob; ob = ob->id.next) {
+ if(ob->parent) {
+ Object *parent= (Object *)newlibadr(fd, lib, ob->parent);
+ if(parent) { /* parent may not be in group */
+ if(parent->type==OB_ARMATURE && ob->partype==PARSKEL) {
+ ArmatureModifierData *amd;
+ bArmature *arm= (bArmature *)newlibadr(fd, lib, parent->data);
+
+ amd = (ArmatureModifierData*) modifier_new(eModifierType_Armature);
+ amd->object = ob->parent;
+ BLI_addtail((ListBase*)&ob->modifiers, amd);
+ amd->deformflag= arm->deformflag;
+ ob->partype = PAROBJECT;
+ }
+ else if(parent->type==OB_LATTICE && ob->partype==PARSKEL) {
+ LatticeModifierData *lmd;
+
+ lmd = (LatticeModifierData*) modifier_new(eModifierType_Lattice);
+ lmd->object = ob->parent;
+ BLI_addtail((ListBase*)&ob->modifiers, lmd);
+ ob->partype = PAROBJECT;
+ }
+ else if(parent->type==OB_CURVE && ob->partype==PARCURVE) {
+ CurveModifierData *cmd;
+
+ cmd = (CurveModifierData*) modifier_new(eModifierType_Curve);
+ cmd->object = ob->parent;
+ BLI_addtail((ListBase*)&ob->modifiers, cmd);
+ ob->partype = PAROBJECT;
+ }
+ }
+ }
+ }
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
@@ -10976,7 +11013,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filename)
switch(bhead->code) {
case DATA:
case DNA1:
- case TEST:
+ case TEST: /* used as preview since 2.5x */
case REND:
bhead = blo_nextbhead(fd, bhead);
break;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 5e95c46c6c9..af9ae820c73 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -62,6 +62,7 @@ Any case: direct data is ALWAYS after the lib block
- write library block
- per LibBlock
- write the ID of LibBlock
+- write TEST (128x128, blend file preview, optional)
- write FileGlobal (some global vars)
- write SDNA
- write USER if filename is ~/.B.blend
@@ -2397,9 +2398,19 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
writestruct(wd, GLOB, "FileGlobal", 1, &fg);
}
+/* preview image, first 2 values are width and height
+ * second are an RGBA image (unsigned char)
+ * note, this uses 'TEST' since new types will segfault on file load for older blender versions.
+ */
+static void write_thumb(WriteData *wd, int *img)
+{
+ if(img)
+ writedata(wd, TEST, (2 + img[0] * img[1]) * sizeof(int), img);
+}
+
/* if MemFile * there's filesave to memory */
static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFile *current,
- int write_user_block, int write_flags)
+ int write_user_block, int write_flags, int *thumb)
{
BHead bhead;
ListBase mainlist;
@@ -2414,6 +2425,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
mywrite(wd, buf, 12);
write_renderinfo(wd, mainvar);
+ write_thumb(wd, thumb);
write_global(wd, write_flags, mainvar);
/* no UI save in undo */
@@ -2465,7 +2477,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
}
/* return: success (1) */
-int BLO_write_file(Main *mainvar, char *dir, int write_flags, ReportList *reports)
+int BLO_write_file(Main *mainvar, char *dir, int write_flags, ReportList *reports, int *thumb)
{
char userfilename[FILE_MAXDIR+FILE_MAXFILE];
char tempname[FILE_MAXDIR+FILE_MAXFILE+1];
@@ -2504,7 +2516,7 @@ int BLO_write_file(Main *mainvar, char *dir, int write_flags, ReportList *report
makeFilesRelative(dir, NULL); /* note, making relative to something OTHER then G.sce */
/* actual file writing */
- err= write_file_handle(mainvar, file, NULL,NULL, write_user_block, write_flags);
+ err= write_file_handle(mainvar, file, NULL,NULL, write_user_block, write_flags, thumb);
close(file);
/* rename/compress */
@@ -2557,7 +2569,7 @@ int BLO_write_file_mem(Main *mainvar, MemFile *compare, MemFile *current, int wr
{
int err;
- err= write_file_handle(mainvar, 0, compare, current, 0, write_flags);
+ err= write_file_handle(mainvar, 0, compare, current, 0, write_flags, NULL);
if(err==0) return 1;
return 0;
@@ -2653,7 +2665,7 @@ int BLO_write_runtime(Main *mainvar, char *file, char *exename, ReportList *repo
outfd= open(gamename, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0777);
if (outfd != -1) {
- write_file_handle(mainvar, outfd, NULL,NULL, 0, G.fileflags);
+ write_file_handle(mainvar, outfd, NULL,NULL, 0, G.fileflags, NULL);
if (write(outfd, " ", 1) != 1) {
BKE_report(reports, RPT_ERROR, "Unable to write to output file.");
@@ -2739,7 +2751,7 @@ int BLO_write_runtime(Main *mainvar, char *file, char *exename, ReportList *repo
datastart= lseek(outfd, 0, SEEK_CUR);
- write_file_handle(mainvar, outfd, NULL,NULL, 0, G.fileflags);
+ write_file_handle(mainvar, outfd, NULL,NULL, 0, G.fileflags, NULL);
if (!handle_write_msb_int(outfd, datastart) || (write(outfd, "BRUNTIME", 8)!=8)) {
BKE_report(reports, RPT_ERROR, "Unable to write to output file.");
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index 71033fbe3ec..613a3bd99db 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -854,7 +854,7 @@ static void poselib_preview_apply (bContext *C, wmOperator *op)
/* get search-string */
index= pld->search_cursor;
- if (IN_RANGE(index, 0, 64)) {
+ if (index >= 0 && index <= 64) {
memcpy(&tempstr[0], &pld->searchstr[0], index);
tempstr[index]= '|';
memcpy(&tempstr[index+1], &pld->searchstr[index], 64-index);
diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h
index a9f9aac70d5..ac0825ae612 100644
--- a/source/blender/editors/curve/curve_intern.h
+++ b/source/blender/editors/curve/curve_intern.h
@@ -85,6 +85,12 @@ void CURVE_OT_tilt_clear(struct wmOperatorType *ot);
void CURVE_OT_smooth(struct wmOperatorType *ot);
void CURVE_OT_smooth_radius(struct wmOperatorType *ot);
+void CURVE_OT_primitive_bezier_curve_add(struct wmOperatorType *ot);
+void CURVE_OT_primitive_bezier_circle_add(struct wmOperatorType *ot);
+void CURVE_OT_primitive_nurbs_curve_add(struct wmOperatorType *ot);
+void CURVE_OT_primitive_nurbs_circle_add(struct wmOperatorType *ot);
+void CURVE_OT_primitive_nurbs_path_add(struct wmOperatorType *ot);
+
void CURVE_OT_de_select_first(struct wmOperatorType *ot);
void CURVE_OT_de_select_last(struct wmOperatorType *ot);
void CURVE_OT_select_all(struct wmOperatorType *ot);
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c
index fa341ee19ef..59e4490a63e 100644
--- a/source/blender/editors/curve/curve_ops.c
+++ b/source/blender/editors/curve/curve_ops.c
@@ -96,6 +96,12 @@ void ED_operatortypes_curve(void)
WM_operatortype_append(CURVE_OT_shade_smooth);
WM_operatortype_append(CURVE_OT_shade_flat);
WM_operatortype_append(CURVE_OT_tilt_clear);
+
+ WM_operatortype_append(CURVE_OT_primitive_bezier_curve_add);
+ WM_operatortype_append(CURVE_OT_primitive_bezier_circle_add);
+ WM_operatortype_append(CURVE_OT_primitive_nurbs_curve_add);
+ WM_operatortype_append(CURVE_OT_primitive_nurbs_circle_add);
+ WM_operatortype_append(CURVE_OT_primitive_nurbs_path_add);
WM_operatortype_append(CURVE_OT_smooth);
WM_operatortype_append(CURVE_OT_smooth_radius);
@@ -179,8 +185,8 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
/* only set in editmode curve, by space_view3d listener */
keymap= WM_keymap_find(keyconf, "Curve", 0, 0);
keymap->poll= ED_operator_editsurfcurve;
-
- WM_keymap_add_item(keymap, "OBJECT_OT_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
+
+ WM_keymap_add_menu(keymap, "INFO_MT_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "CURVE_OT_vertex_add", LEFTMOUSE, KM_CLICK, KM_CTRL, 0);
WM_keymap_add_item(keymap, "CURVE_OT_select_all", AKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 5c64b82ec87..1b1af31095a 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -4886,7 +4886,6 @@ int join_curve_exec(bContext *C, wmOperator *op)
}
/************ add primitive, used by object/ module ****************/
-
Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
{
static int xzproj= 0; /* this function calls itself... */
@@ -5258,6 +5257,165 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
return nu;
}
+static int curve_prim_add(bContext *C, wmOperator *op, int type){
+
+ Object *obedit= CTX_data_edit_object(C);
+ ListBase *editnurb;
+ Nurb *nu;
+ int newob= 0;//, type= RNA_enum_get(op->ptr, "type");
+ int enter_editmode;
+ unsigned int layer;
+ float loc[3], rot[3];
+ float mat[4][4];
+
+ //object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
+ ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+
+ if(obedit==NULL || obedit->type!=OB_CURVE) {
+ Curve *cu;
+ obedit= ED_object_add_type(C, OB_CURVE, loc, rot, TRUE, layer);
+ newob = 1;
+
+ cu= (Curve*)obedit->data;
+ cu->flag |= CU_DEFORM_FILL;
+ if(type & CU_PRIM_PATH)
+ cu->flag |= CU_PATH|CU_3D;
+ }
+ else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA);
+
+ ED_object_new_primitive_matrix(C, loc, rot, mat);
+
+ nu= add_nurbs_primitive(C, mat, type, newob);
+ editnurb= curve_get_editcurve(obedit);
+ BLI_addtail(editnurb, nu);
+
+ /* userdef */
+ if (newob && !enter_editmode) {
+ ED_object_exit_editmode(C, EM_FREEDATA);
+ }
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit);
+
+ return OPERATOR_FINISHED;
+}
+
+static int add_primitive_bezier_exec(bContext *C, wmOperator *op)
+{
+ return curve_prim_add(C, op, CU_BEZIER|CU_PRIM_CURVE);
+}
+
+void CURVE_OT_primitive_bezier_curve_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Bezier";
+ ot->description= "Construct a Bezier Curve";
+ ot->idname= "CURVE_OT_primitive_bezier_curve_add";
+
+ /* api callbacks */
+ ot->invoke= ED_object_add_generic_invoke;
+ ot->exec= add_primitive_bezier_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_bezier_circle_exec(bContext *C, wmOperator *op)
+{
+ return curve_prim_add(C, op, CU_BEZIER|CU_PRIM_CIRCLE);
+}
+
+void CURVE_OT_primitive_bezier_circle_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Circle";
+ ot->description= "Construct a Bezier Circle";
+ ot->idname= "CURVE_OT_primitive_bezier_circle_add";
+
+ /* api callbacks */
+ ot->invoke= ED_object_add_generic_invoke;
+ ot->exec= add_primitive_bezier_circle_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_nurbs_curve_exec(bContext *C, wmOperator *op)
+{
+ return curve_prim_add(C, op, CU_NURBS|CU_PRIM_CURVE);
+}
+
+void CURVE_OT_primitive_nurbs_curve_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Nurbs Curve";
+ ot->description= "Construct a Nurbs Curve";
+ ot->idname= "CURVE_OT_primitive_nurbs_curve_add";
+
+ /* api callbacks */
+ ot->invoke= ED_object_add_generic_invoke;
+ ot->exec= add_primitive_nurbs_curve_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_nurbs_circle_exec(bContext *C, wmOperator *op)
+{
+ return curve_prim_add(C, op, CU_NURBS|CU_PRIM_CIRCLE);
+}
+
+void CURVE_OT_primitive_nurbs_circle_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Nurbs Circle";
+ ot->description= "Construct a Nurbs Circle";
+ ot->idname= "CURVE_OT_primitive_nurbs_circle_add";
+
+ /* api callbacks */
+ ot->invoke= ED_object_add_generic_invoke;
+ ot->exec= add_primitive_nurbs_circle_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_curve_path_exec(bContext *C, wmOperator *op)
+{
+ return curve_prim_add(C, op, CU_NURBS|CU_PRIM_PATH);
+}
+
+void CURVE_OT_primitive_nurbs_path_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Path";
+ ot->description= "Construct a Path";
+ ot->idname= "CURVE_OT_primitive_nurbs_path_add";
+
+ /* api callbacks */
+ ot->invoke= ED_object_add_generic_invoke;
+ ot->exec= add_primitive_curve_path_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ ED_object_add_generic_props(ot, TRUE);
+}
+
+
+
/***************** clear tilt operator ********************/
static int clear_tilt_exec(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 102b7e342b3..30f2ee7b923 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -1770,6 +1770,7 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR
static float hsv[3];
static char hexcol[128];
float rgb_gamma[3];
+ float min, max, step, precision;
const char *propname = RNA_property_identifier(prop);
width= PICKER_TOTAL_W;
@@ -1785,6 +1786,7 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR
linearrgb_to_srgb_v3_v3(rgb_gamma, rgb);
}
+ RNA_property_float_ui_range(ptr, prop, &min, &max, &step, &precision);
RNA_property_float_get_array(ptr, prop, rgb);
rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
@@ -1833,7 +1835,7 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR
uiButSetFunc(bt, do_hsv_rna_cb, bt, hsv);
bt= uiDefButF(block, NUMSLI, 0, "S ", 0, -80, butwidth, UI_UNIT_Y, hsv+1, 0.0, 1.0, 10, 3, "");
uiButSetFunc(bt, do_hsv_rna_cb, bt, hsv);
- bt= uiDefButF(block, NUMSLI, 0, "V ", 0, -100, butwidth, UI_UNIT_Y, hsv+2, 0.0, 1.0, 10, 3, "");
+ bt= uiDefButF(block, NUMSLI, 0, "V ", 0, -100, butwidth, UI_UNIT_Y, hsv+2, 0.0, max, 10, 3, "");
uiButSetFunc(bt, do_hsv_rna_cb, bt, hsv);
uiBlockEndAlign(block);
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 5410ebf6906..9b0a5c9ff33 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -467,97 +467,6 @@ void OBJECT_OT_camera_add(wmOperatorType *ot)
/* ***************** add primitives *************** */
-static EnumPropertyItem prop_curve_types[] = {
- {CU_BEZIER|CU_PRIM_CURVE, "BEZIER_CURVE", ICON_CURVE_BEZCURVE, "Bezier Curve", ""},
- {CU_BEZIER|CU_PRIM_CIRCLE, "BEZIER_CIRCLE", ICON_CURVE_BEZCIRCLE, "Bezier Circle", ""},
- {CU_NURBS|CU_PRIM_CURVE, "NURBS_CURVE", ICON_CURVE_NCURVE, "NURBS Curve", ""},
- {CU_NURBS|CU_PRIM_CIRCLE, "NURBS_CIRCLE", ICON_CURVE_NCIRCLE, "NURBS Circle", ""},
- {CU_NURBS|CU_PRIM_PATH, "PATH", ICON_CURVE_PATH, "Path", ""},
- {0, NULL, 0, NULL, NULL}
-};
-
-static int object_add_curve_exec(bContext *C, wmOperator *op)
-{
- Object *obedit= CTX_data_edit_object(C);
- ListBase *editnurb;
- Nurb *nu;
- int newob= 0, type= RNA_enum_get(op->ptr, "type");
- int enter_editmode;
- unsigned int layer;
- float loc[3], rot[3];
- float mat[4][4];
-
- object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
-
- if(obedit==NULL || obedit->type!=OB_CURVE) {
- Curve *cu;
- obedit= ED_object_add_type(C, OB_CURVE, loc, rot, TRUE, layer);
- newob = 1;
-
- cu= (Curve*)obedit->data;
- cu->flag |= CU_DEFORM_FILL;
- if(type & CU_PRIM_PATH)
- cu->flag |= CU_PATH|CU_3D;
- }
- else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA);
-
- ED_object_new_primitive_matrix(C, loc, rot, mat);
-
- nu= add_nurbs_primitive(C, mat, type, newob);
- editnurb= curve_get_editcurve(obedit);
- BLI_addtail(editnurb, nu);
-
- /* userdef */
- if (newob && !enter_editmode) {
- ED_object_exit_editmode(C, EM_FREEDATA);
- }
-
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit);
-
- return OPERATOR_FINISHED;
-}
-
-static int object_add_curve_invoke(bContext *C, wmOperator *op, wmEvent *event)
-{
- Object *obedit= CTX_data_edit_object(C);
- uiPopupMenu *pup;
- uiLayout *layout;
-
- object_add_generic_invoke_options(C, op);
-
- pup= uiPupMenuBegin(C, op->type->name, 0);
- layout= uiPupMenuLayout(pup);
- if(!obedit || obedit->type == OB_CURVE)
- uiItemsEnumO(layout, op->type->idname, "type");
- else
- uiItemsEnumO(layout, "OBJECT_OT_surface_add", "type");
- uiPupMenuEnd(C, pup);
-
- return OPERATOR_CANCELLED;
-}
-
-void OBJECT_OT_curve_add(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Add Curve";
- ot->description = "Add a curve object to the scene";
- ot->idname= "OBJECT_OT_curve_add";
-
- /* api callbacks */
- ot->invoke= object_add_curve_invoke;
- ot->exec= object_add_curve_exec;
-
- ot->poll= ED_operator_scene_editable;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- RNA_def_enum(ot->srna, "type", prop_curve_types, 0, "Primitive", "");
-
- ED_object_add_generic_props(ot, TRUE);
-}
-
static EnumPropertyItem prop_surface_types[]= {
{CU_PRIM_CURVE|CU_NURBS, "NURBS_CURVE", ICON_SURFACE_NCURVE, "NURBS Curve", ""},
{CU_PRIM_CIRCLE|CU_NURBS, "NURBS_CIRCLE", ICON_SURFACE_NCIRCLE, "NURBS Circle", ""},
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index da3798910e8..28b9fa241ca 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -2173,13 +2173,11 @@ static int game_property_remove(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_active_object(C);
bProperty *prop;
- int index;
+ int index= RNA_int_get(op->ptr, "index");
if(!ob)
return OPERATOR_CANCELLED;
- index = RNA_int_get(op->ptr, "index");
-
prop= BLI_findlink(&ob->prop, index);
if(prop) {
@@ -2207,64 +2205,66 @@ void OBJECT_OT_game_property_remove(wmOperatorType *ot)
RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Property index to remove ", 0, INT_MAX);
}
-static EnumPropertyItem game_properties_copy_types[] ={
- {1, "REPLACE", 0, "Replace Properties", ""},
- {2, "MERGE", 0, "Merge Properties", ""},
- {3, "CLEAR", 0, "Clear All", ""},
- {4, "COPY", 0, "Copy a Property", ""},
- {0, NULL, 0, NULL, NULL}};
-
-static int game_property_copy_invoke(bContext *C, wmOperator *op, wmEvent *event)
-{
- Object *ob= CTX_data_active_object(C);
- bProperty *prop;
- int tot=0;
- uiPopupMenu *pup;
- uiLayout *menu;
- /* count number of available properties */
- prop= ob->prop.first;
- while(prop) {
- tot++;
- prop= prop->next;
- }
+#define COPY_PROPERTIES_REPLACE 1
+#define COPY_PROPERTIES_MERGE 2
+#define COPY_PROPERTIES_CLEAR 3
+#define COPY_PROPERTIES_COPY 4
- /* start building */
- pup= uiPupMenuBegin(C, op->type->name, 0);
- menu= uiPupMenuLayout(pup);
- uiLayoutSetOperatorContext(menu, WM_OP_EXEC_DEFAULT);
+static EnumPropertyItem game_properties_copy_operations[] ={
+ {COPY_PROPERTIES_REPLACE, "REPLACE", 0, "Replace Properties", ""},
+ {COPY_PROPERTIES_MERGE, "MERGE", 0, "Merge Properties", ""},
+ {COPY_PROPERTIES_CLEAR, "CLEAR", 0, "Clear All", ""},
+ {COPY_PROPERTIES_COPY, "COPY", 0, "Copy a Property", ""},
+ {0, NULL, 0, NULL, NULL}};
- if(!tot)
- uiItemEnumO(menu, "OBJECT_OT_game_property_copy", NULL, 0, "type", 3);//CLEAR);
- else {
- uiItemEnumO(menu, "OBJECT_OT_game_property_copy", NULL, 0, "type", 1);//REPLACE);
- uiItemEnumO(menu, "OBJECT_OT_game_property_copy", NULL, 0, "type", 2);//MERGE);
+static EnumPropertyItem gameprops_items[]= {
+ {0, NULL, 0, NULL, NULL}};
- //Menu Separator
- uiItemL(menu, "Copy a Property", 0);
+static EnumPropertyItem *gameprops_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ Object *ob= ED_object_active_context(C);
+ EnumPropertyItem tmp = {0, "", 0, "", ""};
+ EnumPropertyItem *item= NULL;
+ bProperty *prop;
+ int a, totitem= 0;
+
+ if(!ob)
+ return gameprops_items;
- prop= ob->prop.first;
- while(prop) {
- uiItemStringO(menu, prop->name, 0, "OBJECT_OT_game_property_copy", "property", prop->name);
- prop= prop->next;
- }
+ for(a=1, prop= ob->prop.first; prop; prop=prop->next, a++) {
+ tmp.value= a;
+ tmp.identifier= prop->name;
+ tmp.name= prop->name;
+ RNA_enum_item_add(&item, &totitem, &tmp);
}
- uiPupMenuEnd(C, pup);
- /* this operator is only for a menu, not used further */
- return OPERATOR_CANCELLED;
+ RNA_enum_item_end(&item, &totitem);
+ *free= 1;
+
+ return item;
}
static int game_property_copy_exec(bContext *C, wmOperator *op)
{
Object *ob=ED_object_active_context(C);
bProperty *prop;
- char prop_name[32];
+ int type = RNA_enum_get(op->ptr, "operation");
+ int propid= RNA_enum_get(op->ptr, "property");
- int type = RNA_enum_get(op->ptr, "type");
- RNA_string_get(op->ptr, "property", prop_name);
-
- if ( type == 1 || type == 2 || type == 3) {
+ if(propid > 0) { /* copy */
+ prop = BLI_findlink(&ob->prop, propid-1);
+
+ if(prop) {
+ CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
+ if (ob != ob_iter) {
+ if (ob->data != ob_iter->data)
+ set_ob_property(ob_iter, prop);
+ }
+ } CTX_DATA_END;
+ }
+ }
+ else if (ELEM3(type, COPY_PROPERTIES_REPLACE, COPY_PROPERTIES_MERGE, COPY_PROPERTIES_CLEAR)) {
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
if (ob != ob_iter) {
if (ob->data != ob_iter->data){
@@ -2279,37 +2279,28 @@ static int game_property_copy_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
}
- else if(strlen(prop_name) > 0) { /* copy */
- prop = (bProperty *) BLI_findstring(&ob->prop, prop_name, offsetof(bProperty, name));
-
- if(prop) {
- CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
- if (ob != ob_iter) {
- if (ob->data != ob_iter->data)
- set_ob_property(ob_iter, prop);
- }
- } CTX_DATA_END;
- }
- }
+
return OPERATOR_FINISHED;
}
void OBJECT_OT_game_property_copy(wmOperatorType *ot)
{
+ PropertyRNA *prop;
/* identifiers */
ot->name= "Copy Game Property";
ot->idname= "OBJECT_OT_game_property_copy";
/* api callbacks */
- ot->invoke= game_property_copy_invoke;
ot->exec= game_property_copy_exec;
ot->poll= ED_operator_object_active_editable;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_enum(ot->srna, "type", game_properties_copy_types, 4, "Operation", "");
- RNA_def_string(ot->srna, "property", "", 32, "Name", "Name of the property to copy");
+ RNA_def_enum(ot->srna, "operation", game_properties_copy_operations, 4, "Operation", "");
+ prop=RNA_def_enum(ot->srna, "property", gameprops_items, 0, "Property", "Properties to copy");
+ RNA_def_enum_funcs(prop, gameprops_itemf);
+ ot->prop=prop;
}
/************************ Copy Logic Bricks ***********************/
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 2d8faa60bea..5d44baae3f4 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -105,7 +105,6 @@ void OBJECT_OT_select_same_group(struct wmOperatorType *ot);
/* object_add.c */
void OBJECT_OT_add(struct wmOperatorType *ot);
void OBJECT_OT_add_named(struct wmOperatorType *ot);
-void OBJECT_OT_curve_add(struct wmOperatorType *ot);
void OBJECT_OT_surface_add(struct wmOperatorType *ot);
void OBJECT_OT_metaball_add(struct wmOperatorType *ot);
void OBJECT_OT_text_add(struct wmOperatorType *ot);
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index ce1967a1d44..b09de8a1628 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -112,7 +112,6 @@ void ED_operatortypes_object(void)
WM_operatortype_append(GROUP_OT_objects_remove_active);
WM_operatortype_append(OBJECT_OT_delete);
- WM_operatortype_append(OBJECT_OT_curve_add);
WM_operatortype_append(OBJECT_OT_text_add);
WM_operatortype_append(OBJECT_OT_surface_add);
WM_operatortype_append(OBJECT_OT_armature_add);
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index c34b906356e..7a8ffbac811 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -479,7 +479,7 @@ static void make_renderinfo_string(RenderStats *rs, Scene *scene, char *str)
spos+= sprintf(spos, "Fra:%d Ve:%d Fa:%d ", (scene->r.cfra), rs->totvert, rs->totface);
if(rs->tothalo) spos+= sprintf(spos, "Ha:%d ", rs->tothalo);
if(rs->totstrand) spos+= sprintf(spos, "St:%d ", rs->totstrand);
- spos+= sprintf(spos, "La:%d Mem:%.2fM (%.2fM, combined peak %.2fM) ", rs->totlamp, megs_used_memory, mmap_used_memory, megs_peak_memory);
+ spos+= sprintf(spos, "La:%d Mem:%.2fM (%.2fM, peak %.2fM) ", rs->totlamp, megs_used_memory, mmap_used_memory, megs_peak_memory);
if(rs->curfield)
spos+= sprintf(spos, "Field %d ", rs->curfield);
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index aded83c0d16..d9b22553c7a 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -38,6 +38,7 @@
#include "BLI_dlrbTree.h"
#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
#include "BKE_blender.h"
#include "BKE_object.h"
@@ -62,6 +63,7 @@
#include "RE_pipeline.h"
#include "IMB_imbuf_types.h"
+#include "IMB_imbuf.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -94,6 +96,17 @@ typedef struct OGLRender {
wmTimer *timer; /* use to check if running modal or not (invoke'd or exec'd)*/
} OGLRender;
+/* added because v3d is not always valid */
+static unsigned int screen_opengl_layers(OGLRender *oglrender)
+{
+ if(oglrender->v3d) {
+ return oglrender->scene->lay | oglrender->v3d->lay;
+ }
+ else {
+ return oglrender->scene->lay;
+ }
+}
+
static void screen_opengl_render_apply(OGLRender *oglrender)
{
Scene *scene= oglrender->scene;
@@ -106,32 +119,46 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
float winmat[4][4];
int sizex= oglrender->sizex;
int sizey= oglrender->sizey;
+ int view_context = (v3d != NULL);
- /* bind */
- GPU_offscreen_bind(oglrender->ofs);
+ rr= RE_AcquireResultRead(oglrender->re);
+
+ if(view_context) {
+ GPU_offscreen_bind(oglrender->ofs); /* bind */
- /* render 3d view */
- if(rv3d->persp==RV3D_CAMOB && v3d->camera) {
- RE_GetCameraWindow(oglrender->re, v3d->camera, scene->r.cfra, winmat);
- ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat);
+ /* render 3d view */
+ if(rv3d->persp==RV3D_CAMOB && v3d->camera) {
+ RE_GetCameraWindow(oglrender->re, v3d->camera, scene->r.cfra, winmat);
+ ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat);
+ }
+ else {
+ ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, NULL);
+ }
+
+ glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, rr->rectf);
+
+ GPU_offscreen_unbind(oglrender->ofs); /* unbind */
}
- else
- ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, NULL);
+ else {
+ ImBuf *ibuf_view= ED_view3d_draw_offscreen_imbuf_simple(scene, oglrender->sizex, oglrender->sizey, OB_SOLID);
+ IMB_float_from_rect(ibuf_view);
+
+ memcpy(rr->rectf, ibuf_view->rect_float, sizeof(float) * 4 * oglrender->sizex * oglrender->sizey);
+
+ IMB_freeImBuf(ibuf_view);
+ }
+
+ /* rr->rectf is now filled with image data */
- /* read in pixels & stamp */
- rr= RE_AcquireResultRead(oglrender->re);
- glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, rr->rectf);
if((scene->r.stamp & R_STAMP_ALL) && (scene->r.stamp & R_STAMP_DRAW))
BKE_stamp_buf(scene, NULL, rr->rectf, rr->rectx, rr->recty, 4);
+
RE_ReleaseResult(oglrender->re);
/* update byte from float buffer */
ibuf= BKE_image_acquire_ibuf(oglrender->ima, &oglrender->iuser, &lock);
if(ibuf) image_buffer_rect_update(NULL, rr, ibuf, NULL);
BKE_image_release_ibuf(oglrender->ima, lock);
-
- /* unbind */
- GPU_offscreen_unbind(oglrender->ofs);
}
static int screen_opengl_render_init(bContext *C, wmOperator *op)
@@ -142,14 +169,23 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
GPUOffScreen *ofs;
OGLRender *oglrender;
int sizex, sizey;
+ int view_context= RNA_boolean_get(op->ptr, "view_context");
/* ensure we have a 3d view */
- if(!ED_view3d_context_activate(C))
- return 0;
+
+ if(!ED_view3d_context_activate(C)) {
+ RNA_boolean_set(op->ptr, "view_context", 0);
+ view_context = 0;
+ }
/* only one render job at a time */
if(WM_jobs_test(CTX_wm_manager(C), scene))
return 0;
+
+ if(!view_context && scene->camera==NULL) {
+ BKE_report(op->reports, RPT_ERROR, "Scene has no camera.");
+ return 0;
+ }
/* stop all running jobs, currently previews frustrate Render */
WM_jobs_stop_all(CTX_wm_manager(C));
@@ -177,9 +213,11 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
oglrender->sizey= sizey;
oglrender->scene= scene;
- oglrender->v3d= CTX_wm_view3d(C);
- oglrender->ar= CTX_wm_region(C);
- oglrender->rv3d= CTX_wm_region_view3d(C);
+ if(view_context) {
+ oglrender->v3d= CTX_wm_view3d(C);
+ oglrender->ar= CTX_wm_region(C);
+ oglrender->rv3d= CTX_wm_region_view3d(C);
+ }
/* create image and image user */
oglrender->ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
@@ -211,7 +249,7 @@ static void screen_opengl_render_end(bContext *C, OGLRender *oglrender)
if(oglrender->timer) { /* exec will not have a timer */
scene->r.cfra= oglrender->cfrao;
- scene_update_for_newframe(scene, scene->lay|oglrender->v3d->lay);
+ scene_update_for_newframe(scene, screen_opengl_layers(oglrender));
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), oglrender->timer);
}
@@ -263,12 +301,12 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
ImBuf *ibuf;
void *lock;
char name[FILE_MAXDIR+FILE_MAXFILE];
- unsigned int lay;
int ok= 0;
+ int view_context = (oglrender->v3d != NULL);
/* go to next frame */
while(CFRA<oglrender->nfra) {
- lay = scene->lay | oglrender->v3d->lay;
+ unsigned int lay= screen_opengl_layers(oglrender);
if(lay & 0xFF000000)
lay &= 0xFF000000;
@@ -276,14 +314,19 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
scene_update_for_newframe(scene, lay);
CFRA++;
}
-
- scene_update_for_newframe(scene, scene->lay | oglrender->v3d->lay);
- if(oglrender->rv3d->persp==RV3D_CAMOB && oglrender->v3d->camera && oglrender->v3d->scenelock) {
- /* since scene_update_for_newframe() is used rather
- * then ED_update_for_newframe() the camera needs to be set */
- if(scene_camera_switch_update(scene))
- oglrender->v3d->camera= scene->camera;
+ scene_update_for_newframe(scene, screen_opengl_layers(oglrender));
+
+ if(view_context) {
+ if(oglrender->rv3d->persp==RV3D_CAMOB && oglrender->v3d->camera && oglrender->v3d->scenelock) {
+ /* since scene_update_for_newframe() is used rather
+ * then ED_update_for_newframe() the camera needs to be set */
+ if(scene_camera_switch_update(scene))
+ oglrender->v3d->camera= scene->camera;
+ }
+ }
+ else {
+ scene_camera_switch_update(scene);
}
/* render into offscreen buffer */
@@ -445,6 +488,7 @@ void RENDER_OT_opengl(wmOperatorType *ot)
ot->poll= ED_operator_screenactive;
RNA_def_boolean(ot->srna, "animation", 0, "Animation", "");
+ RNA_def_boolean(ot->srna, "view_context", 1, "View Context", "Use the current 3D view for rendering, else use scene settings.");
}
/* function for getting an opengl buffer from a View3D, used by sequencer */
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index ebe42219f01..dd23c6b64b2 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1280,6 +1280,8 @@ static void thumbnails_startjob(void *tjv, short *stop, short *do_update)
while ( (*stop==0) && (limg) ) {
if ( limg->flags & IMAGEFILE ) {
limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_IMAGE);
+ } else if ( limg->flags & BLENDERFILE ) {
+ limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_BLEND);
} else if ( limg->flags & MOVIEFILE ) {
limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_MOVIE);
if (!limg->img) {
@@ -1334,7 +1336,7 @@ void thumbnails_start(struct FileList* filelist, const struct bContext* C)
tj->filelist = filelist;
for (idx = 0; idx < filelist->numfiles;idx++) {
if (!filelist->filelist[idx].image) {
- if ( (filelist->filelist[idx].flags & IMAGEFILE) || (filelist->filelist[idx].flags & MOVIEFILE) ) {
+ if ( (filelist->filelist[idx].flags & (IMAGEFILE|MOVIEFILE|BLENDERFILE)) ) {
FileImage* limg = MEM_callocN(sizeof(struct FileImage), "loadimage");
BLI_strncpy(limg->path, filelist->filelist[idx].path, FILE_MAX);
limg->index= idx;
@@ -1364,4 +1366,4 @@ void thumbnails_stop(struct FileList* filelist, const struct bContext* C)
int thumbnails_running(struct FileList* filelist, const struct bContext* C)
{
return WM_jobs_test(CTX_wm_manager(C), filelist);
-} \ No newline at end of file
+}
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index f347bfea290..17b0a87b0a8 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -780,7 +780,7 @@ static void nearest_fcurve_vert_store (ListBase *matches, View2D *v2d, FCurve *f
* needed to access the relevant vertex coordinates in the 3x3
* 'vec' matrix
*/
- UI_view2d_to_region_no_clip(v2d, bezt->vec[hpoint+1][0], bezt->vec[hpoint+1][1], &screen_co[0], &screen_co[1]);
+ UI_view2d_view_to_region(v2d, bezt->vec[hpoint+1][0], bezt->vec[hpoint+1][1], &screen_co[0], &screen_co[1]);
/* check if distance from mouse cursor to vert in screen space is within tolerance */
// XXX: inlined distance calculation, since we cannot do this on ints using the math lib...
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 513f167efe9..3a23cd32629 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -466,7 +466,7 @@ void ED_spacetype_text(void)
art= MEM_callocN(sizeof(ARegionType), "spacetype text region");
art->regionid = RGN_TYPE_UI;
art->prefsizex= UI_COMPACT_PANEL_WIDTH;
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+ art->keymapflag= ED_KEYMAP_UI;
art->init= text_properties_area_init;
art->draw= text_properties_area_draw;
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 7c0ccfa770c..89a82e51cd8 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -988,21 +988,23 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
/* Outer circle */
circrad = 3.0f*lampsize;
+ setlinestyle(3);
+
drawcircball(GL_LINE_LOOP, vec, circrad, imat);
- }
- else
- circrad = 0.0f;
-
- setlinestyle(3);
- /* draw dashed outer circle if shadow is on. remember some lamps can't have certain shadows! */
- if (la->type!=LA_HEMI) {
- if ((la->mode & LA_SHAD_RAY) ||
- ((la->mode & LA_SHAD_BUF) && (la->type==LA_SPOT)) )
- {
- drawcircball(GL_LINE_LOOP, vec, circrad + 3.0f*pixsize, imat);
+ /* draw dashed outer circle if shadow is on. remember some lamps can't have certain shadows! */
+ if(la->type!=LA_HEMI) {
+ if( (la->mode & LA_SHAD_RAY) ||
+ ((la->mode & LA_SHAD_BUF) && (la->type==LA_SPOT))
+ ) {
+ drawcircball(GL_LINE_LOOP, vec, circrad + 3.0f*pixsize, imat);
+ }
}
}
+ else {
+ setlinestyle(3);
+ circrad = 0.0f;
+ }
/* draw the pretty sun rays */
if(la->type==LA_SUN) {
@@ -2523,7 +2525,8 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
else
UI_ThemeColor(TH_WIRE);
- dm->drawLooseEdges(dm);
+ if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
+ dm->drawLooseEdges(dm);
}
}
else if(dt==OB_SOLID) {
@@ -2590,7 +2593,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
} else {
UI_ThemeColor(TH_WIRE);
}
- if(!ob->sculpt)
+ if(!ob->sculpt && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
dm->drawLooseEdges(dm);
}
}
@@ -2657,7 +2660,8 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
} else {
UI_ThemeColor(TH_WIRE);
}
- dm->drawLooseEdges(dm);
+ if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
+ dm->drawLooseEdges(dm);
}
}
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index e78618f4627..78ae13d255e 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -610,6 +610,10 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
* more context than just the region */
ED_region_tag_redraw(ar);
break;
+ case NC_TEXTURE:
+ /* same as above */
+ ED_region_tag_redraw(ar);
+ break;
case NC_SPACE:
if(wmn->data == ND_SPACE_VIEW3D) {
if (wmn->subtype == NS_VIEW3D_GPU) {
diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h
index c7e39b9e0d7..ecb0ba8abd1 100644
--- a/source/blender/imbuf/IMB_thumbs.h
+++ b/source/blender/imbuf/IMB_thumbs.h
@@ -50,13 +50,14 @@ typedef enum ThumbSize {
typedef enum ThumbSource {
THB_SOURCE_IMAGE,
- THB_SOURCE_MOVIE
+ THB_SOURCE_MOVIE,
+ THB_SOURCE_BLEND
} ThumbSource;
// IB_metadata
/* create thumbnail for file and returns new imbuf for thumbnail */
-ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source);
+ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, ImBuf *ibuf);
/* read thumbnail for file and returns new imbuf for thumbnail */
ImBuf* IMB_thumb_read(const char* path, ThumbSize size);
@@ -70,6 +71,8 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source);
/* create the necessary dirs to store the thumbnails */
void IMB_thumb_makedirs();
+/* special function for loading a thumbnail embedded into a blend file */
+ImBuf *IMB_loadblend_thumb(const char *path);
#endif /* _IMB_THUMBS_H */
diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c
index bc0f9225fbc..2cb63b7274c 100644
--- a/source/blender/imbuf/intern/anim.c
+++ b/source/blender/imbuf/intern/anim.c
@@ -62,6 +62,7 @@
BLI_countlist BLI_stringdec */
#include "DNA_userdef_types.h"
#include "BKE_global.h"
+#include "BKE_depsgraph.h"
#include "imbuf.h"
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 45fbf49dbbd..8c75f5ab1ab 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -241,9 +241,8 @@ void IMB_thumb_makedirs()
}
/* create thumbnail for file and returns new imbuf for thumbnail */
-ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source)
+ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, ImBuf *img)
{
- ImBuf *img = 0;
char uri[URI_MAX];
char desc[URI_MAX+22];
char tpath[FILE_MAX];
@@ -285,8 +284,18 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source)
img = IMB_allocImBuf(0,0,32, IB_rect | IB_metadata, 0);
if (!img) return 0;
} else {
- if (THB_SOURCE_IMAGE == source) {
- img = IMB_loadiffname(path, IB_rect | IB_metadata);
+ if (THB_SOURCE_IMAGE == source || THB_SOURCE_BLEND == source) {
+
+ /* only load if we didnt give an image */
+ if(img==NULL) {
+ if(THB_SOURCE_BLEND == source) {
+ img = IMB_loadblend_thumb(path);
+ }
+ else {
+ img = IMB_loadiffname(path, IB_rect | IB_metadata);
+ }
+ }
+
if (img != NULL) {
stat(path, &info);
sprintf(mtime, "%ld", info.st_mtime);
@@ -425,10 +434,10 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source)
IMB_thumb_delete(path, THB_NORMAL);
IMB_thumb_delete(path, THB_LARGE);
IMB_thumb_delete(path, THB_FAIL);
- img = IMB_thumb_create(path, size, source);
+ img = IMB_thumb_create(path, size, source, NULL);
if(!img){
/* thumb creation failed, write fail thumb */
- img = IMB_thumb_create(path, THB_FAIL, source);
+ img = IMB_thumb_create(path, THB_FAIL, source, NULL);
if (img) {
/* we don't need failed thumb anymore */
IMB_freeImBuf(img);
@@ -438,10 +447,10 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source)
}
}
} else {
- img = IMB_thumb_create(path, size, source);
+ img = IMB_thumb_create(path, size, source, NULL);
if(!img){
/* thumb creation failed, write fail thumb */
- img = IMB_thumb_create(path, THB_FAIL, source);
+ img = IMB_thumb_create(path, THB_FAIL, source, NULL);
if (img) {
/* we don't need failed thumb anymore */
IMB_freeImBuf(img);
diff --git a/source/blender/imbuf/intern/thumbs_blend.c b/source/blender/imbuf/intern/thumbs_blend.c
new file mode 100644
index 00000000000..6e7bd4e6ca7
--- /dev/null
+++ b/source/blender/imbuf/intern/thumbs_blend.c
@@ -0,0 +1,129 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+
+#include "zlib.h"
+
+#include "BKE_utildefines.h"
+#include "BKE_global.h"
+
+#include "IMB_imbuf_types.h"
+#include "IMB_imbuf.h"
+#include "IMB_thumbs.h"
+
+#include "MEM_guardedalloc.h"
+
+/* extracts the thumbnail from between the 'REND' and the 'GLOB'
+ * chunks of the header, dont use typical blend loader because its too slow */
+ImBuf *IMB_loadblend_thumb(const char *path)
+{
+ char buf[8];
+ int code= 0;
+ char endian, pointer_size;
+ char endian_switch;
+ int len, im_len, x, y;
+ int *rect= NULL;
+
+ gzFile gzfile;
+
+ ImBuf *img;
+
+ /* not necessarily a gzip */
+ gzfile = gzopen(path, "rb");
+
+ if (NULL == gzfile ) {
+ return NULL;
+ }
+
+ /* read the blend file header */
+ if(gzread(gzfile, buf, 8) != 8) goto thumb_error;
+ if(strncmp(buf, "BLENDER", 7)) goto thumb_error;
+
+ if(buf[7]=='-') pointer_size= 8;
+ else if(buf[7]=='_') pointer_size= 4;
+ else goto thumb_error;
+
+ /* read the next 4 bytes, only need the first char, ignore the version */
+ /* endian and vertsion (ignored) */
+ if(gzread(gzfile, buf, 4) != 4) goto thumb_error;
+
+ if(buf[0]=='V') endian= B_ENDIAN; /* big: PPC */
+ else if(buf[0]=='v') endian= L_ENDIAN; /* little: x86 */
+ else goto thumb_error;
+
+ while(gzread(gzfile, &code, sizeof(int)) == sizeof(int)) {
+ endian_switch = ((ENDIAN_ORDER != endian)) ? 1 : 0;
+
+ if(gzread(gzfile, buf, sizeof(int)) != sizeof(int)) goto thumb_error;
+ len = *( (int *)((void *)buf) );
+ if(endian_switch) SWITCH_INT(len);
+
+ /* finally read the rest of the bhead struct, pointer and 2 ints */
+ if(gzread(gzfile, buf, pointer_size) != pointer_size) goto thumb_error;
+ if(gzread(gzfile, buf, sizeof(int) * 2) != sizeof(int) * 2) goto thumb_error;
+ /* we dont actually care whats in the bhead */
+
+ if (code==REND) {
+ gzseek(gzfile, len, SEEK_CUR); /* skip to the next */
+ }
+ else {
+ break;
+ }
+ }
+
+ /* using 'TEST' since new names segfault when loading in old blenders */
+ if(code != TEST) goto thumb_error;
+
+ if(gzread(gzfile, &x, sizeof(int)) != sizeof(int)) goto thumb_error;
+ if(gzread(gzfile, &y, sizeof(int)) != sizeof(int)) goto thumb_error;
+ len -= sizeof(int) * 2;
+
+ if(endian_switch) { SWITCH_INT(x); SWITCH_INT(y); }
+
+ /* inconsistant image size, quit early */
+ im_len = x * y * sizeof(int);
+ if(im_len != len) goto thumb_error;
+
+ /* finally malloc and read the data */
+ rect= MEM_mallocN(len, "imb_loadblend_thumb");
+
+ if(gzread(gzfile, rect, len) != len) goto thumb_error;
+
+ /* read ok! */
+ gzclose(gzfile);
+
+ img = IMB_allocImBuf(x, y, 32, IB_rect | IB_metadata, 0);
+
+ memcpy(img->rect, rect, im_len);
+
+ MEM_freeN(rect);
+
+ return img;
+
+thumb_error:
+ gzclose(gzfile);
+ if(rect) MEM_freeN(rect);
+ return NULL;
+}
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 1e4b2ea7110..488340aec88 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -594,7 +594,6 @@ ImBuf *imb_loadtiff(unsigned char *mem, int size, int flags)
hbuf= IMB_allocImBuf(width, height, 32, 0, 0);
hbuf->miplevel= level;
- hbuf->flags |= IB_tilecache;
hbuf->ftype= ibuf->ftype;
ibuf->mipmap[level-1] = hbuf;
@@ -604,6 +603,8 @@ ImBuf *imb_loadtiff(unsigned char *mem, int size, int flags)
else
hbuf= ibuf;
+ hbuf->flags |= IB_tilecache;
+
TIFFGetField(image, TIFFTAG_TILEWIDTH, &hbuf->tilex);
TIFFGetField(image, TIFFTAG_TILELENGTH, &hbuf->tiley);
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 005efdb9bc4..0dcfc773d19 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -227,6 +227,7 @@ void RNA_api_main(struct StructRNA *srna);
void RNA_api_material(StructRNA *srna);
void RNA_api_mesh(struct StructRNA *srna);
void RNA_api_object(struct StructRNA *srna);
+void RNA_api_object_base(struct StructRNA *srna);
void RNA_api_pose_channel(struct StructRNA *srna);
void RNA_api_scene(struct StructRNA *srna);
void RNA_api_scene_render(struct StructRNA *srna);
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index d2acb49bae2..34eef0bb459 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -580,14 +580,14 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
- FunctionRNA *func;
- PropertyRNA *parm;
+// FunctionRNA *func;
+// PropertyRNA *parm;
- static EnumPropertyItem node_nodetree_items[] = {
+/* static EnumPropertyItem node_nodetree_items[] = {
{0, "SHADER", 0, "Shader", ""},
{1, "COMPOSITE", 0, "Composite", ""},
{2, "TEXTURE", 0, "Texture", ""},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}}; */
RNA_def_property_srna(cprop, "MainNodeTrees");
srna= RNA_def_struct(brna, "MainNodeTrees", NULL);
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 93a133bf380..12c4bb79e37 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -2050,7 +2050,7 @@ static void rna_def_dupli_object(BlenderRNA *brna)
/* TODO: DupliObject has more properties that can be wrapped */
}
-static void rna_def_base(BlenderRNA *brna)
+static void rna_def_object_base(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -2081,13 +2081,15 @@ static void rna_def_base(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", BA_WAS_SEL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "User Selected", "Object base user selection state, used to restore user selection after transformations");
+
+ RNA_api_object_base(srna);
}
void RNA_def_object(BlenderRNA *brna)
{
rna_def_object(brna);
rna_def_object_game_settings(brna);
- rna_def_base(brna);
+ rna_def_object_base(brna);
rna_def_vertex_group(brna);
rna_def_material_slot(brna);
rna_def_dupli_object(brna);
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 8efc0bb3e45..7b4cd3bed6a 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -65,6 +65,7 @@
#include "DNA_curve_types.h"
#include "DNA_modifier_types.h"
#include "DNA_constraint_types.h"
+#include "DNA_view3d_types.h"
#include "MEM_guardedalloc.h"
@@ -405,6 +406,13 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
*index= -1;
}
+/* ObjectBase */
+
+void rna_ObjectBase_layers_from_view(Base *base, View3D *v3d)
+{
+ base->lay= base->object->lay= v3d->lay;
+}
+
#else
void RNA_api_object(StructRNA *srna)
@@ -521,5 +529,17 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_return(func, parm);
}
+
+void RNA_api_object_base(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "layers_from_view", "rna_ObjectBase_layers_from_view");
+ RNA_def_function_ui_description(func, "Sets the object layers from a 3D View (use when adding an object in local view).");
+ parm= RNA_def_pointer(func, "view", "SpaceView3D", "", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+}
+
#endif
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index 85fcba286dd..b206384dbc4 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -154,7 +154,7 @@ static void rna_Sensor_keyboard_key_set(struct PointerRNA *ptr, int value)
bSensor *sens= (bSensor *)ptr->data;
bKeyboardSensor *ks = sens->data;
- if (ISKEYBOARD(value) && !ISKEYMODIFIER(value))
+ if (ISKEYBOARD(value))
ks->key = value;
}
@@ -163,7 +163,7 @@ static void rna_Sensor_keyboard_modifier_set(struct PointerRNA *ptr, int value)
bSensor *sens= (bSensor *)ptr->data;
bKeyboardSensor *ks = sens->data;
- if (ISKEYMODIFIER(value))
+ if (ISKEYBOARD(value))
ks->qual = value;
}
@@ -172,7 +172,7 @@ static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value)
bSensor *sens= (bSensor *)ptr->data;
bKeyboardSensor *ks = sens->data;
- if (ISKEYMODIFIER(value))
+ if (ISKEYBOARD(value))
ks->qual2 = value;
}
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 45c16a01308..ccbfc73acb2 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -153,7 +153,7 @@ static void stats_background(void *unused, RenderStats *rs)
mmap_used_memory= (mmap_in_use)/(1024.0*1024.0);
megs_peak_memory = (peak_memory)/(1024.0*1024.0);
- spos+= sprintf(spos, "Fra:%d Mem:%.2fM (%.2fM, combined peak %.2fM) ", rs->cfra,
+ spos+= sprintf(spos, "Fra:%d Mem:%.2fM (%.2fM, peak %.2fM) ", rs->cfra,
megs_used_memory, mmap_used_memory, megs_peak_memory);
if(rs->curfield)
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index 8b33753c2b1..9b087900734 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -2676,7 +2676,8 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f
switch(mtex->texco) {
case TEXCO_ANGMAP:
/* only works with texture being "real" */
- fact= (1.0/M_PI)*acos(lo[2])/(sqrt(lo[0]*lo[0] + lo[1]*lo[1]));
+ /* use saacos(), fixes bug [#22398], float precission caused lo[2] to be slightly less then -1.0 */
+ fact= (1.0/M_PI)*saacos(lo[2])/(sqrt(lo[0]*lo[0] + lo[1]*lo[1]));
tempvec[0]= lo[0]*fact;
tempvec[1]= lo[1]*fact;
tempvec[2]= 0.0;
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index c981836a8ed..91ebb5d6fb4 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -77,10 +77,15 @@
#include "RNA_access.h"
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+#include "IMB_thumbs.h"
+
#include "ED_datafiles.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
+#include "ED_view3d.h"
#include "ED_util.h"
#include "GHOST_C-api.h"
@@ -486,12 +491,53 @@ static void do_history(char *name, ReportList *reports)
BKE_report(reports, RPT_ERROR, "Unable to make version backup");
}
+/* writes a thumbnail for a blendfile */
+static void writeThumb(const char *path, Scene *scene, int **thumb_pt)
+{
+ /* will be scaled down, but gives some nice oversampling */
+ ImBuf *ibuf;
+ int *thumb;
+
+ *thumb_pt= NULL;
+
+ if(G.background || scene->camera==NULL)
+ return;
+
+ thumb = MEM_mallocN(((2 + (BLEN_THUMB_SIZE * BLEN_THUMB_SIZE))) * sizeof(int), "write_file thumb");
+
+ /* gets scaled to BLEN_THUMB_SIZE */
+ ibuf= ED_view3d_draw_offscreen_imbuf_simple(scene, BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2, OB_SOLID);
+
+ if(ibuf) {
+
+ /* dirty oversampling */
+ IMB_scaleImBuf(ibuf, BLEN_THUMB_SIZE, BLEN_THUMB_SIZE);
+
+ /* first write into thumb buffer */
+ thumb[0] = BLEN_THUMB_SIZE;
+ thumb[1] = BLEN_THUMB_SIZE;
+ memcpy(thumb + 2, ibuf->rect, BLEN_THUMB_SIZE * BLEN_THUMB_SIZE * sizeof(int));
+
+ /* the image is scaled here */
+ ibuf= IMB_thumb_create(path, THB_NORMAL, THB_SOURCE_BLEND, ibuf);
+ }
+
+ if (ibuf) {
+ IMB_freeImBuf(ibuf);
+ }
+
+ /* must be freed by caller */
+ *thumb_pt= thumb;
+}
+
int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports)
{
Library *li;
int len;
char di[FILE_MAX];
-
+
+ int *thumb= NULL;
+
len = strlen(target);
if (len == 0) {
@@ -532,7 +578,10 @@ int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports)
do_history(di, reports);
- if (BLO_write_file(CTX_data_main(C), di, fileflags, reports)) {
+ /* blend file thumbnail */
+ writeThumb(di, CTX_data_scene(C), &thumb);
+
+ if (BLO_write_file(CTX_data_main(C), di, fileflags, reports, thumb)) {
strcpy(G.sce, di);
G.relbase_valid = 1;
strcpy(G.main->name, di); /* is guaranteed current file */
@@ -546,7 +595,11 @@ int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports)
else G.fileflags &= ~G_FILE_AUTOPLAY;
writeBlog();
- } else {
+
+ if(thumb) MEM_freeN(thumb);
+ }
+ else {
+ if(thumb) MEM_freeN(thumb);
return -1;
}
@@ -571,7 +624,7 @@ int WM_write_homefile(bContext *C, wmOperator *op)
/* force save as regular blend file */
fileflags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_AUTOPLAY | G_FILE_LOCK | G_FILE_SIGN);
- BLO_write_file(CTX_data_main(C), tstr, fileflags, op->reports);
+ BLO_write_file(CTX_data_main(C), tstr, fileflags, op->reports, NULL);
G.save_over= 0;
@@ -640,7 +693,7 @@ void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt)
fileflags = G.fileflags & ~(G_FILE_COMPRESS|G_FILE_AUTOPLAY |G_FILE_LOCK|G_FILE_SIGN);
/* no error reporting to console */
- BLO_write_file(CTX_data_main(C), filename, fileflags, NULL);
+ BLO_write_file(CTX_data_main(C), filename, fileflags, NULL, NULL);
/* do timer after file write, just in case file write takes a long time */
wm->autosavetimer= WM_event_add_timer(wm, NULL, TIMERAUTOSAVE, U.savetime*60.0);
diff --git a/source/creator/creator.c b/source/creator/creator.c
index dbb0c38267d..faf6bf57e1d 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -32,6 +32,12 @@
#include <fenv.h>
#endif
+#define OSX_SSE_FPE (defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__)))
+
+#if OSX_SSE_FPE
+#include <xmmintrin.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
@@ -139,7 +145,7 @@ char blender_path[FILE_MAXDIR+FILE_MAXFILE] = BLENDERPATH;
static void setCallbacks(void);
/* on linux set breakpoints here when running in debug mode, useful to catch floating point errors */
-#if defined(__sgi) || defined(__linux__)
+#if defined(__sgi) || defined(__linux__) || OSX_SSE_FPE
static void fpe_handler(int sig)
{
// printf("SIGFPE trapped\n");
@@ -197,102 +203,107 @@ static int print_version(int argc, char **argv, void *data)
static int print_help(int argc, char **argv, void *data)
{
+ bArgs *ba = (bArgs*)data;
+
printf ("Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
- printf ("Usage: blender [args ...] [file] [args ...]\n");
- printf ("\nRender options:\n");
- printf (" -b <file>\tLoad <file> in background (often used for background rendering)\n");
- printf (" -a render frames from start to end (inclusive), only works when used after -b\n");
- printf (" -S <name>\tSet scene <name>\n");
- printf (" -f <frame>\tRender frame <frame> and save it\n");
- printf (" -s <frame>\tSet start to frame <frame> (use before the -a argument)\n");
- printf (" -e <frame>\tSet end to frame <frame> (use before the -a argument)\n");
- printf (" -o <path>\tSet the render path and file name.\n");
- printf (" Use // at the start of the path to\n");
- printf (" render relative to the blend file.\n");
- printf (" The # characters are replaced by the frame number, and used to define zero padding.\n");
- printf (" ani_##_test.png becomes ani_01_test.png\n");
- printf (" test-######.png becomes test-000001.png\n");
- printf (" When the filename has no #, The suffix #### is added to the filename\n");
- printf (" The frame number will be added at the end of the filename.\n");
- printf (" eg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a\n");
- printf (" -E <engine>\tSpecify the render engine.\n");
- printf (" use -E help to list available engines.\n");
- printf ("\nFormat options:\n");
- printf (" -F <format>\tSet the render format, Valid options are...\n");
- printf (" \tTGA IRIS JPEG MOVIE IRIZ RAWTGA\n");
- printf (" \tAVIRAW AVIJPEG PNG BMP FRAMESERVER\n");
- printf (" (formats that can be compiled into blender, not available on all systems)\n");
- printf (" \tHDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS\n");
- printf (" -x <bool>\tSet option to add the file extension to the end of the file.\n");
- printf (" -t <threads>\tUse amount of <threads> for rendering (background mode only).\n");
- printf (" [1-%d], 0 for systems processor count.\n", BLENDER_MAX_THREADS);
- printf ("\nAnimation playback options:\n");
- printf (" -a <options> <file(s)>\tPlayback <file(s)>, only operates this way when -b is not used.\n");
- printf (" -p <sx> <sy>\tOpen with lower left corner at <sx>, <sy>\n");
- printf (" -m\t\tRead from disk (Don't buffer)\n");
- printf (" -f <fps> <fps-base>\t\tSpecify FPS to start with\n");
- printf (" -j <frame>\tSet frame step to <frame>\n");
+ printf ("Usage: blender [args ...] [file] [args ...]\n\n");
+
+ printf ("Render Options:\n");
+ BLI_argsPrintArgDoc(ba, "-b");
+ BLI_argsPrintArgDoc(ba, "--render-anim");
+ BLI_argsPrintArgDoc(ba, "--scene");
+ BLI_argsPrintArgDoc(ba, "--render-frame");
+ BLI_argsPrintArgDoc(ba, "--frame-start");
+ BLI_argsPrintArgDoc(ba, "--frame-end");
+ BLI_argsPrintArgDoc(ba, "--frame-jump");
+ BLI_argsPrintArgDoc(ba, "--render-output");
+ BLI_argsPrintArgDoc(ba, "--engine");
+
+ printf("\n");
+ printf ("Format Options:\n");
+ BLI_argsPrintArgDoc(ba, "--render-format");
+ BLI_argsPrintArgDoc(ba, "--use-extension");
+ BLI_argsPrintArgDoc(ba, "--threads");
+
+ printf("\n");
+ printf ("Animation Playback Options:\n");
+ BLI_argsPrintArgDoc(ba, "-a");
- printf ("\nWindow options:\n");
- printf (" -w\t\tForce opening with borders (default)\n");
- printf (" -W\t\tForce opening without borders\n");
- printf (" -p <sx> <sy> <w> <h>\tOpen with lower left corner at <sx>, <sy>\n");
- printf (" \tand width and height <w>, <h>\n");
- printf ("\nGame Engine specific options:\n");
- printf (" -g fixedtime\t\tRun on 50 hertz without dropping frames\n");
- printf (" -g vertexarrays\tUse Vertex Arrays for rendering (usually faster)\n");
- printf (" -g nomipmap\t\tNo Texture Mipmapping\n");
- printf (" -g linearmipmap\tLinear Texture Mipmapping instead of Nearest (default)\n");
-
- printf ("\nMisc options:\n");
- printf (" -d\t\tTurn debugging on\n");
- printf (" \t\t * prints every operator call and their arguments\n");
- printf (" \t\t * disables mouse grab (to interact with a debugger in some cases)\n");
- printf (" \t\t * keeps python sys.stdin rather then setting it to None\n");
- printf (" -nojoystick\tDisable joystick support\n");
- printf (" -noglsl\tDisable GLSL shading\n");
- printf (" -noaudio\tForce sound system to None\n");
- printf (" -setaudio\tForce sound system to a specific device\n");
- printf (" \tNULL SDL OPENAL JACK\n");
- printf (" -h\t\tPrint this help text\n");
- printf (" -y\t\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)\n");
- printf (" -Y\t\tEnable automatic python script execution\n");
- printf (" -P <filename>\tRun the given Python script (filename or Blender Text)\n");
+ printf("\n");
+ printf ("Window Options:\n");
+ BLI_argsPrintArgDoc(ba, "--window-border");
+ BLI_argsPrintArgDoc(ba, "--window-borderless");
+ BLI_argsPrintArgDoc(ba, "--window-geometry");
+
+ printf("\n");
+ printf ("Game Engine specific options:\n");
+ BLI_argsPrintArgDoc(ba, "-g");
+
+ printf("\n");
+ printf ("Misc options:\n");
+ BLI_argsPrintArgDoc(ba, "--debug");
+ BLI_argsPrintArgDoc(ba, "--debug-fpe");
+
+ printf("\n");
+
+ BLI_argsPrintArgDoc(ba, "-nojoystick");
+ BLI_argsPrintArgDoc(ba, "-noglsl");
+ BLI_argsPrintArgDoc(ba, "-noaudio");
+ BLI_argsPrintArgDoc(ba, "-setaudio");
+
+ printf("\n");
+
+ BLI_argsPrintArgDoc(ba, "--help");
+
+ printf("\n");
+
+ BLI_argsPrintArgDoc(ba, "--enable-autoexec");
+ BLI_argsPrintArgDoc(ba, "--disable-autoexec");
+
+ printf("\n");
+
+ BLI_argsPrintArgDoc(ba, "--python");
+
#ifdef WIN32
- printf (" -R\t\tRegister .blend extension\n");
+ BLI_argsPrintArgDoc(ba, "-R");
#endif
- printf (" -v\t\tPrint Blender version and exit\n");
- printf (" --\t\tEnds option processing. Following arguments are \n");
- printf (" \t\t passed unchanged. Access via Python's sys.argv\n");
+ BLI_argsPrintArgDoc(ba, "--version");
+
+ BLI_argsPrintArgDoc(ba, "--");
+
+ printf ("Other Options:\n");
+ BLI_argsPrintOtherDoc(ba);
+
printf ("\nEnvironment Variables:\n");
printf (" $HOME\t\t\tStore files such as .blender/ .B.blend .Bfs .Blog here.\n");
- printf (" $BLENDERPATH\tSystem directory to use for data files and scripts.\n");
- printf (" \tFor this build of blender the default BLENDERPATH is...\n");
- printf (" \t\"%s\"\n", blender_path);
- printf (" \tseting the $BLENDERPATH will override this\n");
+ printf (" $BLENDERPATH System directory to use for data files and scripts.\n");
+ printf (" For this build of blender the default BLENDERPATH is...\n");
+ printf (" \"%s\"\n", blender_path);
+ printf (" seting the $BLENDERPATH will override this\n");
#ifdef WIN32
- printf (" $TEMP\t\tStore temporary files here.\n");
+ printf (" $TEMP Store temporary files here.\n");
#else
- printf (" $TMP or $TMPDIR\tStore temporary files here.\n");
- printf (" $BF_TIFF_LIB\t\tUse an alternative libtiff.so for loading tiff image files.\n");
+ printf (" $TMP or $TMPDIR Store temporary files here.\n");
#endif
#ifndef DISABLE_SDL
- printf (" $SDL_AUDIODRIVER\tLibSDL audio driver - alsa, esd, alsa, dma.\n");
+ printf (" $SDL_AUDIODRIVER LibSDL audio driver - alsa, esd, alsa, dma.\n");
#endif
- printf (" $IMAGEEDITOR\t\tImage editor executable, launch with the IKey from the file selector.\n");
- printf (" $WINEDITOR\t\tText editor executable, launch with the EKey from the file selector.\n");
- printf (" $PYTHONHOME\t\tPath to the python directory, eg. /usr/lib/python.\n");
- printf ("\nNote: Arguments must be separated by white space. eg:\n");
+ printf (" $IMAGEEDITOR Image editor executable, launch with the IKey from the file selector.\n");
+ printf (" $WINEDITOR Text editor executable, launch with the EKey from the file selector.\n");
+ printf (" $PYTHONHOME Path to the python directory, eg. /usr/lib/python.\n\n");
+
+ printf ("Note: Arguments must be separated by white space. eg:\n");
printf (" \"blender -ba test.blend\"\n");
printf (" ...will ignore the 'a'\n");
printf (" \"blender -b test.blend -f8\"\n");
- printf (" ...will ignore 8 because there is no space between the -f and the frame value\n");
+ printf (" ...will ignore 8 because there is no space between the -f and the frame value\n\n");
+
printf ("Note: Arguments are executed in the order they are given. eg:\n");
- printf (" \"blender -b test.blend -f 1 -o /tmp\"\n");
- printf (" ...may not render to /tmp because '-f 1' renders before the output path is set\n");
- printf (" \"blender -b -o /tmp test.blend -f 1\"\n");
- printf (" ...may not render to /tmp because loading the blend file overwrites the output path that was set\n");
- printf (" \"blender -b test.blend -o /tmp -f 1\" works as expected.\n\n");
+ printf (" \"blender --background test.blend --render-frame 1 --render-output /tmp\"\n");
+ printf (" ...will not render to /tmp because '--render-frame 1' renders before the output path is set\n");
+ printf (" \"blender --background --render-output /tmp test.blend --render-frame 1\"\n");
+ printf (" ...will not render to /tmp because loading the blend file overwrites the render output that was set\n");
+ printf (" \"blender --background test.blend --render-output /tmp --render-frame 1\" works as expected.\n\n");
exit(0);
@@ -353,15 +364,23 @@ static int debug_mode(int argc, char **argv, void *data)
static int set_fpe(int argc, char **argv, void *data)
{
-#if defined(__sgi) || defined(__linux__)
+#if defined(__sgi) || defined(__linux__) || OSX_SSE_FPE
/* zealous but makes float issues a heck of a lot easier to find!
* set breakpoints on fpe_handler */
signal(SIGFPE, fpe_handler);
#if defined(__linux__) && defined(__GNUC__)
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW );
+#else
+#if OSX_SSE_FPE
+ /* OSX uses SSE for floating point by default, so here
+ * use SSE instructions to throw floating point exceptions */
+ _MM_SET_EXCEPTION_MASK(_MM_MASK_MASK &~
+ (_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO));
+#endif /* OSX_SSE_FPE */
+#endif /* defined(__linux__) && defined(__GNUC__) */
#endif
-#endif
+
return 0;
}
@@ -466,11 +485,11 @@ static int set_output(int argc, char **argv, void *data)
Scene *scene= CTX_data_scene(C);
BLI_strncpy(scene->r.pic, argv[1], FILE_MAXDIR);
} else {
- printf("\nError: no blend loaded. cannot use '-o'.\n");
+ printf("\nError: no blend loaded. cannot use '-o / --render-output'.\n");
}
return 1;
} else {
- printf("\nError: you must specify a path after '-o '.\n");
+ printf("\nError: you must specify a path after '-o / --render-output'.\n");
return 0;
}
}
@@ -494,7 +513,7 @@ static int set_engine(int argc, char **argv, void *data)
{
if (CTX_data_scene(C)==NULL)
{
- printf("\nError: no blend loaded. order the arguments so '-E ' is after a blend is loaded.\n");
+ printf("\nError: no blend loaded. order the arguments so '-E / --engine ' is after a blend is loaded.\n");
}
else
{
@@ -527,7 +546,7 @@ static int set_image_type(int argc, char **argv, void *data)
if (argc >= 1){
char *imtype = argv[1];
if (CTX_data_scene(C)==NULL) {
- printf("\nError: no blend loaded. order the arguments so '-F ' is after the blend is loaded.\n");
+ printf("\nError: no blend loaded. order the arguments so '-F / --render-format' is after the blend is loaded.\n");
} else {
Scene *scene= CTX_data_scene(C);
if (!strcmp(imtype,"TGA")) scene->r.imtype = R_TARGA;
@@ -559,11 +578,11 @@ static int set_image_type(int argc, char **argv, void *data)
#if WITH_OPENJPEG
else if (!strcmp(imtype,"JP2")) scene->r.imtype = R_JP2;
#endif
- else printf("\nError: Format from '-F' not known or not compiled in this release.\n");
+ else printf("\nError: Format from '-F / --render-format' not known or not compiled in this release.\n");
}
return 1;
} else {
- printf("\nError: you must specify a format after '-F '.\n");
+ printf("\nError: you must specify a format after '-F / --render-foramt'.\n");
return 0;
}
}
@@ -578,7 +597,7 @@ static int set_threads(int argc, char **argv, void *data)
}
return 1;
} else {
- printf("\nError: you must specify a number of threads between 0 and 8 '-t '.\n");
+ printf("\nError: you must specify a number of threads between 0 and 8 '-t / --threads'.\n");
return 0;
}
}
@@ -594,7 +613,7 @@ static int set_extension(int argc, char **argv, void *data)
} else if (argv[1][0] == '1') {
scene->r.scemode |= R_EXTENSION;
} else {
- printf("\nError: Use '-x 1' or '-x 0' To set the extension option.\n");
+ printf("\nError: Use '-x 1 / -x 0' To set the extension option or '--use-extension'\n");
}
} else {
printf("\nError: no blend loaded. order the arguments so '-o ' is after '-x '.\n");
@@ -677,11 +696,11 @@ static int render_frame(int argc, char **argv, void *data)
RE_BlenderAnim(re, scene, scene->lay, frame, frame, scene->r.frame_step, &reports);
return 1;
} else {
- printf("\nError: frame number must follow '-f'.\n");
+ printf("\nError: frame number must follow '-f / --render-frame'.\n");
return 0;
}
} else {
- printf("\nError: no blend loaded. cannot use '-f'.\n");
+ printf("\nError: no blend loaded. cannot use '-f / --render-frame'.\n");
return 0;
}
}
@@ -707,7 +726,7 @@ static int set_scene(int argc, char **argv, void *data)
set_scene_name(argv[1]);
return 1;
} else {
- printf("\nError: Scene name must follow '-S'.\n");
+ printf("\nError: Scene name must follow '-S / --scene'.\n");
return 0;
}
}
@@ -722,11 +741,11 @@ static int set_start_frame(int argc, char **argv, void *data)
(scene->r.sfra) = CLAMPIS(frame, MINFRAME, MAXFRAME);
return 1;
} else {
- printf("\nError: frame number must follow '-s'.\n");
+ printf("\nError: frame number must follow '-s / --frame-start'.\n");
return 0;
}
} else {
- printf("\nError: no blend loaded. cannot use '-s'.\n");
+ printf("\nError: no blend loaded. cannot use '-s / --frame-start'.\n");
return 0;
}
}
@@ -741,11 +760,11 @@ static int set_end_frame(int argc, char **argv, void *data)
(scene->r.efra) = CLAMPIS(frame, MINFRAME, MAXFRAME);
return 1;
} else {
- printf("\nError: frame number must follow '-e'.\n");
+ printf("\nError: frame number must follow '-e / --frame-end'.\n");
return 0;
}
} else {
- printf("\nError: no blend loaded. cannot use '-e'.\n");
+ printf("\nError: no blend loaded. cannot use '-e / --frame-end'.\n");
return 0;
}
}
@@ -760,11 +779,11 @@ static int set_skip_frame(int argc, char **argv, void *data)
(scene->r.frame_step) = CLAMPIS(frame, 1, MAXFRAME);
return 1;
} else {
- printf("\nError: number of frames to step must follow '-j'.\n");
+ printf("\nError: number of frames to step must follow '-j / --frame-jump'.\n");
return 0;
}
} else {
- printf("\nError: no blend loaded. cannot use '-j'.\n");
+ printf("\nError: no blend loaded. cannot use '-j / --frame-jump'.\n");
return 0;
}
}
@@ -802,7 +821,7 @@ static int run_python(int argc, char **argv, void *data)
return 1;
} else {
- printf("\nError: you must specify a Python script after '-P '.\n");
+ printf("\nError: you must specify a Python script after '-P / --python'.\n");
return 0;
}
#else
@@ -855,56 +874,93 @@ static int load_file(int argc, char **argv, void *data)
void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
{
- //BLI_argsAdd(ba, arg, pass, BA_ArgCallback cb, C);
+ static char output_doc[] = "<path>"
+ "\n\tSet the render path and file name."
+ "\n\tUse // at the start of the path to"
+ "\n\t\trender relative to the blend file."
+ "\n\tThe # characters are replaced by the frame number, and used to define zero padding."
+ "\n\t\tani_##_test.png becomes ani_01_test.png"
+ "\n\t\ttest-######.png becomes test-000001.png"
+ "\n\t\tWhen the filename does not contain #, The suffix #### is added to the filename"
+ "\n\tThe frame number will be added at the end of the filename."
+ "\n\t\teg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a"
+ "\n\t\t//render_ becomes //render_####, writing frames as //render_0001.png//";
+
+ static char format_doc[] = "<format>"
+ "\n\tSet the render format, Valid options are..."
+ "\n\t\tTGA IRIS JPEG MOVIE IRIZ RAWTGA"
+ "\n\t\tAVIRAW AVIJPEG PNG BMP FRAMESERVER"
+ "\n\t(formats that can be compiled into blender, not available on all systems)"
+ "\n\t\tHDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS";
+
+ static char playback_doc[] = "<options> <file(s)>"
+ "\n\tPlayback <file(s)>, only operates this way when not running in background."
+ "\n\t\t-p <sx> <sy>\tOpen with lower left corner at <sx>, <sy>"
+ "\n\t\t-m\t\tRead from disk (Don't buffer)"
+ "\n\t\t-f <fps> <fps-base>\t\tSpecify FPS to start with"
+ "\n\t\t-j <frame>\tSet frame step to <frame>";
+
+ static char game_doc[] = "Game Engine specific options"
+ "\n\t-g fixedtime\t\tRun on 50 hertz without dropping frames"
+ "\n\t-g vertexarrays\tUse Vertex Arrays for rendering (usually faster)"
+ "\n\t-g nomipmap\t\tNo Texture Mipmapping"
+ "\n\t-g linearmipmap\tLinear Texture Mipmapping instead of Nearest (default)";
+
+ static char debug_doc[] = "\n\tTurn debugging on\n"
+ "\n\t* Prints every operator call and their arguments"
+ "\n\t* Disables mouse grab (to interact with a debugger in some cases)"
+ "\n\t* Keeps python sys.stdin rather then setting it to None";
+
+ //BLI_argsAdd(ba, pass, short_arg, long_arg, doc, cb, C);
/* end argument processing after -- */
- BLI_argsAdd(ba, "--", -1, end_arguments, NULL);
+ BLI_argsAdd(ba, -1, "--", NULL, "\n\tEnds option processing, following arguments passed unchanged. Access via python's sys.argv", end_arguments, NULL);
/* first pass: background mode, disable python and commands that exit after usage */
- BLI_argsAdd(ba, "--help", 1, print_help, NULL);
- BLI_argsAdd(ba, "-h", 1, print_help, NULL);
- BLI_argsAdd(ba, "/?", 1, print_help, NULL);
+ BLI_argsAdd(ba, 1, "-h", "--help", "\n\tPrint this help text and exit", print_help, ba);
+ /* Windows only */
+ BLI_argsAdd(ba, 1, "/?", NULL, "\n\tPrint this help text and exit (windows only)", print_help, ba);
- BLI_argsAdd(ba, "--version", 1, print_version, NULL);
- BLI_argsAdd(ba, "-v", 1, print_version, NULL);
+ BLI_argsAdd(ba, 1, "-v", "--version", "\n\tPrint Blender version and exit", print_version, NULL);
- BLI_argsAdd(ba, "-Y", 1, enable_python, NULL);
- BLI_argsAdd(ba, "-y", 1, disable_python, NULL);
+ BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution (default)", enable_python, NULL);
+ BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)", disable_python, NULL);
- BLI_argsAdd(ba, "-fpe", 1, set_fpe, NULL);
+ BLI_argsAdd(ba, 1, "-b", "--background", "<file>\n\tLoad <file> in background (often used for UI-less rendering)", background_mode, NULL);
- BLI_argsAdd(ba, "-B", 1, background_mode, NULL);
- BLI_argsAdd(ba, "-b", 1, background_mode, NULL);
- BLI_argsAdd(ba, "-a", 1, playback_mode, NULL);
+ BLI_argsAdd(ba, 1, "-a", NULL, playback_doc, playback_mode, NULL);
- BLI_argsAdd(ba, "-d", 1, debug_mode, ba);
+ BLI_argsAdd(ba, 1, "-d", "--debug", debug_doc, debug_mode, ba);
+ BLI_argsAdd(ba, 1, NULL, "--debug-fpe", "\n\tEnable floating point exceptions (currently linux and osx intel only)", set_fpe, NULL);
/* second pass: custom window stuff */
- BLI_argsAdd(ba, "-p", 2, prefsize, NULL);
- BLI_argsAdd(ba, "-w", 2, with_borders, NULL);
- BLI_argsAdd(ba, "-W", 2, without_borders, NULL);
- BLI_argsAdd(ba, "-R", 2, register_extension, ba);
+ BLI_argsAdd(ba, 2, "-p", "--window-geometry", "<sx> <sy> <w> <h>\n\tOpen with lower left corner at <sx>, <sy> and width and height as <w>, <h>", prefsize, NULL);
+ BLI_argsAdd(ba, 2, "-w", "--window-border", "\n\tForce opening with borders (default)", with_borders, NULL);
+ BLI_argsAdd(ba, 2, "-W", "--window-borderless", "\n\tForce opening with without borders", without_borders, NULL);
+ BLI_argsAdd(ba, 2, "-R", NULL, "\n\tRegister .blend extension (windows only)", register_extension, ba);
/* third pass: disabling things and forcing settings */
- BLI_argsAddCase(ba, "-nojoystick", 3, no_joystick, syshandle);
- BLI_argsAddCase(ba, "-noglsl", 3, no_glsl, NULL);
- BLI_argsAddCase(ba, "-noaudio", 3, no_audio, NULL);
- BLI_argsAddCase(ba, "-setaudio", 3, set_audio, NULL);
+ BLI_argsAddCase(ba, 3, "-nojoystick", 1, NULL, 0, "\n\tDisable joystick support", no_joystick, syshandle);
+ BLI_argsAddCase(ba, 3, "-noglsl", 1, NULL, 0, "\n\tDisable GLSL shading", no_glsl, NULL);
+ BLI_argsAddCase(ba, 3, "-noaudio", 1, NULL, 0, "\n\tForce sound system to None", no_audio, NULL);
+ BLI_argsAddCase(ba, 3, "-setaudio", 1, NULL, 0, "\n\tForce sound system to a specific device\n\tNULL SDL OPENAL JACK", set_audio, NULL);
/* fourth pass: processing arguments */
- BLI_argsAdd(ba, "-g", 4, set_ge_parameters, syshandle);
- BLI_argsAdd(ba, "-f", 4, render_frame, C);
- BLI_argsAdd(ba, "-a", 4, render_animation, C);
- BLI_argsAdd(ba, "-S", 4, set_scene, NULL);
- BLI_argsAdd(ba, "-s", 4, set_start_frame, C);
- BLI_argsAdd(ba, "-e", 4, set_end_frame, C);
- BLI_argsAdd(ba, "-j", 4, set_skip_frame, C);
- BLI_argsAdd(ba, "-P", 4, run_python, C);
- BLI_argsAdd(ba, "-o", 4, set_output, C);
- BLI_argsAdd(ba, "-E", 4, set_engine, C);
- BLI_argsAdd(ba, "-F", 4, set_image_type, C);
- BLI_argsAdd(ba, "-t", 4, set_threads, NULL);
- BLI_argsAdd(ba, "-x", 4, set_extension, C);
+ BLI_argsAdd(ba, 4, "-g", NULL, game_doc, set_ge_parameters, syshandle);
+ BLI_argsAdd(ba, 4, "-f", "--render-frame", "<frame>\n\tRender frame <frame> and save it", render_frame, C);
+ BLI_argsAdd(ba, 4, "-a", "--render-anim", "\n\tRender frames from start to end (inclusive)", render_animation, C);
+ BLI_argsAdd(ba, 4, "-S", "--scene", "<name>\n\tSet the active scene <name> for rendering", set_scene, NULL);
+ BLI_argsAdd(ba, 4, "-s", "--frame-start", "<frame>\n\tSet start to frame <frame> (use before the -a argument)", set_start_frame, C);
+ BLI_argsAdd(ba, 4, "-e", "--frame-end", "<frame>\n\tSet end to frame <frame> (use before the -a argument)", set_end_frame, C);
+ BLI_argsAdd(ba, 4, "-j", "--frame-jump", "<frames>\n\tSet number of frames to step forward after each rendered frame", set_skip_frame, C);
+ BLI_argsAdd(ba, 4, "-P", "--python", "<filename>\n\tRun the given Python script (filename or Blender Text)", run_python, C);
+
+ BLI_argsAdd(ba, 4, "-o", "--render-output", output_doc, set_output, C);
+ BLI_argsAdd(ba, 4, "-E", "--engine", "<engine>\n\tSpecify the render engine\n\tuse -E help to list available engines", set_engine, C);
+
+ BLI_argsAdd(ba, 4, "-F", "--render-format", format_doc, set_image_type, C);
+ BLI_argsAdd(ba, 4, "-t", "--threads", "<threads>\n\tUse amount of <threads> for rendering in background\n\t[1-" QUOTE(BLENDER_MAX_THREADS) "], 0 for systems processor count.", set_threads, NULL);
+ BLI_argsAdd(ba, 4, "-x", "--use-extension", "<bool>\n\tSet option to add the file extension to the end of the file", set_extension, C);
}
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 4a2aa3695fa..2f0f70ed9fe 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -1729,7 +1729,7 @@ static KX_GameObject *gameobject_from_blenderobject(
// only support relative shape key
bool bHasShapeKey = mesh->key != NULL && mesh->key->type==KEY_RELATIVE;
bool bHasDvert = mesh->dvert != NULL && ob->defbase.first;
- bool bHasArmature = (ob->parent && ob->parent->type == OB_ARMATURE && ob->partype==PARSKEL && bHasDvert);
+ bool bHasArmature = (BL_ModifierDeformer::HasArmatureDeformer(ob) && ob->parent && ob->parent->type == OB_ARMATURE && bHasDvert);
bool bHasModifier = BL_ModifierDeformer::HasCompatibleDeformer(ob);
bool bHasSoftBody = (!ob->parent && (ob->gameflag & OB_SOFT_BODY));
@@ -2357,8 +2357,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
if (me->dvert){
BL_DeformableGameObject *obj = (BL_DeformableGameObject*)converter->FindGameObject(blenderobj);
-
- if (obj && blenderobj->parent && blenderobj->parent->type==OB_ARMATURE && blenderobj->partype==PARSKEL){
+
+ if (obj && BL_ModifierDeformer::HasArmatureDeformer(blenderobj) && blenderobj->parent && blenderobj->parent->type==OB_ARMATURE){
KX_GameObject *par = converter->FindGameObject(blenderobj->parent);
if (par && obj->GetDeformer())
((BL_SkinDeformer*)obj->GetDeformer())->SetArmature((BL_ArmatureObject*) par);
diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp
index e28ea47b162..5ccf8de29b1 100644
--- a/source/gameengine/Converter/BL_ModifierDeformer.cpp
+++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp
@@ -114,11 +114,27 @@ bool BL_ModifierDeformer::HasCompatibleDeformer(Object *ob)
continue;
if (!(md->mode & eModifierMode_Realtime))
continue;
+ /* armature modifier are handled by SkinDeformer, not ModifierDeformer */
+ if (md->type == eModifierType_Armature )
+ continue;
return true;
}
return false;
}
+bool BL_ModifierDeformer::HasArmatureDeformer(Object *ob)
+{
+ if (!ob->modifiers.first)
+ return false;
+
+ ModifierData* md;
+ for (md = (ModifierData*)ob->modifiers.first; md; md = (ModifierData*)md->next) {
+ if (md->type == eModifierType_Armature )
+ return true;
+ }
+ return false;
+}
+
bool BL_ModifierDeformer::Update(void)
{
bool bShapeUpdate = BL_ShapeDeformer::Update();
diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h
index 1122d5e8b32..adf537110f1 100644
--- a/source/gameengine/Converter/BL_ModifierDeformer.h
+++ b/source/gameengine/Converter/BL_ModifierDeformer.h
@@ -45,6 +45,7 @@ class BL_ModifierDeformer : public BL_ShapeDeformer
{
public:
static bool HasCompatibleDeformer(Object *ob);
+ static bool HasArmatureDeformer(Object *ob);
BL_ModifierDeformer(BL_DeformableGameObject *gameobj,
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index ebd0fa5c525..d72fef166e6 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1067,12 +1067,12 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
bool bHasShapeKey = blendmesh->key != NULL && blendmesh->key->type==KEY_RELATIVE;
bool bHasDvert = blendmesh->dvert != NULL;
bool bHasArmature =
+ BL_ModifierDeformer::HasArmatureDeformer(blendobj) &&
parentobj && // current parent is armature
parentobj->GetGameObjectType() == SCA_IObject::OBJ_ARMATURE &&
oldblendobj && // needed for mesh deform
blendobj->parent && // original object had armature (not sure this test is needed)
- blendobj->parent->type == OB_ARMATURE &&
- blendobj->partype==PARSKEL &&
+ blendobj->parent->type == OB_ARMATURE &&
blendmesh->dvert!=NULL; // mesh has vertex group
bool bHasSoftBody = (!parentobj && (blendobj->gameflag & OB_SOFT_BODY));
diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk
index d10a2353a94..df4a1175821 100644
--- a/source/nan_definitions.mk
+++ b/source/nan_definitions.mk
@@ -133,13 +133,13 @@ ifndef CONFIG_GUESS
endif
ifeq ($(WITH_JACK), true)
- export NAN_JACK ?= /usr
+ export NAN_JACK ?= $(LCGDIR)/jack
export NAN_JACKCFLAGS ?= -I$(NAN_JACK)/include/jack
export NAN_JACKLIBS ?= $(NAN_JACK)/lib/libjack.a
endif
ifeq ($(WITH_SNDFILE),true)
- export NAN_SNDFILE ?= /usr
+ export NAN_SNDFILE ?= $(LCGDIR)/sndfile
export NAN_SNDFILECFLAGS ?= -I$(NAN_SNDFILE)/include
export NAN_SNDFILELIBS ?= $(NAN_SNDFILE)/lib/libsndfile.a $(NAN_SNDFILE)/lib/libFLAC.a $(NAN_SNDFILE)/lib/libogg.a
endif
@@ -158,9 +158,8 @@ ifndef CONFIG_GUESS
export BF_PCRE_LIBS ?= $(BF_PCRE)/lib/libpcre.a
endif
- export WITH_TIFF ?= true
-
-
+ export WITH_TIFF =? true
+
# Compare recreated .mo files with committed ones
export BF_VERIFY_MO_FILES ?= true
@@ -277,6 +276,7 @@ ifndef CONFIG_GUESS
endif
export BF_PCRE = $(LCGDIR)/opencollada
+ export BF_OPENCOLLADA_LIBS = $(BF_OPENCOLLADA)/lib/libOpenCOLLADASaxFrameworkLoader.a $(BF_OPENCOLLADA)/lib/libOpenCOLLADAFramework.a $(BF_OPENCOLLADA)/lib/libOpenCOLLADABaseUtils.a $(BF_OPENCOLLADA)/lib/libOpenCOLLADAStreamWriter.a $(BF_OPENCOLLADA)/lib/libMathMLSolver.a $(BF_OPENCOLLADA)/lib/libGeneratedSaxParser.a $(BF_OPENCOLLADA)/lib/libUTF.a $(BF_OPENCOLLADA)/lib/libftoa.a $(BF_OPENCOLLADA)/lib/libbuffer.a -lxml2
else
ifeq ($(OS),freebsd)
@@ -371,7 +371,7 @@ ifndef CONFIG_GUESS
# enable l10n
export INTERNATIONAL ?= true
- # Different endianess will make it fail, rely on other plataforms for checks
+ # Different endianess will make it fail, rely on other platforms for checks
export BF_VERIFY_MO_FILES = false
else
@@ -413,12 +413,6 @@ ifndef CONFIG_GUESS
export BF_FFTW3_LIBS ?= $(shell pkg-config --libs fftw3 )
endif
- ifeq ($(WITH_OPENJPEG), true)
- export BF_OPENJPEG ?= /usr
- export BF_OPENJPEG_INC ?= /usr/include
- export BF_OPENJPEG_LIBS ?= -lopenjpeg
- endif
-
# Uncomment the following line to use Mozilla inplace of netscape
# Location of MOZILLA/Netscape header files...
@@ -441,6 +435,11 @@ ifndef CONFIG_GUESS
export WITH_FFMPEG ?= true
endif
+ ifeq ($(CPU), powerpc)
+ # Different endianess will make it fail, rely on other platforms for checks
+ export BF_VERIFY_MO_FILES = false
+ endif
+
else
ifeq ($(OS),openbsd)
diff --git a/source/nan_link.mk b/source/nan_link.mk
index 5337e75c6c1..bbf4053b14c 100644
--- a/source/nan_link.mk
+++ b/source/nan_link.mk
@@ -108,7 +108,7 @@ ifeq ($(OS),linux)
endif
ifeq ($(CPU),$(findstring $(CPU), "i386 x86_64 ia64 parisc64 powerpc sparc64"))
COMMENT = "MESA 3.1"
- LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXmu -lXext -lX11 -lXi
+ LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXext -lX11 -lXi
LLIBS += -lutil -lc -lm -ldl -lpthread
LLIBS += -L$(NAN_PYTHON)/lib -Wl,-rpath -Wl,$(NAN_PYTHON)/lib -lpython$(NAN_PYTHON_VERSION)
LOPTS = -export-dynamic
diff --git a/tools/btools.py b/tools/btools.py
index 271fccff50c..e76ada3a985 100644
--- a/tools/btools.py
+++ b/tools/btools.py
@@ -160,7 +160,7 @@ def SetupSpawn( env ):
env['SPAWN'] = buf.ourspawn
-def read_opts(cfg, args):
+def read_opts(env, cfg, args):
localopts = Variables.Variables(cfg, args)
localopts.AddVariables(
('LCGDIR', 'location of cvs lib dir'),
@@ -400,8 +400,8 @@ def read_opts(cfg, args):
('BF_BUILDDIR', 'Build dir', ''),
('BF_INSTALLDIR', 'Installation dir', ''),
- ('CC', 'C compiler to use', ''),
- ('CXX', 'C++ compiler to use', ''),
+ ('CC', 'C compiler to use', env['CC']),
+ ('CXX', 'C++ compiler to use', env['CXX']),
(BoolVariable('BF_BUILDINFO', 'Buildtime in splash if true', True)),
diff --git a/tools/crossmingw.py b/tools/crossmingw.py
index ba6d4878593..f97fdf3c15e 100644
--- a/tools/crossmingw.py
+++ b/tools/crossmingw.py
@@ -50,6 +50,7 @@ prefixes = SCons.Util.Split("""
i486-mingw32msvc-
i586-mingw32msvc-
i686-mingw32msvc-
+ i686-pc-mingw32-
""")
def find(env):