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:
authorDiego Borghetti <bdiego@gmail.com>2008-05-26 09:43:50 +0400
committerDiego Borghetti <bdiego@gmail.com>2008-05-26 09:43:50 +0400
commitea4470eb11fd4c4d5f29ec4ce06499cc9dfd7fe0 (patch)
tree6c8eb3295810c9f4f0beb461d03aea1a53131aab
parent4806b576a291d615412e268bf2ca7673b2dc0622 (diff)
branches/blender-2.47
Merge from trunk: Rev: 14892 Rev: 14893 Rev: 14896 Rev: 14902 Rev: 14905 Rev: 14906 Rev: 14907 Rev: 14908 Rev: 14909 Rev: 14911 Rev: 14912 Rev: 14916 Rev: 14923 Rev: 14925 Rev: 14926 Rev: 14928 Rev: 14930 Rev: 14931 Rev: 14932 Rev: 14935 Rev: 14936 Rev: 14937 Rev: 14938 Rev: 14939 Rev: 14940 Rev: 14941 Rev: 14942 Rev: 14947 Rev: 14948 Rev: 14950 Rev: 14955 Rev: 14957 Rev: 14958 Rev: 14961 Rev: 14965 Rev: 14966 Rev: 14971 Rev: 14973
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp21
-rw-r--r--release/scripts/3ds_import.py7
-rw-r--r--release/scripts/export_fbx.py4
-rw-r--r--release/scripts/flt_import.py11
-rw-r--r--release/scripts/uvcalc_lightmap.py3
-rw-r--r--source/blender/blenkernel/intern/anim.c5
-rw-r--r--source/blender/blenkernel/intern/blender.c3
-rw-r--r--source/blender/blenkernel/intern/displist.c2
-rw-r--r--source/blender/blenkernel/intern/modifier.c12
-rw-r--r--source/blender/blenkernel/intern/particle.c5
-rw-r--r--source/blender/blenkernel/intern/softbody.c5
-rw-r--r--source/blender/blenloader/intern/readfile.c1
-rw-r--r--source/blender/include/BDR_editcurve.h3
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_gamma.c3
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c21
-rw-r--r--source/blender/python/api2_2x/Draw.c25
-rw-r--r--source/blender/python/api2_2x/NLA.c24
-rw-r--r--source/blender/python/api2_2x/Window.c1
-rw-r--r--source/blender/python/api2_2x/doc/API_intro.py77
-rw-r--r--source/blender/python/api2_2x/doc/Blender.py10
-rw-r--r--source/blender/python/api2_2x/doc/Mesh.py2
-rw-r--r--source/blender/python/api2_2x/doc/NLA.py6
-rw-r--r--source/blender/python/api2_2x/doc/Render.py10
-rw-r--r--source/blender/python/api2_2x/sceneRender.c6
-rw-r--r--source/blender/render/intern/source/envmap.c8
-rw-r--r--source/blender/render/intern/source/texture.c28
-rw-r--r--source/blender/src/buttons_editing.c11
-rw-r--r--source/blender/src/buttons_object.c2
-rw-r--r--source/blender/src/buttons_scene.c5
-rw-r--r--source/blender/src/buttons_shading.c7
-rw-r--r--source/blender/src/drawarmature.c2
-rw-r--r--source/blender/src/drawobject.c1
-rw-r--r--source/blender/src/editaction.c16
-rw-r--r--source/blender/src/editarmature.c26
-rw-r--r--source/blender/src/editconstraint.c8
-rw-r--r--source/blender/src/editcurve.c66
-rw-r--r--source/blender/src/editseq.c2
-rw-r--r--source/blender/src/header_image.c19
-rw-r--r--source/blender/src/sequence.c59
-rw-r--r--source/blender/src/space.c5
-rw-r--r--source/blender/src/transform.c15
-rw-r--r--source/blender/src/transform_conversions.c10
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp5
-rw-r--r--source/gameengine/Ketsji/KX_Camera.h4
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp5
-rw-r--r--source/gameengine/PyDoc/Makefile13
-rw-r--r--source/gameengine/PyDoc/epy_docgen.sh11
-rw-r--r--source/gameengine/Rasterizer/RAS_CameraData.h5
-rw-r--r--source/gameengine/Rasterizer/RAS_IRasterizer.h1
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp6
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h1
52 files changed, 413 insertions, 203 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 230df02c359..905b2f7ac63 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -871,12 +871,25 @@ static int EnumPixelFormats(HDC hdc) {
for(i=1; i<=n; i++) { /* not the idiom, but it's right */
::DescribePixelFormat( hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd );
w = WeightPixelFormat(pfd);
- if(w > weight) {
- weight = w;
- iPixelFormat = i;
+ // be strict on stereo
+ if (!((sPreferredFormat.dwFlags ^ pfd.dwFlags) & PFD_STEREO)) {
+ if(w > weight) {
+ weight = w;
+ iPixelFormat = i;
+ }
+ }
+ }
+ if (weight == 0) {
+ // we could find the correct stereo setting, just find any suitable format
+ for(i=1; i<=n; i++) { /* not the idiom, but it's right */
+ ::DescribePixelFormat( hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd );
+ w = WeightPixelFormat(pfd);
+ if(w > weight) {
+ weight = w;
+ iPixelFormat = i;
+ }
}
}
-
return iPixelFormat;
}
diff --git a/release/scripts/3ds_import.py b/release/scripts/3ds_import.py
index 8c7c93018db..028b9633606 100644
--- a/release/scripts/3ds_import.py
+++ b/release/scripts/3ds_import.py
@@ -419,7 +419,7 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH):
ob.setMatrix(contextMatrix_rot)
importedObjects.append(ob)
-
+ bmesh.calcNormals()
for matName, faces in myContextMeshMaterials.iteritems():
makeMeshMaterialCopy(matName, faces)
@@ -664,9 +664,8 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH):
#print contextLamp.name,
elif (new_chunk.ID==OBJECT_MESH):
- ## @@ PATCH
- print 'Found an OBJECT_MESH chunk'
-
+ # print 'Found an OBJECT_MESH chunk'
+ pass
elif (new_chunk.ID==OBJECT_VERTICES):
'''
Worldspace vertex locations
diff --git a/release/scripts/export_fbx.py b/release/scripts/export_fbx.py
index 99d036b38bc..2d8859aa8fb 100644
--- a/release/scripts/export_fbx.py
+++ b/release/scripts/export_fbx.py
@@ -1101,12 +1101,12 @@ def write(filename, batch_objects = None, \
file.write('\n\t\t\tProperty: "ShadingModel", "KString", "", "%s"' % mat_shader)
file.write('\n\t\t\tProperty: "MultiLayer", "bool", "",0')
file.write('\n\t\t\tProperty: "EmissiveColor", "ColorRGB", "",%.4f,%.4f,%.4f' % mat_cold) # emit and diffuse color are he same in blender
- file.write('\n\t\t\tProperty: "EmissiveFactor", "double", "",%.4f' % mat_dif)
+ file.write('\n\t\t\tProperty: "EmissiveFactor", "double", "",%.4f' % mat_emit)
file.write('\n\t\t\tProperty: "AmbientColor", "ColorRGB", "",%.4f,%.4f,%.4f' % mat_colamb)
file.write('\n\t\t\tProperty: "AmbientFactor", "double", "",%.4f' % mat_amb)
file.write('\n\t\t\tProperty: "DiffuseColor", "ColorRGB", "",%.4f,%.4f,%.4f' % mat_cold)
- file.write('\n\t\t\tProperty: "DiffuseFactor", "double", "",%.4f' % mat_emit)
+ file.write('\n\t\t\tProperty: "DiffuseFactor", "double", "",%.4f' % mat_dif)
file.write('\n\t\t\tProperty: "Bump", "Vector3D", "",0,0,0')
file.write('\n\t\t\tProperty: "TransparentColor", "ColorRGB", "",1,1,1')
file.write('\n\t\t\tProperty: "TransparencyFactor", "double", "",%.4f' % (1.0 - mat_alpha))
diff --git a/release/scripts/flt_import.py b/release/scripts/flt_import.py
index 74cd4c036a8..f8d31f7bb57 100644
--- a/release/scripts/flt_import.py
+++ b/release/scripts/flt_import.py
@@ -16,7 +16,7 @@ This script imports OpenFlight files into Blender. OpenFlight is a
registered trademark of MultiGen-Paradigm, Inc.
Feature overview and more availible at:
-http://wiki.blender.org/index.php/Scripts/Manual/Import/openflight_flt
+http://wiki.blender.org/index.php/Scripts/Manual/Import/openflight_fltss
Note: This file is a grab-bag of old and new code. It needs some cleanup still.
"""
@@ -44,6 +44,7 @@ import BPyMesh
import BPyImage
import flt_filewalker
import flt_properties
+import sys
reload(flt_properties)
from flt_properties import *
@@ -1036,8 +1037,9 @@ class InterNode(Node):
else: # fgon
mesh_face_indicies = [i+vert_index for i in xrange(face_len)]
tri_ngons= ngon(self.mesh, mesh_face_indicies)
- new_faces.extend([ [mesh_face_indicies[t] for t in tri] for tri in tri_ngons])
- new_faces_props.extend( [ (None, image, (uvs[tri[0]], uvs[tri[1]], uvs[tri[2]]), [flt_face.uverts[tri[0]], flt_face.uverts[tri[1]], flt_face.uverts[tri[2]]], flt_face.uvlayers, flt_face.color_index, flt_face.props,FLT_OrigIndex,1, flt_face.subfacelevel) for tri in tri_ngons ])
+ if len(tri_ngons) != 1:
+ new_faces.extend([ [mesh_face_indicies[t] for t in tri] for tri in tri_ngons])
+ new_faces_props.extend( [ (None, image, (uvs[tri[0]], uvs[tri[1]], uvs[tri[2]]), [flt_face.uverts[tri[0]], flt_face.uverts[tri[1]], flt_face.uverts[tri[2]]], flt_face.uvlayers, flt_face.color_index, flt_face.props,FLT_OrigIndex,1, flt_face.subfacelevel) for tri in tri_ngons ])
vert_index+= face_len
FLT_OrigIndex+=1
@@ -2296,7 +2298,6 @@ def fixscale(root,childhash):
for v in rmesh.verts:
v.co = v.co * smat
-
def reparent(root,childhash,sce):
for child in childhash[root]:
reparent(child,childhash,sce)
@@ -2452,7 +2453,7 @@ def but_event(evt):
select_file(global_prefs['fltfile'], GRR)
except:
import traceback
- FLTWarn = Draw.PupBlock("Export Error", ["See console for output!"])
+ FLTWarn = Draw.PupBlock("Ixport Error", ["See console for output!"])
traceback.print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)
#choose base path for export
diff --git a/release/scripts/uvcalc_lightmap.py b/release/scripts/uvcalc_lightmap.py
index 8cd4960f518..5f9f88a241d 100644
--- a/release/scripts/uvcalc_lightmap.py
+++ b/release/scripts/uvcalc_lightmap.py
@@ -328,6 +328,9 @@ PREF_MARGIN_DIV= 512):
if curr_len/4 < side_len/PREF_MARGIN_DIV:
break
+ if not lengths:
+ lengths.append(curr_len)
+
# convert into ints
lengths_to_ints = {}
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 97475496865..1f8dd74a6eb 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -881,8 +881,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
if(part->draw_as==PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) {
for(go= part->dup_group->gobject.first, b=0; go; go= go->next, b++) {
-
- Mat4MulMat4(tmat, obmat, pamat);
+ Mat4MulMat4(tmat, oblist[b]->obmat, pamat);
Mat4MulFloat3((float *)tmat, size*scale);
if(par_space_mat)
Mat4MulMat4(mat, tmat, par_space_mat);
@@ -890,7 +889,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
Mat4CpyMat4(mat, tmat);
dob= new_dupli_object(lb, go->ob, mat, par->lay, counter, OB_DUPLIPARTS, animated);
- Mat4CpyMat4(dob->omat, oldobmat);
+ Mat4CpyMat4(dob->omat, obcopylist[b].obmat);
if(G.rendering)
psys_get_dupli_texture(par, part, psmd, pa, cpa, dob->uv, dob->orco);
}
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 81f496e97d6..aca51e56c6e 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -621,7 +621,8 @@ void BKE_write_undo(char *name)
}
}
-/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation */
+/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation
+ * Note, ALWAYS call sound_initialize_sounds after BKE_undo_step() */
void BKE_undo_step(int step)
{
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 3e7dd113956..aa436441056 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -1171,7 +1171,7 @@ static ModifierData *curve_get_tesselate_point(Object *ob, int forRender, int ed
if ((md->mode & required_mode) != required_mode) continue;
if (mti->isDisabled && mti->isDisabled(md)) continue;
- if (md->type==eModifierType_Hook || md->type==eModifierType_Softbody) {
+ if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
preTesselatePoint = md;
}
}
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 48635951553..b867b8d22bb 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -6850,8 +6850,16 @@ static void meshdeformModifier_do(
Mat3CpyMat4(icagemat, iobmat);
/* bind weights if needed */
- if(!mmd->bindcos)
- harmonic_coordinates_bind(mmd, vertexCos, numVerts, cagemat);
+ if(!mmd->bindcos) {
+ static int recursive = 0;
+
+ /* progress bar redraw can make this recursive .. */
+ if(!recursive) {
+ recursive = 1;
+ harmonic_coordinates_bind(mmd, vertexCos, numVerts, cagemat);
+ recursive = 0;
+ }
+ }
/* verify we have compatible weights */
totvert= numVerts;
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index fec3da752ff..18fca5439ef 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2401,8 +2401,11 @@ void psys_cache_paths(Object *ob, ParticleSystem *psys, float cfra, int editupda
psys->pathcache= cache;
}
- if(edit==NULL && psys->soft && psys->softflag & OB_SB_ENABLE)
+ if(edit==NULL && psys->soft && psys->softflag & OB_SB_ENABLE) {
soft = psys->soft;
+ if(!soft->bpoint)
+ soft= NULL;
+ }
psys->lattice = psys_get_lattice(ob, psys);
ma= give_current_material(ob, psys->part->omat);
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 768f5ff980e..9005db1312f 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -3390,8 +3390,9 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
int a;
/* update the vertex locations */
- if(sb->particles) {
+ if(sb->particles && sb->particles->totpart>0) {
psmd= psys_get_modifier(ob,sb->particles);
+
pa= sb->particles->particles;
key= pa->hair;
@@ -3434,7 +3435,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
float hairmat[4][4];
int a;
- if(sb->particles) {
+ if(sb->particles && sb->particles->totpart>0) {
psmd= psys_get_modifier(ob, sb->particles);
pa= sb->particles->particles;
key= pa->hair;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a169e756e80..1cb8b10b087 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7386,6 +7386,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* needed for proper libdata lookup */
oldnewmap_insert(fd->libmap, psys->part, psys->part, 0);
+ part->id.lib= ob->id.lib;
part->id.us--;
part->id.flag |= (ob->id.flag & LIB_NEEDLINK);
diff --git a/source/blender/include/BDR_editcurve.h b/source/blender/include/BDR_editcurve.h
index 9e25550ce04..4604359fcc9 100644
--- a/source/blender/include/BDR_editcurve.h
+++ b/source/blender/include/BDR_editcurve.h
@@ -37,6 +37,9 @@ struct BezTriple;
struct BPoint;
struct BezTripleNurb;
+void set_actNurb(struct Nurb *nu);
+struct Nurb * get_actNurb( void );
+
short isNurbsel(struct Nurb *nu);
int isNurbsel_count(struct Nurb *nu);
void printknots(void);
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
index 6cd1c5981a6..ff9e2b716ce 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
@@ -46,7 +46,8 @@ static void do_gamma(bNode *node, float *out, float *in, float *fac)
{
int i=0;
for(i=0; i<3; i++) {
- out[i] = pow(in[i],fac[0]);
+ /* check for negative to avoid nan's */
+ out[i] = (in[0] > 0.0f)? pow(in[i],fac[0]): in[0];
}
out[3] = in[3];
}
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
index 78f780c43b1..49473b213ce 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
@@ -239,6 +239,27 @@ static void node_dynamic_reset(bNode *node, int unlink_text)
tinfo = node->typeinfo;
tinfo_default = node_dynamic_find_typeinfo(&node_all_shaders, NULL);
+ if ((tinfo == tinfo_default) && unlink_text) {
+ ID *textID = node->id;
+ /* already at default (empty) state, which happens if this node's
+ * script failed to parse at the first stage: definition. We're here
+ * because its text was removed from Blender. */
+ for (ma= G.main->mat.first; ma; ma= ma->id.next) {
+ if (ma->nodetree) {
+ bNode *nd;
+ for (nd= ma->nodetree->nodes.first; nd; nd = nd->next) {
+ if (nd->id == textID) {
+ nd->id = NULL;
+ nd->custom1 = 0;
+ nd->custom1 = BSET(nd->custom1, NODE_DYNAMIC_NEW);
+ BLI_strncpy(nd->name, "Dynamic", 8);
+ return;
+ }
+ }
+ }
+ }
+ }
+
node_dynamic_rem_all_links(tinfo);
node_dynamic_free_typeinfo_sockets(tinfo);
diff --git a/source/blender/python/api2_2x/Draw.c b/source/blender/python/api2_2x/Draw.c
index cd7ec781b2b..3d4546613be 100644
--- a/source/blender/python/api2_2x/Draw.c
+++ b/source/blender/python/api2_2x/Draw.c
@@ -2063,22 +2063,22 @@ static PyObject *Method_Image( PyObject * self, PyObject * args )
/*GLfloat scissorBox[4];*/
/* parse the arguments passed-in from Python */
- if( !PyArg_ParseTuple( args, "Off|ffiiii", &pyObjImage,
+ if( !PyArg_ParseTuple( args, "O!ff|ffiiii", &Image_Type, &pyObjImage,
&originX, &originY, &zoomX, &zoomY,
&clipX, &clipY, &clipW, &clipH ) )
return EXPP_ReturnPyObjError( PyExc_TypeError,
"expected a Blender.Image and 2 floats, and " \
"optionally 2 floats and 4 ints as arguments" );
- /* check that the first PyObject is actually a Blender.Image */
- if( !BPy_Image_Check( pyObjImage ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a Blender.Image and 2 floats, and " \
- "optionally 2 floats and 4 ints as arguments" );
/* check that the zoom factors are valid */
- if( ( zoomX <= 0.0 ) || ( zoomY <= 0.0 ) )
+ if( ( zoomX < 0.0 ) || ( zoomY < 0.0 ) )
return EXPP_ReturnPyObjError( PyExc_TypeError,
- "invalid zoom factors - they must be >= 0.0" );
-
+ "invalid zoom factors - they must be > 0.0" );
+ if ((zoomX == 0.0 ) || ( zoomY == 0.0 )) {
+ /* sometimes python doubles can be converted from small values to a zero float, in this case just dont draw */
+ Py_RETURN_NONE;
+ }
+
+
/* fetch a C Image pointer from the passed-in Python object */
py_img = ( BPy_Image * ) pyObjImage;
image = py_img->image;
@@ -2101,9 +2101,9 @@ static PyObject *Method_Image( PyObject * self, PyObject * args )
* the image as they can. */
clipX = EXPP_ClampInt( clipX, 0, ibuf->x );
clipY = EXPP_ClampInt( clipY, 0, ibuf->y );
- if( ( clipW < 0 ) || ( clipW > ( ibuf->x - clipW ) ) )
+ if( ( clipW < 0 ) || ( clipX+clipW > ibuf->x ) )
clipW = ibuf->x - clipX;
- if( ( clipH < 0 ) || ( clipH > ( ibuf->y - clipH ) ) )
+ if( ( clipH < 0 ) || ( clipY+clipH > ibuf->y ) )
clipH = ibuf->y - clipY;
/* -- we are "Go" to Draw! -- */
@@ -2165,8 +2165,7 @@ static PyObject *Method_Image( PyObject * self, PyObject * args )
glPixelStorei( GL_UNPACK_SKIP_PIXELS, 0 );
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
- Py_INCREF( Py_None );
- return Py_None;
+ Py_RETURN_NONE;
}
diff --git a/source/blender/python/api2_2x/NLA.c b/source/blender/python/api2_2x/NLA.c
index 728d31398a9..cc477c7b5cf 100644
--- a/source/blender/python/api2_2x/NLA.c
+++ b/source/blender/python/api2_2x/NLA.c
@@ -803,7 +803,7 @@ static int ActionStrip_setBlendMode( BPy_ActionStrip * self, PyObject * value )
#define ACTIONSTRIP_MASK (ACTSTRIP_SELECT | ACTSTRIP_USESTRIDE \
| ACTSTRIP_HOLDLASTFRAME | ACTSTRIP_ACTIVE | ACTSTRIP_LOCK_ACTION \
- | ACTSTRIP_MUTE)
+ | ACTSTRIP_MUTE | ACTSTRIP_CYCLIC_USEX | ACTSTRIP_CYCLIC_USEY | ACTSTRIP_CYCLIC_USEZ | ACTSTRIP_AUTO_BLENDS)
static PyObject *ActionStrip_getFlag( BPy_ActionStrip * self )
{
@@ -1169,18 +1169,16 @@ static PyObject *M_ActionStrip_FlagsDict( void )
if( S ) {
BPy_constant *d = ( BPy_constant * ) S;
- PyConstant_Insert( d, "SELECT",
- PyInt_FromLong( ACTSTRIP_SELECT ) );
- PyConstant_Insert( d, "STRIDE_PATH",
- PyInt_FromLong( ACTSTRIP_USESTRIDE ) );
- PyConstant_Insert( d, "HOLD",
- PyInt_FromLong( ACTSTRIP_HOLDLASTFRAME ) );
- PyConstant_Insert( d, "ACTIVE",
- PyInt_FromLong( ACTSTRIP_ACTIVE ) );
- PyConstant_Insert( d, "LOCK_ACTION",
- PyInt_FromLong( ACTSTRIP_LOCK_ACTION ) );
- PyConstant_Insert( d, "MUTE",
- PyInt_FromLong( ACTSTRIP_MUTE ) );
+ PyConstant_Insert( d, "SELECT", PyInt_FromLong( ACTSTRIP_SELECT ) );
+ PyConstant_Insert( d, "STRIDE_PATH", PyInt_FromLong( ACTSTRIP_USESTRIDE ) );
+ PyConstant_Insert( d, "HOLD", PyInt_FromLong( ACTSTRIP_HOLDLASTFRAME ) );
+ PyConstant_Insert( d, "ACTIVE", PyInt_FromLong( ACTSTRIP_ACTIVE ) );
+ PyConstant_Insert( d, "LOCK_ACTION", PyInt_FromLong( ACTSTRIP_LOCK_ACTION ) );
+ PyConstant_Insert( d, "MUTE", PyInt_FromLong( ACTSTRIP_MUTE ) );
+ PyConstant_Insert( d, "USEX", PyInt_FromLong( ACTSTRIP_CYCLIC_USEX ) );
+ PyConstant_Insert( d, "USEY", PyInt_FromLong( ACTSTRIP_CYCLIC_USEY ) );
+ PyConstant_Insert( d, "USEZ", PyInt_FromLong( ACTSTRIP_CYCLIC_USEZ ) );
+ PyConstant_Insert( d, "AUTO_BLEND", PyInt_FromLong( ACTSTRIP_AUTO_BLENDS ) );
}
return S;
}
diff --git a/source/blender/python/api2_2x/Window.c b/source/blender/python/api2_2x/Window.c
index 061084da622..fe789fb4811 100644
--- a/source/blender/python/api2_2x/Window.c
+++ b/source/blender/python/api2_2x/Window.c
@@ -1240,6 +1240,7 @@ static PyObject *M_Window_QHandle( PyObject * self, PyObject * args )
static PyObject *M_Window_TestBreak( PyObject * self )
{
if (blender_test_break()) {
+ G.afbreek= 0;
Py_RETURN_TRUE;
} else {
Py_RETURN_FALSE;
diff --git a/source/blender/python/api2_2x/doc/API_intro.py b/source/blender/python/api2_2x/doc/API_intro.py
index ec1d42bce43..2960d8ed1d2 100644
--- a/source/blender/python/api2_2x/doc/API_intro.py
+++ b/source/blender/python/api2_2x/doc/API_intro.py
@@ -4,9 +4,7 @@
The Blender Python API Reference
================================
- An asterisk (*) means the module has been updated.
-
- for a full list of changes since 2.42 see U{http://mediawiki.blender.org/index.php/Release_Notes/Notes243/Python_API}
+ for a full list of changes since 2.45 see U{http://wiki.blender.org/index.php/Release_Notes/Notes246/Python_API}
Top Module:
-----------
@@ -16,61 +14,53 @@ The Blender Python API Reference
Submodules:
-----------
- - L{Armature} (*)
+ - L{Armature}
- L{NLA}
- L{Action<NLA.Action>}
- - L{BezTriple} (*)
+ - L{BezTriple}
- L{BGL}
- - L{Camera} (*)
- - L{Curve} (*)
- - L{Draw} (*)
+ - L{Camera}
+ - L{Curve}
+ - L{Draw}
- L{Effect}
- - L{Geometry} (*)
- - L{Group} (*)
- - L{Image} (*)
- - L{Ipo} (*)
- - L{IpoCurve} (*)
- - L{Key} (*)
+ - L{Geometry}
+ - L{Group}
+ - L{Image}
+ - L{Ipo}
+ - L{IpoCurve}
+ - L{Key}
- L{Lamp}
- - L{Lattice} (*)
- - L{Library} (*)
- - L{Material} (*)
- - L{Mathutils} (*)
- - L{Mesh} (*)
- - L{MeshPrimitives} (*)
- - L{Metaball} (*)
+ - L{Lattice}
+ - L{Library}
+ - L{Material}
+ - L{Mathutils}
+ - L{Mesh}
+ - L{MeshPrimitives}
+ - L{Metaball}
- L{NMesh} (deprecated)
- L{Noise}
- - L{Object} (*)
- - L{Modifier} (*)
- - L{Pose} (*)
- - L{Constraint} (*)
- - L{ActionStrips<NLA>} (*)
+ - L{Object}
+ - L{Modifier}
+ - L{Pose}
+ - L{Constraint}
+ - L{ActionStrips<NLA>}
- L{Particle}
- L{Registry}
- - L{Scene} (*)
+ - L{Scene}
- L{Radio}
- - L{Render} (*)
- - L{Sound} (*)
+ - L{Render}
+ - L{Sound}
- L{Text}
- L{Text3d}
- L{Font}
- - L{Texture} (*)
+ - L{Texture}
- L{TimeLine}
- L{Types}
- L{Window}
- - L{Theme} (*)
+ - L{Theme}
- L{World}
- L{sys<Sys>}
- Additional information:
- -----------------------
-
- - L{Special features<API_related>}:
- - scripts: registering in menus, documenting, configuring (new);
- - command line examples (new);
- - script links (*), space handler script links, Group module (new).
-
Introduction:
=============
@@ -226,9 +216,8 @@ A note to newbie script writers:
to get an idea of what can be done, you may be surprised.
@author: The Blender Python Team
-@requires: Blender 2.43 or newer.
-@version: 2.43
-@see: U{www.blender3d.org<http://www.blender3d.org>}: main site
+@requires: Blender 2.46 or newer.
+@version: 2.46
@see: U{www.blender.org<http://www.blender.org>}: documentation and forum
@see: U{blenderartists.org<http://blenderartists.org>}: user forum
@see: U{projects.blender.org<http://projects.blender.org>}
@@ -238,9 +227,9 @@ A note to newbie script writers:
@see: U{Blending into Python<en.wikibooks.org/wiki/Blender_3D:_Blending_Into_Python>}: User contributed documentation, featuring a blender/python cookbook with many examples.
@note: the official version of this reference guide is only updated for each
- new Blender release. But you can build the current CVS
+ new Blender release. But you can build the current SVN
version yourself: install epydoc, grab all files in the
- source/blender/python/api2_2x/doc/ folder of Blender's CVS and use the
+ source/blender/python/api2_2x/doc/ folder of Blender's SVN and use the
epy_docgen.sh script also found there to generate the html docs.
Naturally you will also need a recent Blender binary to try the new
features. If you prefer not to compile it yourself, there is a testing
diff --git a/source/blender/python/api2_2x/doc/Blender.py b/source/blender/python/api2_2x/doc/Blender.py
index 40bf9001a76..964b8f70e8b 100644
--- a/source/blender/python/api2_2x/doc/Blender.py
+++ b/source/blender/python/api2_2x/doc/Blender.py
@@ -116,6 +116,14 @@ def Get (request):
@return: The requested data or None if not found.
"""
+def GetPaths (absolute=0):
+ """
+ Returns a list of files this blend file uses: (libraries, images, sounds, fonts, sequencer movies).
+ @type absolute: bool
+ @param absolute: When true, the absolute paths of every file will be returned.
+ @return: A list for paths (strings) that this blend file uses.
+ """
+
def Redraw ():
"""
Redraw all 3D windows.
@@ -245,4 +253,4 @@ def SaveUndoState (message):
Sets an undo at the current state.
@param message: Message that appiers in the undo menu
@type message: string
- """ \ No newline at end of file
+ """
diff --git a/source/blender/python/api2_2x/doc/Mesh.py b/source/blender/python/api2_2x/doc/Mesh.py
index d8bd7be6566..4a53f869283 100644
--- a/source/blender/python/api2_2x/doc/Mesh.py
+++ b/source/blender/python/api2_2x/doc/Mesh.py
@@ -667,6 +667,8 @@ class MFaceSeq:
True, the method will return a list representing the new index for each
face in the input list. If faces are removed as duplicates, None is
inserted in place of the index.
+ @type smooth: boolean
+ @param smooth: keyword parameter (default is False). If supplied new faces will have smooth enabled.
@warning: Faces using the first vertex at the 3rd or 4th location in the
face's vertex list will have their order rotated so that the zero index
on in the first or second location in the face. When creating face data
diff --git a/source/blender/python/api2_2x/doc/NLA.py b/source/blender/python/api2_2x/doc/NLA.py
index aeb5178f3d7..0e30bfb118f 100644
--- a/source/blender/python/api2_2x/doc/NLA.py
+++ b/source/blender/python/api2_2x/doc/NLA.py
@@ -19,7 +19,11 @@ It is a bitmask and settings are ORed together.
- ACTIVE: action strip is active in NLA window
- LOCK_ACTION: action start/end are automatically mapped to strip duration
- MUTE: action strip does not contribute to the NLA solution
-
+ - USEX: Turn off automatic single-axis cycling and use X as an offset axis. Note that you can use multiple axes at once.
+ - USEY: Turn off automatic single-axis cycling and use Y as an offset axis. Note that you can use multiple axes at once.
+ - USEZ: Turn off automatic single-axis cycling and use Z as an offset axis. Note that you can use multiple axes at once.
+ - AUTO_BLEND: Automatic calculation of blend in/out values
+
@type StrideAxes: readonly dictionary
@var StrideAxes: Constant dict used by the L{ActionStrip.strideAxis} attribute.
Values are STRIDEAXIS_X, STRIDEAXIS_Y, and STRIDEAXIS_Z.
diff --git a/source/blender/python/api2_2x/doc/Render.py b/source/blender/python/api2_2x/doc/Render.py
index cf886ad27f1..475a4fc5b10 100644
--- a/source/blender/python/api2_2x/doc/Render.py
+++ b/source/blender/python/api2_2x/doc/Render.py
@@ -399,6 +399,16 @@ class RenderData:
@type bakeDist: float
@ivar bakeBias: The distance in blender units to bias faces further away from the object.
@type bakeBias: float
+ @ivar halfFloat: When enabled use 16bit floats rather then 32bit for OpenEXR files.
+ @type halfFloat: bool
+ @ivar zbuf: When enabled, save the zbuffer with an OpenEXR file
+ @type zbuf: bool
+ @ivar preview: When enabled, save a preview jpeg with an OpenEXR file
+ @type preview: bool
+ @ivar touch: Create an empty file before rendering it.
+ @type touch: bool
+ @ivar noOverwrite: Skip rendering frames when the file exists.
+ @type noOverwrite: bool
"""
def currentFrame(frame = None):
diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c
index db5ad669255..f54c2cd4e3b 100644
--- a/source/blender/python/api2_2x/sceneRender.c
+++ b/source/blender/python/api2_2x/sceneRender.c
@@ -2005,19 +2005,19 @@ static int RenderData_setIValueAttrClamp( BPy_RenderData *self, PyObject *value,
case EXPP_RENDER_ATTR_CFRAME:
min = 1;
max = MAXFRAME;
- size = 'h';
+ size = 'i';
param = &self->renderContext->cfra;
break;
case EXPP_RENDER_ATTR_EFRAME:
min = 1;
max = MAXFRAME;
- size = 'h';
+ size = 'i';
param = &self->renderContext->efra;
break;
case EXPP_RENDER_ATTR_SFRAME:
min = 1;
max = MAXFRAME;
- size = 'h';
+ size = 'i';
param = &self->renderContext->sfra;
break;
case EXPP_RENDER_ATTR_FPS:
diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c
index 12d0efa59e8..73db5c4b0be 100644
--- a/source/blender/render/intern/source/envmap.c
+++ b/source/blender/render/intern/source/envmap.c
@@ -225,7 +225,7 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode)
ObjectInstanceRen *obi;
LampRen *lar = NULL;
HaloRen *har = NULL;
- float imat[3][3], pmat[4][4], smat[4][4], tmat[4][4], cmat[3][3];
+ float imat[3][3], pmat[4][4], smat[4][4], tmat[4][4], cmat[3][3], tmpmat[4][4];
int a;
if(mode==0) {
@@ -239,8 +239,10 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode)
for(obi=re->instancetable.first; obi; obi=obi->next) {
/* append or set matrix depending on dupli */
- if(obi->flag & R_DUPLI_TRANSFORMED)
- Mat4MulMat4(obi->mat, tmat, obi->mat);
+ if(obi->flag & R_DUPLI_TRANSFORMED) {
+ Mat4CpyMat4(tmpmat, obi->mat);
+ Mat4MulMat4(obi->mat, tmat, tmpmat);
+ }
else if(mode==1)
Mat4CpyMat4(obi->mat, tmat);
else
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index 0a72f976825..27628d91465 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -1844,24 +1844,24 @@ void do_material_tex(ShadeInput *shi)
}
}
else {
+ float nor[3], dot;
+
if(shi->mat->mode & MA_TANGENT_V) {
shi->tang[0]+= Tnor*tex->norfac*texres.nor[0];
shi->tang[1]+= Tnor*tex->norfac*texres.nor[1];
shi->tang[2]+= Tnor*tex->norfac*texres.nor[2];
}
- else {
- float nor[3], dot;
- /* prevent bump to become negative normal */
- nor[0]= Tnor*tex->norfac*texres.nor[0];
- nor[1]= Tnor*tex->norfac*texres.nor[1];
- nor[2]= Tnor*tex->norfac*texres.nor[2];
-
- dot= 0.5f + 0.5f*INPR(nor, shi->vn);
-
- shi->vn[0]+= dot*nor[0];
- shi->vn[1]+= dot*nor[1];
- shi->vn[2]+= dot*nor[2];
- }
+
+ /* prevent bump to become negative normal */
+ nor[0]= Tnor*tex->norfac*texres.nor[0];
+ nor[1]= Tnor*tex->norfac*texres.nor[1];
+ nor[2]= Tnor*tex->norfac*texres.nor[2];
+
+ dot= 0.5f + 0.5f*INPR(nor, shi->vn);
+
+ shi->vn[0]+= dot*nor[0];
+ shi->vn[1]+= dot*nor[1];
+ shi->vn[2]+= dot*nor[2];
}
Normalize(shi->vn);
@@ -2525,6 +2525,8 @@ void render_realtime_texture(ShadeInput *shi, Image *ima)
ShadeInputUV *suv= &shi->uv[shi->actuv];
int a;
+ if(R.r.scemode & R_NO_TEX) return;
+
if(firsttime) {
BLI_lock_thread(LOCK_IMAGE);
if(firsttime) {
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index 592a8c1b7aa..8a37f713164 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -3071,7 +3071,6 @@ static void editing_panel_font_type(Object *ob, Curve *cu)
void do_curvebuts(unsigned short event)
{
- extern Nurb *lastnu;
extern ListBase editNurb; /* from editcurve */
Object *ob;
Curve *cu;
@@ -3147,7 +3146,7 @@ void do_curvebuts(unsigned short event)
break;
case B_SETORDER:
if(G.obedit) {
- nu= lastnu;
+ nu= get_actNurb();
if(nu && (nu->type & 7)==CU_NURBS ) {
if(nu->orderu>nu->pntsu) {
nu->orderu= nu->pntsu;
@@ -3273,7 +3272,6 @@ static void editing_panel_curve_tools(Object *ob, Curve *cu)
{
Nurb *nu;
extern ListBase editNurb; /* from editcurve */
- extern Nurb *lastnu;
uiBlock *block;
short *sp;
@@ -3309,8 +3307,11 @@ static void editing_panel_curve_tools(Object *ob, Curve *cu)
uiBlockEndAlign(block);
if(ob==G.obedit) {
- nu= lastnu;
- if(nu==NULL) nu= lastnu= editNurb.first;
+ nu= get_actNurb();
+ if(nu==NULL && editNurb.first) {
+ nu= editNurb.first;
+ set_actNurb(nu);
+ }
if(nu) {
if (ob->type==OB_CURVE) {
uiDefBut(block, LABEL, 0, "Tilt",
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c
index 409063ea5ab..fb36d103656 100644
--- a/source/blender/src/buttons_object.c
+++ b/source/blender/src/buttons_object.c
@@ -978,7 +978,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
/* IK Target */
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
+ uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco, *yco-24, 80, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
/* Draw target parameters */
uiBlockBeginAlign(block);
diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c
index feb8172d4e9..b98a8c58102 100644
--- a/source/blender/src/buttons_scene.c
+++ b/source/blender/src/buttons_scene.c
@@ -1286,6 +1286,10 @@ void do_sequencer_panels(unsigned short event)
Sequence *last_seq = get_last_seq();
ScrArea * sa;
+ if (!last_seq) {
+ return;
+ }
+
switch(event) {
case B_SEQ_BUT_PLUGIN:
case B_SEQ_BUT_EFFECT:
@@ -1323,6 +1327,7 @@ void do_sequencer_panels(unsigned short event)
allqueue(REDRAWALL, 0);
} else {
allqueue(REDRAWSEQ, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
}
}
diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c
index c6847508806..04a497ffdea 100644
--- a/source/blender/src/buttons_shading.c
+++ b/source/blender/src/buttons_shading.c
@@ -2681,7 +2681,8 @@ static void lamp_panel_spot(Object *ob, Lamp *la)
uiDefButF(block, NUM,B_LAMPREDRAW,"Soft Size", 100,80,200,19, &la->area_size, 0.01, 100.0, 10, 0, "Area light size, doesn't affect energy amount");
uiDefButS(block, NUM,0,"Samples:", 100,60,200,19, &la->ray_samp, 1.0, 16.0, 100, 0, "Sets the amount of samples taken extra (samp x samp)");
- uiDefButF(block, NUM,0,"Threshold:", 100,40,200,19, &la->adapt_thresh, 0.0, 1.0, 100, 0, "Threshold for adaptive sampling, to control what level is considered already in shadow");
+ if (la->ray_samp_method == LA_SAMP_HALTON)
+ uiDefButF(block, NUM,0,"Threshold:", 100,40,200,19, &la->adapt_thresh, 0.0, 1.0, 100, 0, "Threshold for adaptive sampling, to control what level is considered already in shadow");
}
else if (la->type == LA_AREA) {
uiDefButS(block, MENU, B_REDR, "Adaptive QMC %x1|Constant QMC %x2|Constant Jittered %x0",
@@ -2887,8 +2888,8 @@ static void lamp_panel_lamp(Object *ob, Lamp *la)
uiBlockBeginAlign(block);
if (ELEM(la->type, LA_LOCAL, LA_SPOT) && (la->falloff_type == LA_FALLOFF_SLIDERS)) {
- uiDefButF(block, NUMSLI,B_LAMPPRV,"Linear ", 120,30,180,19,&la->att1, 0.0, 1.0, 0, 0, "Set the linear distance attenuatation for a quad lamp");
- uiDefButF(block, NUMSLI,B_LAMPPRV,"Quad ", 120,10,180,19,&la->att2, 0.0, 1.0, 0, 0, "Set the quadratic distance attenuatation for a quad lamp");
+ uiDefButF(block, NUMSLI,B_LAMPPRV,"Linear ", 120,30,180,19,&la->att1, 0.0, 1.0, 0, 0, "Set the linear distance attenuation for a Lin/Quad Weighted lamp");
+ uiDefButF(block, NUMSLI,B_LAMPPRV,"Quad ", 120,10,180,19,&la->att2, 0.0, 1.0, 0, 0, "Set the quadratic distance attenuation for a Lin/Quad Weighted lamp");
}
else if(la->type==LA_AREA) {
if(la->k==0.0) la->k= 1.0;
diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c
index 99de2c1583d..73915a69139 100644
--- a/source/blender/src/drawarmature.c
+++ b/source/blender/src/drawarmature.c
@@ -1618,7 +1618,7 @@ static void draw_pose_channels(Base *base, int dt)
}
/* very very confusing... but in object mode, solid draw, we cannot do glLoadName yet,
- * stick bones and/or wire custom-shpaes are drawn in next loop
+ * stick bones and/or wire custom-shapes are drawn in next loop
*/
if ((arm->drawtype != ARM_LINE) && (draw_wire == 0)) {
/* object tag, for bordersel optim */
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index 6a0863a5b63..045b98bb784 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -4233,6 +4233,7 @@ static void draw_forcefield(Object *ob)
drawcircball(GL_LINE_LOOP, vec, size, tmat);
vec[2]= 1.5*force_val;
drawcircball(GL_LINE_LOOP, vec, size, tmat);
+ vec[2] = 0; /* reset vec for max dist circle */
}
else if (pd->forcefield == PFIELD_FORCE) {
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c
index a79fc6d6aeb..12b9cb8919f 100644
--- a/source/blender/src/editaction.c
+++ b/source/blender/src/editaction.c
@@ -2564,7 +2564,7 @@ static void select_poseelement_by_name (char *name, int select)
if ((ob==NULL) || (ob->type!=OB_ARMATURE))
return;
- if (select == 2) {
+ if (abs(select) == 2) {
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next)
pchan->bone->flag &= ~(BONE_ACTIVE);
}
@@ -3263,6 +3263,8 @@ void borderselect_actionchannels (void)
}
break;
case ACTTYPE_ACHAN: /* action channel */
+ case ACTTYPE_FILLIPO: /* expand ipo curves = action channel */
+ case ACTTYPE_FILLCON: /* expand constraint channels = action channel */
{
bActionChannel *achan= (bActionChannel *)ale->data;
@@ -3270,6 +3272,9 @@ void borderselect_actionchannels (void)
achan->flag |= ACHAN_SELECTED;
else
achan->flag &= ~ACHAN_SELECTED;
+
+ /* messy... set active bone */
+ select_poseelement_by_name(achan->name, selectmode);
}
break;
case ACTTYPE_CONCHAN: /* constraint channel */
@@ -3293,6 +3298,14 @@ void borderselect_actionchannels (void)
}
break;
}
+
+ /* select action-channel 'owner' */
+ if ((ale->owner) && (ale->ownertype == ACTTYPE_ACHAN)) {
+ bActionChannel *achano= (bActionChannel *)ale->owner;
+
+ /* messy... set active bone */
+ select_poseelement_by_name(achano->name, selectmode);
+ }
}
ymax=ymin;
@@ -3305,6 +3318,7 @@ void borderselect_actionchannels (void)
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
+ allqueue(REDRAWVIEW3D, 0);
}
}
diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c
index 788e27b814f..c166a9df762 100644
--- a/source/blender/src/editarmature.c
+++ b/source/blender/src/editarmature.c
@@ -2973,6 +2973,8 @@ void extrude_armature(int forked)
newbone->parent = ebone;
newbone->flag = ebone->flag & BONE_TIPSEL; // copies it, in case mirrored bone
+
+ if (newbone->parent) newbone->flag |= BONE_CONNECTED;
}
else {
VECCOPY(newbone->head, ebone->head);
@@ -2980,6 +2982,10 @@ void extrude_armature(int forked)
newbone->parent= ebone->parent;
newbone->flag= BONE_TIPSEL;
+
+ if (newbone->parent && ebone->flag & BONE_CONNECTED) {
+ newbone->flag |= BONE_CONNECTED;
+ }
}
newbone->weight= ebone->weight;
@@ -2993,8 +2999,6 @@ void extrude_armature(int forked)
newbone->segments= 1;
newbone->layer= ebone->layer;
- if (newbone->parent) newbone->flag |= BONE_CONNECTED;
-
BLI_strncpy (newbone->name, ebone->name, 32);
if (flipbone && forked) { // only set if mirror edit
@@ -4093,16 +4097,34 @@ void transform_armature_mirror_update(void)
if (eboflip) {
/* we assume X-axis flipping for now */
if (ebo->flag & BONE_TIPSEL) {
+ EditBone *children;
+
eboflip->tail[0]= -ebo->tail[0];
eboflip->tail[1]= ebo->tail[1];
eboflip->tail[2]= ebo->tail[2];
eboflip->rad_tail= ebo->rad_tail;
+
+ /* Also move connected children, in case children's name aren't mirrored properly */
+ for (children=G.edbo.first; children; children=children->next) {
+ if (children->parent == eboflip && children->flag & BONE_CONNECTED) {
+ VECCOPY(children->head, eboflip->tail);
+ children->rad_head = ebo->rad_tail;
+ }
+ }
}
if (ebo->flag & BONE_ROOTSEL) {
eboflip->head[0]= -ebo->head[0];
eboflip->head[1]= ebo->head[1];
eboflip->head[2]= ebo->head[2];
eboflip->rad_head= ebo->rad_head;
+
+ /* Also move connected parent, in case parent's name isn't mirrored properly */
+ if (eboflip->parent && eboflip->flag & BONE_CONNECTED)
+ {
+ EditBone *parent = eboflip->parent;
+ VECCOPY(parent->tail, eboflip->head);
+ parent->rad_tail = ebo->rad_head;
+ }
}
if (ebo->flag & BONE_SELECTED) {
eboflip->dist= ebo->dist;
diff --git a/source/blender/src/editconstraint.c b/source/blender/src/editconstraint.c
index 653e74c70b4..0ad58a5ce4b 100644
--- a/source/blender/src/editconstraint.c
+++ b/source/blender/src/editconstraint.c
@@ -681,7 +681,7 @@ static void test_constraints (Object *owner, const char substring[])
Bone *bone;
bPoseChannel *chan;
- bone = get_named_bone( ((bArmature *)owner->data ), substring );
+ bone = get_named_bone( ((bArmature *)owner->data), substring );
chan = get_pose_channel(owner->pose, substring);
if (bone && chan) {
conlist = &chan->constraints;
@@ -831,9 +831,9 @@ static void test_bonelist_constraints (Object *owner, ListBase *list)
{
Bone *bone;
- for (bone = list->first; bone; bone=bone->next) {
+ for (bone = list->first; bone; bone = bone->next) {
test_constraints(owner, bone->name);
- test_bonelist_constraints (owner, &bone->childbase);
+ test_bonelist_constraints(owner, &bone->childbase);
}
}
@@ -845,7 +845,7 @@ void object_test_constraints (Object *owner)
bArmature *arm= get_armature(owner);
if (arm)
- test_bonelist_constraints (owner, &arm->bonebase);
+ test_bonelist_constraints(owner, &arm->bonebase);
}
}
diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c
index 7572391b383..7f9ba2cb8d2 100644
--- a/source/blender/src/editcurve.c
+++ b/source/blender/src/editcurve.c
@@ -99,7 +99,7 @@
ListBase editNurb;
BPoint *lastselbp;
-Nurb *lastnu; /* for selected */
+int actnu; /* for selected */
/* void freeNurblist(ListBase *lb); already declared in the kernel */
@@ -109,6 +109,23 @@ float nurbcircle[8][2]= {
{0.0, 1.0}, { 1.0, 1.0}, { 1.0, 0.0}, { 1.0, -1.0}
};
+
+/* this replaces the active flag used in uv/face mode */
+void set_actNurb(Nurb *nu)
+{
+ if (nu==NULL) {
+ actnu = -1;
+ } else {
+ actnu = BLI_findindex(&editNurb, nu);
+ }
+}
+
+Nurb * get_actNurb( void )
+{
+ return BLI_findlink(&editNurb, actnu);
+}
+
+
/* ******************* SELECTION FUNCTIONS ********************* */
/* returns 1 in case (de)selection was successful */
@@ -325,7 +342,7 @@ void load_editNurb()
}
- lastnu= NULL; /* for selected */
+ set_actNurb(NULL);
}
void make_editNurb()
@@ -361,8 +378,7 @@ void make_editNurb()
else G.obedit= NULL;
countall();
-
- lastnu= NULL; /* for selected */
+ set_actNurb(NULL);
}
void remake_editNurb()
@@ -457,8 +473,7 @@ void separate_nurb()
countall();
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSEDIT, 0);
-
- lastnu= NULL; /* for selected */
+ set_actNurb(NULL);
}
/* ******************* FLAGS ********************* */
@@ -640,7 +655,7 @@ void deleteflagNurb(short flag)
}
if(a==0) {
BLI_remlink(&editNurb, nu);
- freeNurb(nu);
+ freeNurb(nu); nu=NULL;
}
else {
/* is nurb in U direction selected */
@@ -878,7 +893,7 @@ void adduplicateflagNurb(short flag)
newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN");
memcpy(newnu, nu, sizeof(Nurb));
BLI_addtail(&editNurb, newnu);
- lastnu= newnu;
+ set_actNurb(newnu);
newnu->pntsu= enda-starta+1;
newnu->bezt=
(BezTriple*)MEM_mallocN((enda - starta + 1) * sizeof(BezTriple), "adduplicateN");
@@ -913,7 +928,7 @@ void adduplicateflagNurb(short flag)
if(enda>=starta) {
newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN3");
memcpy(newnu, nu, sizeof(Nurb));
- lastnu= newnu;
+ set_actNurb(newnu);
BLI_addtail(&editNurb, newnu);
newnu->pntsu= enda-starta+1;
newnu->bp = (BPoint*)MEM_mallocN((enda-starta+1) * sizeof(BPoint), "adduplicateN4");
@@ -971,7 +986,7 @@ void adduplicateflagNurb(short flag)
newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN5");
memcpy(newnu, nu, sizeof(Nurb));
BLI_addtail(&editNurb, newnu);
- lastnu= newnu;
+ set_actNurb(newnu);
newnu->pntsu= newu;
newnu->pntsv= newv;
newnu->bp =
@@ -1015,7 +1030,7 @@ void adduplicateflagNurb(short flag)
nu= nu->prev;
}
- /* lastnu changed */
+ /* actnu changed */
allqueue(REDRAWBUTSEDIT, 0);
}
@@ -2481,7 +2496,7 @@ void merge_nurb()
BLI_freelistN(&nsortbase);
countall();
- lastnu= NULL;
+ set_actNurb(NULL);
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
@@ -2594,7 +2609,7 @@ void addsegment_nurb()
nu1->bezt= bezt;
nu1->pntsu+= nu2->pntsu;
BLI_remlink(&editNurb, nu2);
- freeNurb(nu2);
+ freeNurb(nu2); nu2= NULL;
calchandlesNurb(nu1);
}
else {
@@ -2632,11 +2647,11 @@ void addsegment_nurb()
}
}
}
- freeNurb(nu2);
+ freeNurb(nu2); nu2= NULL;
}
}
- lastnu= NULL; /* for selected */
+ set_actNurb(NULL); /* for selected */
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
@@ -2704,8 +2719,8 @@ void mouse_nurb()
rightmouse_transform();
- if(nu!=lastnu) {
- lastnu= nu;
+ if(nu!=get_actNurb()) {
+ set_actNurb(nu);
allqueue(REDRAWBUTSEDIT, 0);
}
@@ -3638,7 +3653,7 @@ void delNurb()
}
if(a==0) {
BLI_remlink(&editNurb, nu);
- freeNurb(nu);
+ freeNurb(nu); nu= NULL;
}
}
}
@@ -3654,13 +3669,13 @@ void delNurb()
}
if(a==0) {
BLI_remlink(&editNurb, nu);
- freeNurb(nu);
+ freeNurb(nu); nu= NULL;
}
}
}
/* Never allow the order to exceed the number of points */
- if ((nu->type & 7)==CU_NURBS && (nu->pntsu < nu->orderu)) {
+ if ((nu!= NULL) && ((nu->type & 7)==CU_NURBS) && (nu->pntsu < nu->orderu)) {
nu->orderu = nu->pntsu;
}
nu= next;
@@ -3790,7 +3805,7 @@ void delNurb()
if(bezt1) {
if(nu1->pntsu==2) { /* remove completely */
BLI_remlink(&editNurb, nu);
- freeNurb(nu);
+ freeNurb(nu); nu = NULL;
}
else if(nu1->flagu & 1) { /* cyclic */
bezt =
@@ -3832,7 +3847,7 @@ void delNurb()
else if(bp1) {
if(nu1->pntsu==2) { /* remove completely */
BLI_remlink(&editNurb, nu);
- freeNurb(nu);
+ freeNurb(nu); nu= NULL;
}
else if(nu1->flagu & 1) { /* cyclic */
bp =
@@ -4592,10 +4607,6 @@ static void undoCurve_to_editCurve(void *lbv)
{
ListBase *lb= lbv;
Nurb *nu, *newnu;
- int nr, lastnunr= 0;
-
- /* we try to restore lastnu too, for buttons */
- for(nu= editNurb.first; nu; nu = nu->next, lastnunr++) if(nu==lastnu) break;
freeNurblist(&editNurb);
@@ -4604,9 +4615,6 @@ static void undoCurve_to_editCurve(void *lbv)
newnu= duplicateNurb(nu);
BLI_addtail(&editNurb, newnu);
}
- /* restore */
- for(nr=0, lastnu= editNurb.first; lastnu; lastnu = lastnu->next, nr++) if(nr==lastnunr) break;
-
}
static void *editCurve_to_undoCurve(void)
diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c
index 50bd4d7c7f3..bb706f1aa3f 100644
--- a/source/blender/src/editseq.c
+++ b/source/blender/src/editseq.c
@@ -2890,7 +2890,7 @@ void enter_meta(void)
ed= G.scene->ed;
if(ed==0) return;
- if(last_seq==0 || last_seq->type!=SEQ_META || last_seq->flag==0) {
+ if(last_seq==0 || last_seq->type!=SEQ_META || (last_seq->flag & SELECT)==0) {
exit_meta();
return;
}
diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c
index 341cce30c4e..7ac57cb839b 100644
--- a/source/blender/src/header_image.c
+++ b/source/blender/src/header_image.c
@@ -245,9 +245,24 @@ void do_image_buttons(unsigned short event)
break;
}
case B_SIMACLONEBROWSE:
- if (settings->imapaint.brush)
- if (brush_clone_image_set_nr(settings->imapaint.brush, G.sima->menunr))
+ if(settings->imapaint.brush) {
+ Brush *brush= settings->imapaint.brush;
+
+ if(G.sima->menunr== -2) {
+ if(G.qual & LR_CTRLKEY) {
+ activate_databrowse_imasel((ID *)brush->clone.image, ID_IM, 0, B_SIMACLONEBROWSE,
+ &G.sima->menunr, do_image_buttons);
+ } else {
+ activate_databrowse((ID *)brush->clone.image, ID_IM, 0, B_SIMACLONEBROWSE,
+ &G.sima->menunr, do_image_buttons);
+ }
+ break;
+ }
+ if(G.sima->menunr < 0) break;
+
+ if(brush_clone_image_set_nr(brush, G.sima->menunr))
allqueue(REDRAWIMAGE, 0);
+ }
break;
case B_SIMACLONEDELETE:
diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c
index 5bcb521988b..bf519dd6e9c 100644
--- a/source/blender/src/sequence.c
+++ b/source/blender/src/sequence.c
@@ -1452,6 +1452,7 @@ static void input_preprocess(Sequence * seq, TStripElem* se, int cfra)
if(seq->flag & SEQ_USE_CROP || seq->flag & SEQ_USE_TRANSFORM) {
StripCrop c;
StripTransform t;
+ int sx,sy,dx,dy;
memset(&c, 0, sizeof(StripCrop));
memset(&t, 0, sizeof(StripTransform));
@@ -1463,22 +1464,22 @@ static void input_preprocess(Sequence * seq, TStripElem* se, int cfra)
t = *seq->strip->transform;
}
+ sx = se->ibuf->x - c.left - c.right;
+ sy = se->ibuf->y - c.top - c.bottom;
+ dx = sx;
+ dy = sy;
+
+ if (seq->flag & SEQ_USE_TRANSFORM) {
+ dx = seqrectx;
+ dy = seqrecty;
+ }
+
if (c.top + c.bottom >= se->ibuf->y ||
c.left + c.right >= se->ibuf->x ||
- t.xofs >= se->ibuf->x ||
- t.yofs >= se->ibuf->y) {
+ t.xofs >= dx || t.yofs >= dy) {
make_black_ibuf(se->ibuf);
} else {
ImBuf * i;
- int sx = se->ibuf->x - c.left - c.right;
- int sy = se->ibuf->y - c.top - c.bottom;
- int dx = sx;
- int dy = sy;
-
- if (seq->flag & SEQ_USE_TRANSFORM) {
- dx = seqrectx;
- dy = seqrecty;
- }
if (se->ibuf->rect_float) {
i = IMB_allocImBuf(dx, dy,32, IB_rectfloat, 0);
@@ -1631,6 +1632,36 @@ static void copy_to_ibuf_still(Sequence * seq, TStripElem * se)
}
}
+static void free_metastrip_imbufs(ListBase *seqbasep, int cfra, int chanshown)
+{
+ Sequence* seq_arr[MAXSEQ+1];
+ int i;
+ TStripElem* se = 0;
+
+ evaluate_seq_frame_gen(seq_arr, seqbasep, cfra);
+
+ for (i = 0; i < MAXSEQ; i++) {
+ if (!video_seq_is_rendered(seq_arr[i])) {
+ continue;
+ }
+ se = give_tstripelem(seq_arr[i], cfra);
+ if (se) {
+ if (se->ibuf) {
+ IMB_freeImBuf(se->ibuf);
+
+ se->ibuf= 0;
+ se->ok= STRIPELEM_OK;
+ }
+
+ if (se->ibuf_comp) {
+ IMB_freeImBuf(se->ibuf_comp);
+
+ se->ibuf_comp = 0;
+ }
+ }
+ }
+
+}
static TStripElem* do_build_seq_array_recursively(
ListBase *seqbasep, int cfra, int chanshown);
@@ -1681,6 +1712,10 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra,
use_limiter = TRUE;
}
}
+ if (meta_se) {
+ free_metastrip_imbufs(
+ &seq->seqbase, seq->start + se->nr, 0);
+ }
if (use_limiter) {
input_preprocess(seq, se, cfra);
@@ -1755,6 +1790,7 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra,
}
} else if(seq->type == SEQ_SCENE) { // scene can be NULL after deletions
int oldcfra = CFRA;
+ Sequence * oldseq = get_last_seq();
Scene *sce= seq->scene, *oldsce= G.scene;
Render *re;
RenderResult rres;
@@ -1833,6 +1869,7 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra,
if((G.f & G_PLAYANIM)==0) /* bad, is set on do_render_seq */
waitcursor(0);
CFRA = oldcfra;
+ set_last_seq(oldseq);
copy_to_ibuf_still(seq, se);
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 1d07bfbe22a..47e3387755b 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -1080,7 +1080,10 @@ void BIF_undo_menu(void)
if(menu) {
short event= pupmenu_col(menu, 20);
MEM_freeN(menu);
- if(event>0) BKE_undo_number(event);
+ if(event>0) {
+ BKE_undo_number(event);
+ sound_initialize_sounds();
+ }
}
}
}
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c
index b462422a408..10035c61651 100644
--- a/source/blender/src/transform.c
+++ b/source/blender/src/transform.c
@@ -3348,8 +3348,17 @@ void initBevel(TransInfo *t)
{
t->mode = TFM_BEVEL;
t->flag |= T_NO_CONSTRAINT;
+ t->num.flag |= NUM_NO_NEGATIVE;
t->transform = Bevel;
t->handleEvent = handleEventBevel;
+
+ t->idx_max = 0;
+ t->num.idx_max = 0;
+ t->snap[0] = 0.0f;
+ t->snap[1] = 0.1f;
+ t->snap[2] = t->snap[1] * 0.1f;
+
+ /* DON'T KNOW WHY THIS IS NEEDED */
if (G.editBMesh->imval[0] == 0 && G.editBMesh->imval[1] == 0) {
/* save the initial mouse co */
G.editBMesh->imval[0] = t->imval[0];
@@ -3405,6 +3414,10 @@ int Bevel(TransInfo *t, short mval[2])
mode = (G.editBMesh->options & BME_BEVEL_VERT) ? "verts only" : "normal";
distance = InputHorizontalAbsolute(t, mval)/4; /* 4 just seemed a nice value to me, nothing special */
+
+ distance = fabs(distance);
+
+ snapGrid(t, &distance);
applyNumInput(&t->num, &distance);
@@ -3414,7 +3427,7 @@ int Bevel(TransInfo *t, short mval[2])
outputNumInput(&(t->num), c);
- sprintf(str, "Bevel: %s", c);
+ sprintf(str, "Bevel - Dist: %s, Mode: %s (MMB to toggle))", c, mode);
}
else {
/* default header print */
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c
index 963a1027f28..f69218664ea 100644
--- a/source/blender/src/transform_conversions.c
+++ b/source/blender/src/transform_conversions.c
@@ -3140,6 +3140,7 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
ListBase fakecons = {NULL, NULL};
float obmtx[3][3];
short constinv;
+ short skip_invert = 0;
/* axismtx has the real orientation */
Mat3CpyMat4(td->axismtx, ob->obmat);
@@ -3152,8 +3153,13 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
* inverse correction to stop it from screwing up space conversion
* matrix later
*/
- constinv= constraints_list_needinv(t, &ob->constraints);
- if (ob->track || constinv==0) {
+ constinv = constraints_list_needinv(t, &ob->constraints);
+
+ /* disable constraints inversion for dummy pass */
+ if (t->mode == TFM_DUMMY)
+ skip_invert = 1;
+
+ if (skip_invert == 0 && (ob->track || constinv==0)) {
track= ob->track;
ob->track= NULL;
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 089af9a68e7..82d16ffa181 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -87,6 +87,7 @@
#include "DNA_action_types.h"
#include "BKE_main.h"
#include "BKE_global.h"
+#include "BKE_object.h"
#include "BL_SkinMeshObject.h"
#include "BL_SkinDeformer.h"
#include "BL_MeshDeformer.h"
@@ -1571,8 +1572,9 @@ static KX_LightObject *gamelight_from_blamp(Lamp *la, unsigned int layerflag, KX
return gamelight;
}
-static KX_Camera *gamecamera_from_bcamera(Camera *ca, KX_Scene *kxscene, KX_BlenderSceneConverter *converter) {
- RAS_CameraData camdata(ca->lens, ca->clipsta, ca->clipend, ca->type == CAM_PERSP);
+static KX_Camera *gamecamera_from_bcamera(Object *ob, KX_Scene *kxscene, KX_BlenderSceneConverter *converter) {
+ Camera* ca = static_cast<Camera*>(ob->data);
+ RAS_CameraData camdata(ca->lens, ca->clipsta, ca->clipend, ca->type == CAM_PERSP, dof_camera(ob));
KX_Camera *gamecamera;
gamecamera= new KX_Camera(kxscene, KX_Scene::m_callbacks, camdata);
@@ -1607,7 +1609,7 @@ static KX_GameObject *gameobject_from_blenderobject(
case OB_CAMERA:
{
- KX_Camera* gamecamera = gamecamera_from_bcamera(static_cast<Camera*>(ob->data), kxscene, converter);
+ KX_Camera* gamecamera = gamecamera_from_bcamera(ob, kxscene, converter);
gameobj = gamecamera;
//don't add a reference: the camera list in kxscene->m_cameras is not released at the end
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index 09eb2053bfe..27e47d72bbe 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -204,6 +204,11 @@ float KX_Camera::GetCameraFar() const
return m_camdata.m_clipend;
}
+float KX_Camera::GetFocalLength() const
+{
+ return m_camdata.m_focallength;
+}
+
RAS_CameraData* KX_Camera::GetCameraData()
diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h
index 4cc8c049f91..75d574cd697 100644
--- a/source/gameengine/Ketsji/KX_Camera.h
+++ b/source/gameengine/Ketsji/KX_Camera.h
@@ -184,12 +184,14 @@ public:
*/
const MT_Matrix4x4& GetModelviewMatrix() const;
- /** Gets the focal length. */
+ /** Gets the aperture. */
float GetLens() const;
/** Gets the near clip distance. */
float GetCameraNear() const;
/** Gets the far clip distance. */
float GetCameraFar() const;
+ /** Gets the focal length (only used for stereo rendering) */
+ float GetFocalLength() const;
/** Gets all camera data. */
RAS_CameraData* GetCameraData();
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index c098f37efa8..1e3393d59a8 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -890,7 +890,7 @@ void KX_KetsjiEngine::SetupRenderFrame(KX_Scene *scene, KX_Camera* cam)
// update graphics
void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam)
{
- float left, right, bottom, top, nearfrust, farfrust;
+ float left, right, bottom, top, nearfrust, farfrust, focallength;
const float ortho = 100.0;
// KX_Camera* cam = scene->GetActiveCamera();
@@ -913,6 +913,7 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam)
float lens = cam->GetLens();
nearfrust = cam->GetCameraNear();
farfrust = cam->GetCameraFar();
+ focallength = cam->GetFocalLength();
if (!cam->GetCameraData()->m_perspective)
{
@@ -939,7 +940,7 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam)
farfrust = frustum.camfar;
MT_Matrix4x4 projmat = m_rasterizer->GetFrustumMatrix(
- left, right, bottom, top, nearfrust, farfrust);
+ left, right, bottom, top, nearfrust, farfrust, focallength);
cam->SetProjectionMatrix(projmat);
diff --git a/source/gameengine/PyDoc/Makefile b/source/gameengine/PyDoc/Makefile
deleted file mode 100644
index 7861894ddec..00000000000
--- a/source/gameengine/PyDoc/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-SOURCES=$(shell ls *.py)
-TARGETS:=$(SOURCES:.py=.html)
-PYDOC=/usr/lib/python2.2/pydoc.py
-
-all: $(SOURCES)
- epydoc -o BPY_GE_236 --url "http://www.blender.org" -t GameLogic.py \
- -n "Blender GameEngine" --no-private --no-frames \
- $(shell ls *.py )
-
-clean:
- rm *.html
diff --git a/source/gameengine/PyDoc/epy_docgen.sh b/source/gameengine/PyDoc/epy_docgen.sh
new file mode 100644
index 00000000000..7fb5e49c996
--- /dev/null
+++ b/source/gameengine/PyDoc/epy_docgen.sh
@@ -0,0 +1,11 @@
+# epy_docgen.sh
+# generates blender python doc using epydoc
+# requires epydoc in your PATH.
+# run from the doc directory containing the .py files
+# usage: sh epy_docgen.sh
+
+# set posix locale so regex works properly for [A-Z]*.py
+LC_ALL=POSIX
+
+epydoc -v -o BPY_GE --url "http://www.blender.org" --top GameLogic \
+ --name "Blender GameEngine" --no-private --no-frames *.py
diff --git a/source/gameengine/Rasterizer/RAS_CameraData.h b/source/gameengine/Rasterizer/RAS_CameraData.h
index 99c0c412cf7..6aa9b34962b 100644
--- a/source/gameengine/Rasterizer/RAS_CameraData.h
+++ b/source/gameengine/Rasterizer/RAS_CameraData.h
@@ -40,13 +40,16 @@ struct RAS_CameraData
int m_viewportbottom;
int m_viewportright;
int m_viewporttop;
+ float m_focallength;
RAS_CameraData(float lens = 35., float clipstart = 0.1, float clipend = 100., bool perspective = true,
- bool viewport = false, int viewportleft = 0, int viewportbottom = 0, int viewportright = 0, int viewporttop = 0) :
+ float focallength = 0.0f, bool viewport = false, int viewportleft = 0, int viewportbottom = 0,
+ int viewportright = 0, int viewporttop = 0) :
m_lens(lens),
m_clipstart(clipstart),
m_clipend(clipend),
m_perspective(perspective),
+ m_focallength(focallength),
m_viewport(viewport),
m_viewportleft(viewportleft),
m_viewportbottom(viewportbottom),
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index 5e8b5ad8276..18a7f261c94 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -344,6 +344,7 @@ public:
float top,
float frustnear,
float frustfar,
+ float focallength = 0.0f,
bool perspective = true
)=0;
/**
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index ea41b2f7d13..f99121e5b7c 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -1802,6 +1802,7 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix(
float top,
float frustnear,
float frustfar,
+ float focallength,
bool
){
MT_Matrix4x4 result;
@@ -1813,9 +1814,10 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix(
float near_div_focallength;
// next 2 params should be specified on command line and in Blender publisher
if (!m_setfocallength)
- m_focallength = 1.5 * right; // derived from example
+ m_focallength = (focallength == 0.f) ? 1.5 * right // derived from example
+ : focallength;
if (!m_seteyesep)
- m_eyeseparation = 0.18 * right; // just a guess...
+ m_eyeseparation = m_focallength/30; // reasonable value...
near_div_focallength = frustnear / m_focallength;
switch(m_curreye)
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
index c63a7b80b7c..23714a12151 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
@@ -246,6 +246,7 @@ public:
float top,
float frustnear,
float frustfar,
+ float focallength,
bool perspective
);