Apricot Branch: svn merge -r 14875:HEAD

This commit is contained in:
2008-05-19 18:41:13 +00:00
parent 30142a3b92
commit 94028bc126
19 changed files with 3111 additions and 1926 deletions

View File

@@ -1 +1 @@
2.44
2.46

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

@@ -40,11 +40,11 @@ extern "C" {
struct ListBase;
struct MemFile;
#define BLENDER_VERSION 245
#define BLENDER_SUBVERSION 17
#define BLENDER_VERSION 246
#define BLENDER_SUBVERSION 0
#define BLENDER_MINVERSION 240
#define BLENDER_MINSUBVERSION 0
#define BLENDER_MINVERSION 245
#define BLENDER_MINSUBVERSION 15
int BKE_read_file(char *dir, void *type_r);
int BKE_read_file_from_memory(char* filebuf, int filelength, void *type_r);

View File

@@ -583,7 +583,7 @@ static void basisNurb(float t, short order, short pnts, float *knots, float *bas
/* this is for float inaccuracy */
if(t < knots[0]) t= knots[0];
else if(t > knots[opp2]) t= knots[opp2]; /* Valgrind reports an error here, use a nurbs torus and change u/v res to reproduce a crash TODO*/
else if(t > knots[opp2]) t= knots[opp2];
/* this part is order '1' */
o2 = order + 1;
@@ -1476,7 +1476,9 @@ void makeBevelList(Object *ob)
else nu= cu->nurb.first;
while(nu) {
if(nu->pntsu<=1) {
/* check we are a single point? also check we are not a surface and that the orderu is sane,
* enforced in the UI but can go wrong possibly */
if(nu->pntsu<2 || ((nu->type & 7)==CU_NURBS && nu->pntsu < nu->orderu)) {
bl= MEM_callocN(sizeof(BevList)+1*sizeof(BevPoint), "makeBevelList");
BLI_addtail(&(cu->bev), bl);
bl->nr= 0;

View File

@@ -783,7 +783,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase)
else
resolu= nu->resolu;
if(nu->pntsu<2);
if(nu->pntsu<2 || ((nu->type & 7)==CU_NURBS && nu->pntsu < nu->orderu));
else if((nu->type & 7)==CU_BEZIER) {
/* count */

View File

@@ -992,8 +992,11 @@ static void stampdata(StampData *stamp_data, int do_prefix)
}
if (G.scene->r.stamp & R_STAMP_CAMERA) {
if (do_prefix) sprintf(stamp_data->camera, "Camera %s", ((Camera *) G.scene->camera)->id.name+2);
else sprintf(stamp_data->camera, "%s", ((Camera *) G.scene->camera)->id.name+2);
if (G.scene->camera) strcpy(text, ((Camera *) G.scene->camera)->id.name+2);
else strcpy(text, "<none>");
if (do_prefix) sprintf(stamp_data->camera, "Camera %s", text);
else sprintf(stamp_data->camera, "%s", text);
} else {
stamp_data->camera[0] = '\0';
}

View File

@@ -1374,36 +1374,37 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
nz = abs((out.z - in.z)/mbproc->size);
MAXN = MAX3(nx,ny,nz);
if(MAXN!=0.0f) {
dx = (out.x - in.x)/MAXN;
dy = (out.y - in.y)/MAXN;
dz = (out.z - in.z)/MAXN;
dx = (out.x - in.x)/MAXN;
dy = (out.y - in.y)/MAXN;
dz = (out.z - in.z)/MAXN;
len = 0.0;
while(len<=max_len) {
workp.x += dx;
workp.y += dy;
workp.z += dz;
/* compute value of implicite function */
tmp_v = mbproc->function(workp.x, workp.y, workp.z);
/* add cube to the stack, when value of implicite function crosses zero value */
if((tmp_v<0.0 && workp_v>=0.0)||(tmp_v>0.0 && workp_v<=0.0)) {
len = 0.0;
while(len<=max_len) {
workp.x += dx;
workp.y += dy;
workp.z += dz;
/* compute value of implicite function */
tmp_v = mbproc->function(workp.x, workp.y, workp.z);
/* add cube to the stack, when value of implicite function crosses zero value */
if((tmp_v<0.0 && workp_v>=0.0)||(tmp_v>0.0 && workp_v<=0.0)) {
/* indexes of CUBE, which includes "first point" */
c_i= (int)floor(workp.x/mbproc->size);
c_j= (int)floor(workp.y/mbproc->size);
c_k= (int)floor(workp.z/mbproc->size);
/* add CUBE (with indexes c_i, c_j, c_k) to the stack,
* this cube includes found point of Implicit Surface */
if (ml->flag & MB_NEGATIVE)
add_cube(mbproc, c_i, c_j, c_k, 2);
else
add_cube(mbproc, c_i, c_j, c_k, 1);
}
len = sqrt((workp.x-in.x)*(workp.x-in.x) + (workp.y-in.y)*(workp.y-in.y) + (workp.z-in.z)*(workp.z-in.z));
workp_v = tmp_v;
/* indexes of CUBE, which includes "first point" */
c_i= (int)floor(workp.x/mbproc->size);
c_j= (int)floor(workp.y/mbproc->size);
c_k= (int)floor(workp.z/mbproc->size);
/* add CUBE (with indexes c_i, c_j, c_k) to the stack,
* this cube includes found point of Implicit Surface */
if (ml->flag & MB_NEGATIVE)
add_cube(mbproc, c_i, c_j, c_k, 2);
else
add_cube(mbproc, c_i, c_j, c_k, 1);
}
len = sqrt((workp.x-in.x)*(workp.x-in.x) + (workp.y-in.y)*(workp.y-in.y) + (workp.z-in.z)*(workp.z-in.z));
workp_v = tmp_v;
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -3310,7 +3310,7 @@ static void editing_panel_curve_tools(Object *ob, Curve *cu)
if(ob==G.obedit) {
nu= lastnu;
if(nu==NULL) nu= editNurb.first;
if(nu==NULL) nu= lastnu= editNurb.first;
if(nu) {
if (ob->type==OB_CURVE) {
uiDefBut(block, LABEL, 0, "Tilt",

View File

@@ -3658,6 +3658,11 @@ void delNurb()
}
}
}
/* Never allow the order to exceed the number of points */
if ((nu->type & 7)==CU_NURBS && (nu->pntsu < nu->orderu)) {
nu->orderu = nu->pntsu;
}
nu= next;
}
/* 2nd loop, delete small pieces: just for curves */
@@ -3669,7 +3674,7 @@ void delNurb()
bezt= nu->bezt;
for(a=0;a<nu->pntsu;a++) {
if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
memcpy(bezt, bezt+1, (nu->pntsu-a-1)*sizeof(BezTriple));
memmove(bezt, bezt+1, (nu->pntsu-a-1)*sizeof(BezTriple));
nu->pntsu--;
a--;
event= 1;
@@ -3690,7 +3695,7 @@ void delNurb()
for(a=0;a<nu->pntsu;a++) {
if( bp->f1 & SELECT ) {
memcpy(bp, bp+1, (nu->pntsu-a-1)*sizeof(BPoint));
memmove(bp, bp+1, (nu->pntsu-a-1)*sizeof(BPoint));
nu->pntsu--;
a--;
event= 1;
@@ -3704,6 +3709,11 @@ void delNurb()
memcpy(bp1, nu->bp, (nu->pntsu)*sizeof(BPoint) );
MEM_freeN(nu->bp);
nu->bp= bp1;
/* Never allow the order to exceed the number of points */
if ((nu->type & 7)==CU_NURBS && (nu->pntsu < nu->orderu)) {
nu->orderu = nu->pntsu;
}
}
makeknots(nu, 1, nu->flagu>>1);
}

View File

@@ -198,7 +198,7 @@ static int image_detect_file_sequence(int *start_p, int *frames_p, char *str)
unsigned short numlen;
sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
if(sfile==0)
if(sfile==NULL || sfile->filelist==NULL)
return 0;
/* find first frame */

View File

@@ -2129,7 +2129,7 @@ static int ui_do_but_NUM(uiBut *but)
sx= mval[0];
orig_x = sx; /* Store so we can scale the rate of change by the dist the mouse is from its original xlocation */
butrange= (but->max - but->min);
fstart= (butrange == 0.0)? 0.0f: value/butrange;
fstart= (butrange == 0.0)? 0.0f: (value - but->min)/butrange;
f= fstart;
temp= (int)value;

View File

@@ -1110,7 +1110,7 @@ static void poselib_preview_init_data (tPoseLib_PreviewData *pld, Object *ob, sh
return;
}
if (pld->marker == NULL) {
if ((apply_active==0) || (pld->act->markers.first)) {
if ((apply_active==0) && (pld->act->markers.first)) {
/* just use first one then... */
pld->marker= pld->act->markers.first;
printf("PoseLib had no active pose\n");

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -859,7 +859,7 @@ void viewmove(int mode)
// dist correction from other movement devices
if(dz_flag) {
if((dz_flag)||G.vd->dist==0) {
dz_flag = 0;
G.vd->dist = m_dist;
upvec[0] = upvec[1] = 0;