[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15831] branches/blender-2.47/source: branches/blender-2.47
Diego Borghetti
bdiego at gmail.com
Mon Jul 28 04:05:45 CEST 2008
Revision: 15831
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15831
Author: bdiego
Date: 2008-07-28 04:05:44 +0200 (Mon, 28 Jul 2008)
Log Message:
-----------
branches/blender-2.47
Merge from trunk:
Revision: 15756
Revision: 15758
Revision: 15766
Revision: 15768
Revision: 15769
Revision: 15772 (Only constraint mesh-targets)
Revision: 15775
Revision: 15776
Revision: 15787
Revision: 15803
Revision: 15805
Modified Paths:
--------------
branches/blender-2.47/source/blender/blenkernel/bad_level_call_stubs/stubs.c
branches/blender-2.47/source/blender/blenkernel/intern/constraint.c
branches/blender-2.47/source/blender/blenlib/intern/arithb.c
branches/blender-2.47/source/blender/makesdna/DNA_constraint_types.h
branches/blender-2.47/source/blender/python/BPY_interface.c
branches/blender-2.47/source/blender/python/api2_2x/sceneRender.c
branches/blender-2.47/source/blender/src/buttons_object.c
branches/blender-2.47/source/blender/src/interface.c
branches/blender-2.47/source/blender/src/sequence.c
branches/blender-2.47/source/creator/creator.c
branches/blender-2.47/source/gameengine/Ketsji/KX_PyMath.h
branches/blender-2.47/source/gameengine/Ketsji/KX_TrackToActuator.cpp
Modified: branches/blender-2.47/source/blender/blenkernel/bad_level_call_stubs/stubs.c
===================================================================
--- branches/blender-2.47/source/blender/blenkernel/bad_level_call_stubs/stubs.c 2008-07-28 01:32:14 UTC (rev 15830)
+++ branches/blender-2.47/source/blender/blenkernel/bad_level_call_stubs/stubs.c 2008-07-28 02:05:44 UTC (rev 15831)
@@ -1,4 +1,3 @@
-
/**
* $Id$
*
@@ -355,7 +354,8 @@
/* editseq.c */
Sequence *get_forground_frame_seq(int frame){return 0;};
-void set_last_seq(Sequence *seq){};
+void clear_last_seq(Sequence *seq){};
+
/* modifier.c stub */
void harmonic_coordinates_bind(struct MeshDeformModifierData *mmd,
Modified: branches/blender-2.47/source/blender/blenkernel/intern/constraint.c
===================================================================
--- branches/blender-2.47/source/blender/blenkernel/intern/constraint.c 2008-07-28 01:32:14 UTC (rev 15830)
+++ branches/blender-2.47/source/blender/blenkernel/intern/constraint.c 2008-07-28 02:05:44 UTC (rev 15831)
@@ -558,8 +558,8 @@
if (dgroup < 0) return;
/* get DerivedMesh */
- if (G.obedit && G.editMesh) {
- /* we are in editmode, so get a special derived mesh */
+ if ((G.obedit == ob) && (G.editMesh)) {
+ /* target is in editmode, so get a special derived mesh */
dm = CDDM_from_editmesh(G.editMesh, ob->data);
}
else {
Modified: branches/blender-2.47/source/blender/blenlib/intern/arithb.c
===================================================================
--- branches/blender-2.47/source/blender/blenlib/intern/arithb.c 2008-07-28 01:32:14 UTC (rev 15830)
+++ branches/blender-2.47/source/blender/blenlib/intern/arithb.c 2008-07-28 02:05:44 UTC (rev 15831)
@@ -2536,11 +2536,6 @@
}
-
- /* copied from Geometry.c - todo - move to arithb.c or some other generic place we can reuse */
-#define SIDE_OF_LINE(pa,pb,pp) ((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1]))
-#define POINT_IN_TRI(p0,p1,p2,p3) ((SIDE_OF_LINE(p1,p2,p0)>=0) && (SIDE_OF_LINE(p2,p3,p0)>=0) && (SIDE_OF_LINE(p3,p1,p0)>=0))
-
/**
*
* @param min
Modified: branches/blender-2.47/source/blender/makesdna/DNA_constraint_types.h
===================================================================
--- branches/blender-2.47/source/blender/makesdna/DNA_constraint_types.h 2008-07-28 01:32:14 UTC (rev 15830)
+++ branches/blender-2.47/source/blender/makesdna/DNA_constraint_types.h 2008-07-28 02:05:44 UTC (rev 15831)
@@ -375,11 +375,13 @@
/* for objects (relative to parent/without parent influence),
* for bones (along normals of bone, without parent/restpositions)
*/
- CONSTRAINT_SPACE_LOCAL,
+ CONSTRAINT_SPACE_LOCAL, /* = 1 */
/* for posechannels - pose space */
- CONSTRAINT_SPACE_POSE,
- /* for posechannels - local with parent */
- CONSTRAINT_SPACE_PARLOCAL,
+ CONSTRAINT_SPACE_POSE, /* = 2 */
+ /* for posechannels - local with parent */
+ CONSTRAINT_SPACE_PARLOCAL, /* = 3 */
+ /* for files from between 2.43-2.46 (should have been parlocal) */
+ CONSTRAINT_SPACE_INVALID, /* = 4. do not exchange for anything! */
} B_CONSTRAINT_SPACETYPES;
/* bConstraintChannel.flag */
Modified: branches/blender-2.47/source/blender/python/BPY_interface.c
===================================================================
--- branches/blender-2.47/source/blender/python/BPY_interface.c 2008-07-28 01:32:14 UTC (rev 15830)
+++ branches/blender-2.47/source/blender/python/BPY_interface.c 2008-07-28 02:05:44 UTC (rev 15831)
@@ -417,12 +417,14 @@
mod = PyImport_ImportModule( "sys" );
if (!mod) {
printf("error: could not import python sys module. some modules may not import.\n");
+ PyGILState_Release(gilstate);
return;
}
if (!bpy_orig_syspath_List) { /* should never happen */
printf("error refershing python path\n");
Py_DECREF(mod);
+ PyGILState_Release(gilstate);
return;
}
Modified: branches/blender-2.47/source/blender/python/api2_2x/sceneRender.c
===================================================================
--- branches/blender-2.47/source/blender/python/api2_2x/sceneRender.c 2008-07-28 01:32:14 UTC (rev 15830)
+++ branches/blender-2.47/source/blender/python/api2_2x/sceneRender.c 2008-07-28 02:05:44 UTC (rev 15831)
@@ -56,6 +56,7 @@
#include "gen_utils.h"
#include "gen_library.h"
+#include "../BPY_extern.h" /* for BPY_do_all_scripts() */
#include "Scene.h"
#include "Group.h"
@@ -469,19 +470,20 @@
PyObject *RenderData_Render( BPy_RenderData * self )
{
Scene *oldsce;
+ /* unlock to prevent a deadlock when there are pynodes: */
+ PyThreadState *tstate = NULL;
if (!G.background) {
oldsce = G.scene;
set_scene( self->scene );
+ tstate = PyEval_SaveThread();
BIF_do_render( 0 );
set_scene( oldsce );
}
-
else { /* background mode (blender -b file.blend -P script) */
+ int slink_flag = 0;
Render *re= RE_NewRender(G.scene->id.name);
-
-
int end_frame = G.scene->r.efra;
if (G.scene != self->scene)
@@ -490,11 +492,25 @@
G.scene->r.efra = G.scene->r.sfra;
+ if (G.f & G_DOSCRIPTLINKS) {
+ BPY_do_all_scripts(SCRIPT_RENDER);
+ G.f &= ~G_DOSCRIPTLINKS; /* avoid FRAMECHANGED events*/
+ slink_flag = 1;
+ }
+
+ tstate = PyEval_SaveThread();
+
RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra);
+ if (slink_flag) {
+ G.f |= G_DOSCRIPTLINKS;
+ BPY_do_all_scripts(SCRIPT_POSTRENDER);
+ }
+
G.scene->r.efra = end_frame;
}
+ PyEval_RestoreThread(tstate);
Py_RETURN_NONE;
}
@@ -565,10 +581,13 @@
PyObject *RenderData_RenderAnim( BPy_RenderData * self )
{
Scene *oldsce;
-
+ /* unlock to prevent a deadlock when there are pynodes: */
+ PyThreadState *tstate = NULL;
+
if (!G.background) {
oldsce = G.scene;
set_scene( self->scene );
+ tstate = PyEval_SaveThread();
BIF_do_render( 1 );
set_scene( oldsce );
}
@@ -582,9 +601,18 @@
if (G.scene->r.sfra > G.scene->r.efra)
return EXPP_ReturnPyObjError (PyExc_RuntimeError,
"start frame must be less or equal to end frame");
-
+
+ if (G.f & G_DOSCRIPTLINKS)
+ BPY_do_all_scripts(SCRIPT_RENDER);
+
+ tstate = PyEval_SaveThread();
RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra);
+
+ if (G.f & G_DOSCRIPTLINKS)
+ BPY_do_all_scripts(SCRIPT_POSTRENDER);
}
+
+ PyEval_RestoreThread(tstate);
Py_RETURN_NONE;
}
Modified: branches/blender-2.47/source/blender/src/buttons_object.c
===================================================================
--- branches/blender-2.47/source/blender/src/buttons_object.c 2008-07-28 01:32:14 UTC (rev 15830)
+++ branches/blender-2.47/source/blender/src/buttons_object.c 2008-07-28 02:05:44 UTC (rev 15831)
@@ -480,7 +480,7 @@
/* Target-Space */
if (target == 1) {
- uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Pose Space %x3|Local with Parent %x4|Local Space %x1",
+ uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Pose Space %x2|Local with Parent %x3|Local Space %x1",
tarx, yco, bwidth, 18, &con->tarspace, 0, 0, 0, 0, "Choose space that target is evaluated in");
}
else if (target == 0) {
@@ -490,7 +490,7 @@
/* Owner-Space */
if (owner == 1) {
- uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Owner Space %t|World Space %x0|Pose Space %x3|Local with Parent %x4|Local Space %x1",
+ uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Owner Space %t|World Space %x0|Pose Space %x2|Local with Parent %x3|Local Space %x1",
ownx, yco, bwidth, 18, &con->ownspace, 0, 0, 0, 0, "Choose space that owner is evaluated in");
}
else if (owner == 0) {
Modified: branches/blender-2.47/source/blender/src/interface.c
===================================================================
--- branches/blender-2.47/source/blender/src/interface.c 2008-07-28 01:32:14 UTC (rev 15830)
+++ branches/blender-2.47/source/blender/src/interface.c 2008-07-28 02:05:44 UTC (rev 15831)
@@ -532,7 +532,7 @@
/* give butfunc the original text too */
/* feature used for bone renaming, channels, etc */
if(but->func_arg2==NULL) {
- strncpy(backstr, but->drawstr, UI_MAX_DRAW_STR);
+ strncpy(backstr, but->poin, UI_MAX_DRAW_STR);
but->func_arg2= backstr;
}
strncpy(but->poin, but_copypaste_str, but->max);
Modified: branches/blender-2.47/source/blender/src/sequence.c
===================================================================
--- branches/blender-2.47/source/blender/src/sequence.c 2008-07-28 01:32:14 UTC (rev 15830)
+++ branches/blender-2.47/source/blender/src/sequence.c 2008-07-28 02:05:44 UTC (rev 15831)
@@ -1470,8 +1470,8 @@
dy = sy;
if (seq->flag & SEQ_USE_TRANSFORM) {
- dx = seqrectx;
- dy = seqrecty;
+ dx = G.scene->r.xsch;
+ dy = G.scene->r.ysch;
}
if (c.top + c.bottom >= se->ibuf->y ||
Modified: branches/blender-2.47/source/creator/creator.c
===================================================================
--- branches/blender-2.47/source/creator/creator.c 2008-07-28 01:32:14 UTC (rev 15830)
+++ branches/blender-2.47/source/creator/creator.c 2008-07-28 02:05:44 UTC (rev 15831)
@@ -618,8 +618,23 @@
if (G.scene) {
if (a < argc) {
int frame= MIN2(MAXFRAME, MAX2(1, atoi(argv[a])));
+ int slink_flag= 0;
Render *re= RE_NewRender(G.scene->id.name);
+
+ if (G.f & G_DOSCRIPTLINKS) {
+ BPY_do_all_scripts(SCRIPT_RENDER);
+ /* avoid FRAMECHANGED slink event
+ * (should only be triggered in anims): */
+ G.f &= ~G_DOSCRIPTLINKS;
+ slink_flag= 1;
+ }
+
RE_BlenderAnim(re, G.scene, frame, frame);
+
+ if (slink_flag) {
+ G.f |= G_DOSCRIPTLINKS;
+ BPY_do_all_scripts(SCRIPT_POSTRENDER);
+ }
}
} else {
printf("\nError: no blend loaded. cannot use '-f'.\n");
@@ -628,7 +643,14 @@
case 'a':
if (G.scene) {
Render *re= RE_NewRender(G.scene->id.name);
+
+ if (G.f & G_DOSCRIPTLINKS)
+ BPY_do_all_scripts(SCRIPT_RENDER);
+
RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra);
+
+ if (G.f & G_DOSCRIPTLINKS)
+ BPY_do_all_scripts(SCRIPT_POSTRENDER);
} else {
printf("\nError: no blend loaded. cannot use '-a'.\n");
}
Modified: branches/blender-2.47/source/gameengine/Ketsji/KX_PyMath.h
===================================================================
--- branches/blender-2.47/source/gameengine/Ketsji/KX_PyMath.h 2008-07-28 01:32:14 UTC (rev 15830)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list