This commit is contained in:
Daniel Genrich 2008-05-23 20:36:05 +00:00
commit 10dde9b7d7
77 changed files with 3722 additions and 3449 deletions

@ -1 +1 @@
2.44
2.46

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 93 KiB

@ -92,10 +92,11 @@ def add_mesh_simple(name, verts, edges, faces):
ob_act.loc = cursor
me.calcNormals()
if is_editmode or Blender.Get('add_editmode'):
EditMode(1)
else: # adding in object mode means we need to calc normals
me.calcNormals()

File diff suppressed because it is too large Load Diff

@ -44,6 +44,8 @@ from flt_filewalker import FltOut
from flt_filewalker import FileFinder
from flt_properties import *
import shutil
import trace
import sys
FF = FileFinder()
records = process_recordDefs()
@ -639,20 +641,37 @@ class FLTNode(Node):
#first pass: do open faces
for vert in wireverts:
if not visited[vert] and vertuse[vert.index][1] == 1:
visited[vert] = True
loop = [vert]
othervert = edge_get_othervert(vert, disk[vert][0])
self.vertwalk(othervert, loop, disk, visited)
loop = list()
done = 0
startvert = vert
while not done:
done = 1
visited[startvert] = True
loop.append(startvert)
for edge in disk[startvert]:
othervert = edge_get_othervert(startvert, edge)
if not visited[othervert]:
done = 0
startvert = othervert
break
if len(loop) > 2: loops.append( ('Open', loop) )
for vert in wireverts:
if not visited[vert]:
visited[vert] = True
loop = [vert]
othervert = edge_get_othervert(vert,disk[vert][0])
self.vertwalk(othervert, loop, disk, visited)
loop = list()
done = 0
startvert = vert
while not done:
done = 1
visited[startvert] = True
loop.append(startvert)
for edge in disk[startvert]:
othervert = edge_get_othervert(startvert,edge)
if not visited[othervert]:
done = 0
startvert = othervert
break
if len(loop) > 2: loops.append( ('closed', loop) )
#now go through the loops and append.
for l in loops:
(ftype, loop) = l
@ -666,6 +685,8 @@ class FLTNode(Node):
face_desc.color_index = 227
self.face_lst.append(face_desc)
def sortFLTFaces(self,a,b):
aindex = a.getProperty("FLT_ORIGINDEX")
bindex = b.getProperty("FLT_ORIGINDEX")
@ -1441,6 +1462,9 @@ FLTXAPPChooser = None
FLTAttrib = None
FLTWarn = None
def setshadingangle(ID,val):
global options
options.state['shading_default'] = val
@ -1504,6 +1528,8 @@ def but_event(evt):
global FLTAttrib
global FLTWarn
#choose base path for export
if evt == 4:
Blender.Window.FileSelector(setBpath, "DB Root", options.state['basepath'])
@ -1538,8 +1564,13 @@ def but_event(evt):
#Export DB
if evt == 1:
dbexport()
try:
dbexport()
except Exception, inst:
import traceback
FLTWarn = Draw.PupBlock("Export Error", ["See console for output!"])
traceback.print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)
#exit
if evt == 2:
Draw.Exit()

@ -61,6 +61,7 @@ FLTDoXRef = None
FLTScale = None
FLTShadeImport = None
FLTAttrib = None
FLTWarn = None
Vector= Blender.Mathutils.Vector
FLOAT_TOLERANCE = 0.01
@ -890,6 +891,17 @@ class InterNode(Node):
return weldmesh
def weldFuseFaces(self,weldmesh):
#retain original loose vertices
looseverts = dict()
for vert in self.mesh.verts:
looseverts[vert] = 0
for edge in self.mesh.edges:
looseverts[edge.v1] += 1
looseverts[edge.v2] += 1
#slight modification here: we need to walk around the mesh as many times as it takes to have no more matches
done = 0
while not done:
@ -937,7 +949,7 @@ class InterNode(Node):
vertuse[vert] += 1
delverts = list()
for vert in self.mesh.verts:
if not vertuse[vert] and vert.index != 0:
if not vertuse[vert] and vert.index != 0 and looseverts[vert]:
delverts.append(vert)
self.mesh.verts.delete(delverts)
@ -2405,6 +2417,10 @@ def setBpath(fname):
def event(evt,val):
pass
from Blender.BGL import *
from Blender import Draw
def but_event(evt):
global FLTBaseLabel
@ -2418,6 +2434,8 @@ def but_event(evt):
global FLTShadeImport
global FLTAttrib
global FLTWarn
#Import DB
if evt == 1:
if global_prefs['verbose'] >= 1:
@ -2429,7 +2447,14 @@ def but_event(evt):
print
GRR = GlobalResourceRepository()
select_file(global_prefs['fltfile'], GRR)
try:
select_file(global_prefs['fltfile'], GRR)
except:
import traceback
FLTWarn = Draw.PupBlock("Export Error", ["See console for output!"])
traceback.print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)
#choose base path for export
if evt == 4:
Blender.Window.FileSelector(setBpath, "DB Root", global_prefs['fltfile'])
@ -2450,10 +2475,7 @@ def but_event(evt):
for key in global_prefs:
d[key] = global_prefs[key]
Blender.Registry.SetKey('flt_import', d, 1)
from Blender.BGL import *
from Blender import Draw
def gui():
global FLTBaseLabel

@ -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 = {}
@ -517,7 +520,7 @@ def main():
if not Draw.PupBlock('Lightmap Pack', [\
'Context...',
('Active Object', PREF_ACT_ONLY, 'If disabled, use all objects for packing the lightmap.'),\
('Active Object', PREF_ACT_ONLY, 'If disabled, include other selected objects for packing the lightmap.'),\
('Selected Faces', PREF_SEL_ONLY, 'Use only selected faces from all selected meshes.'),\
'Image & UVs...',
('Share Tex Space', PREF_PACK_IN_ONE, 'Objects Share texture space, map all objects into 1 uvmap'),\
@ -538,7 +541,7 @@ def main():
return
meshes = [ ob.getData(mesh=1) ]
else:
meshes = dict([ (me.name, me) for ob in scn.objects.context for me in (ob.getData(mesh=1),) if not me.lib])
meshes = dict([ (me.name, me) for ob in scn.objects.context if ob.type == 'Mesh' for me in (ob.getData(mesh=1),) if not me.lib if len(me.faces)])
meshes = meshes.values()
if not meshes:
Draw.PupMenu('Error%t|No mesh objects selected.')

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

@ -150,7 +150,7 @@ void add_cube(PROCESS *mbproc, int i, int j, int k, int count);
void find_first_points(PROCESS *mbproc, struct MetaBall *mb, int a);
void fill_metaball_octal_node(octal_node *node, struct MetaElem *ml, short i);
void subdivide_metaball_octal_node(octal_node *node, float *size, short depth);
void subdivide_metaball_octal_node(octal_node *node, float size_x, float size_y, float size_z, short depth);
void free_metaball_octal_node(octal_node *node);
void init_metaball_octal_tree(int depth);
void polygonize(PROCESS *mbproc, struct MetaBall *mb);

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

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

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

@ -1241,7 +1241,8 @@ void CustomData_em_copy_data(const CustomData *source, CustomData *dest,
if(dest_i >= dest->totlayer) return;
/* if we found a matching layer, copy the data */
if(dest->layers[dest_i].type == source->layers[src_i].type) {
if(dest->layers[dest_i].type == source->layers[src_i].type &&
strcmp(dest->layers[dest_i].name, source->layers[src_i].name) == 0) {
char *src_data = (char*)src_block + source->layers[src_i].offset;
char *dest_data = (char*)*dest_block + dest->layers[dest_i].offset;

@ -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 */
@ -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;
}
}

@ -990,8 +990,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';
}

@ -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;
}
}
}
@ -1709,15 +1710,13 @@ void fill_metaball_octal_node(octal_node *node, MetaElem *ml, short i)
* +------+------+
*
*/
void subdivide_metaball_octal_node(octal_node *node, float *size, short depth)
void subdivide_metaball_octal_node(octal_node *node, float size_x, float size_y, float size_z, short depth)
{
MetaElem *ml;
ml_pointer *ml_p;
float x,y,z;
int a,i;
if(depth==0) return;
/* create new nodes */
for(a=0;a<8;a++){
node->nodes[a]= MEM_mallocN(sizeof(octal_node),"octal_node");
@ -1731,45 +1730,71 @@ void subdivide_metaball_octal_node(octal_node *node, float *size, short depth)
node->nodes[a]->pos= 0;
}
size[0]/=2; size[1]/=2; size[2]/=2;
size_x /= 2;
size_y /= 2;
size_z /= 2;
/* center of node */
node->x= x= node->x_min + size[0];
node->y= y= node->y_min + size[1];
node->z= z= node->z_min + size[2];
node->x = x = node->x_min + size_x;
node->y = y = node->y_min + size_y;
node->z = z = node->z_min + size_z;
/* setting up of border points of new nodes */
node->nodes[0]->x_min= node->x_min;
node->nodes[0]->y_min= node->y_min;
node->nodes[0]->z_min= node->z_min;
node->nodes[0]->x_min = node->x_min;
node->nodes[0]->y_min = node->y_min;
node->nodes[0]->z_min = node->z_min;
node->nodes[0]->x = node->nodes[0]->x_min + size_x/2;
node->nodes[0]->y = node->nodes[0]->y_min + size_y/2;
node->nodes[0]->z = node->nodes[0]->z_min + size_z/2;
node->nodes[1]->x_min= x;
node->nodes[1]->y_min= node->y_min;
node->nodes[1]->z_min= node->z_min;
node->nodes[1]->x_min = x;
node->nodes[1]->y_min = node->y_min;
node->nodes[1]->z_min = node->z_min;
node->nodes[1]->x = node->nodes[1]->x_min + size_x/2;
node->nodes[1]->y = node->nodes[1]->y_min + size_y/2;
node->nodes[1]->z = node->nodes[1]->z_min + size_z/2;
node->nodes[2]->x_min= x;
node->nodes[2]->y_min= y;
node->nodes[2]->z_min= node->z_min;
node->nodes[2]->x_min = x;
node->nodes[2]->y_min = y;
node->nodes[2]->z_min = node->z_min;
node->nodes[2]->x = node->nodes[2]->x_min + size_x/2;
node->nodes[2]->y = node->nodes[2]->y_min + size_y/2;
node->nodes[2]->z = node->nodes[2]->z_min + size_z/2;
node->nodes[3]->x_min= node->x_min;
node->nodes[3]->y_min= y;
node->nodes[3]->z_min= node->z_min;
node->nodes[3]->x_min = node->x_min;
node->nodes[3]->y_min = y;
node->nodes[3]->z_min = node->z_min;
node->nodes[3]->x = node->nodes[3]->x_min + size_x/2;
node->nodes[3]->y = node->nodes[3]->y_min + size_y/2;
node->nodes[3]->z = node->nodes[3]->z_min + size_z/2;
node->nodes[4]->x_min= node->x_min;
node->nodes[4]->y_min= node->y_min;
node->nodes[4]->z_min= z;
node->nodes[4]->x_min = node->x_min;
node->nodes[4]->y_min = node->y_min;
node->nodes[4]->z_min = z;
node->nodes[4]->x = node->nodes[4]->x_min + size_x/2;
node->nodes[4]->y = node->nodes[4]->y_min + size_y/2;
node->nodes[4]->z = node->nodes[4]->z_min + size_z/2;
node->nodes[5]->x_min= x;
node->nodes[5]->y_min= node->y_min;
node->nodes[5]->z_min= z;
node->nodes[5]->x_min = x;
node->nodes[5]->y_min = node->y_min;
node->nodes[5]->z_min = z;
node->nodes[5]->x = node->nodes[5]->x_min + size_x/2;
node->nodes[5]->y = node->nodes[5]->y_min + size_y/2;
node->nodes[5]->z = node->nodes[5]->z_min + size_z/2;
node->nodes[6]->x_min= x;
node->nodes[6]->y_min= y;
node->nodes[6]->z_min= z;
node->nodes[6]->x_min = x;
node->nodes[6]->y_min = y;
node->nodes[6]->z_min = z;
node->nodes[6]->x = node->nodes[6]->x_min + size_x/2;
node->nodes[6]->y = node->nodes[6]->y_min + size_y/2;
node->nodes[6]->z = node->nodes[6]->z_min + size_z/2;
node->nodes[7]->x_min= node->x_min;
node->nodes[7]->y_min= y;
node->nodes[7]->z_min= z;
node->nodes[7]->x_min = node->x_min;
node->nodes[7]->y_min = y;
node->nodes[7]->z_min = z;
node->nodes[7]->x = node->nodes[7]->x_min + size_x/2;
node->nodes[7]->y = node->nodes[7]->y_min + size_y/2;
node->nodes[7]->z = node->nodes[7]->z_min + size_z/2;
ml_p= node->elems.first;
@ -1936,7 +1961,7 @@ void subdivide_metaball_octal_node(octal_node *node, float *size, short depth)
if(depth>0){
for(a=0;a<8;a++){
if(node->nodes[a]->count > 0) /* if node is not empty, then it is subdivided */
subdivide_metaball_octal_node(node->nodes[a], size, depth);
subdivide_metaball_octal_node(node->nodes[a], size_x, size_y, size_z, depth);
}
}
}
@ -2008,7 +2033,7 @@ void init_metaball_octal_tree(int depth)
size[2]= node->z_max - node->z_min;
/* first node is subdivided recursively */
subdivide_metaball_octal_node(node, size, metaball_tree->depth);
subdivide_metaball_octal_node(node, size[0], size[1], size[2], metaball_tree->depth);
}
void metaball_polygonize(Object *ob)

@ -1250,7 +1250,8 @@ static DerivedMesh *arrayModifier_applyModifier(
result = arrayModifier_doArray(amd, ob, derivedData, 0);
CDDM_calc_normals(result);
if(result != derivedData)
CDDM_calc_normals(result);
return result;
}
@ -2676,7 +2677,8 @@ static DerivedMesh *edgesplitModifier_applyModifier(
result = edgesplitModifier_do(emd, ob, derivedData);
CDDM_calc_normals(result);
if(result != derivedData)
CDDM_calc_normals(result);
return result;
}
@ -6931,8 +6933,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;

@ -1989,7 +1989,7 @@ void ntreeEndExecTree(bNodeTree *ntree)
if(ntree->threadstack) {
for(a=0; a<BLENDER_MAX_THREADS; a++) {
for(nts=ntree->threadstack[a].first; nts; nts=nts->next)
MEM_freeN(nts->stack);
if (nts->stack) MEM_freeN(nts->stack);
BLI_freelistN(&ntree->threadstack[a]);
}

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

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

@ -7380,6 +7380,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);

@ -363,6 +363,8 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la
#define B_SET_ZBLUR 1644
#define B_ADD_RENDERLAYER 1645
#define B_SET_PASS 1646
#define B_ADD_FFMPEG_VIDEO_OPTION 1647
#define B_ADD_FFMPEG_AUDIO_OPTION 1648
#define B_SEQ_BUT_PLUGIN 1691
#define B_SEQ_BUT_RELOAD 1692

@ -59,6 +59,27 @@ typedef struct bDeformGroup {
char name[32];
} bDeformGroup;
/**
* The following illustrates the orientation of the
* bounding box in local space
*
*
* Z Y
* | /
* |/
* .-----X
*
*
* 2----------6
* /| /|
* / | / |
* 1----------5 |
* | | | |
* | 3-------|--7
* | / | /
* |/ |/
* 0----------4
*/
typedef struct BoundBox {
float vec[8][3];
int flag, pad;

@ -26,7 +26,6 @@ if sys.platform != 'cygwin':
makesdna_tool.Append (CCFLAGS = cflags)
makesdna_tool.Append (CPPDEFINES = defines)
makesdna_tool.Append (LIBPATH = '#'+root_build_dir+'/lib')
makesdna_tool.Append (LINKFLAGS = env['PLATFORM_LINKFLAGS'])
if env['BF_PROFILE']:
makesdna_tool.Append (LINKFLAGS = env['BF_PROFILE_FLAGS'])

@ -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];
}

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

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

@ -919,6 +919,8 @@ static int sockoutmap_set_attr(bNodeStack **stack, short type, short idx, PyObje
int i;
short len, wanted_len;
if (!stack || !stack[idx]) return 0; /* no MaterialNode */
if (type == SOCK_VALUE) {
val = PyNumber_Float(value);
if (!val)

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

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

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

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

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

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

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

@ -177,6 +177,9 @@ void RE_DataBase_ApplyWindow(struct Render *re);
/* override the scene setting for amount threads, commandline */
void RE_set_max_threads(int threads);
/* set the render threads based on the commandline and autothreads setting */
void RE_init_threadcount(Render *re);
/* the main processor, assumes all was set OK! */
void RE_TileProcessor(struct Render *re, int firsttile, int threaded);

@ -265,7 +265,7 @@ typedef struct ObjectRen {
char (*mtface)[32];
char (*mcol)[32];
int actmtface, actmcol;
int actmtface, actmcol, bakemtface;
float obmat[4][4]; /* only used in convertblender.c, for instancing */
} ObjectRen;

@ -5417,6 +5417,9 @@ void RE_Database_Baking(Render *re, Scene *scene, int type, Object *actob)
/* renderdata setup and exceptions */
re->r= scene->r;
RE_init_threadcount(re);
re->flag |= R_GLOB_NOPUNOFLIP;
re->excludeob= actob;
if(type == RE_BAKE_LIGHT)

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

@ -459,7 +459,14 @@ void RE_SetCamera(Render *re, Object *camera)
if(cam->type==CAM_ORTHO) re->r.mode |= R_ORTHO;
/* updating these values from ipo's/drivers is handeled by the depgraph */
/* solve this too... all time depending stuff is in convertblender.c?
* Need to update the camera early because it's used for projection matrices
* and other stuff BEFORE the animation update loop is done
* */
if(cam->ipo) {
calc_ipo(cam->ipo, frame_to_float(re->r.cfra));
execute_ipo(&cam->id, cam->ipo);
}
lens= cam->lens;
shiftx=cam->shiftx;
shifty=cam->shifty;

@ -1118,11 +1118,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, int winx, int winy
/* we clip faces with a minimum of 2 pixel boundary outside of image border. see zbuf.c */
re->clipcrop= 1.0f + 2.0f/(float)(re->winx>re->winy?re->winy:re->winx);
if ((rd->mode & R_FIXED_THREADS)==0 || commandline_threads == 0) { /* Automatic threads */
re->r.threads = BLI_system_thread_count();
} else if(commandline_threads >= 1 && commandline_threads<=BLENDER_MAX_THREADS) {
re->r.threads= commandline_threads;
}
RE_init_threadcount(re);
}
}
@ -2675,3 +2671,12 @@ void RE_set_max_threads(int threads)
printf("Error, threads has to be in range 1-%d\n", BLENDER_MAX_THREADS);
}
}
void RE_init_threadcount(Render *re)
{
if ((re->r.mode & R_FIXED_THREADS)==0 || commandline_threads == 0) { /* Automatic threads */
re->r.threads = BLI_system_thread_count();
} else if(commandline_threads >= 1 && commandline_threads<=BLENDER_MAX_THREADS) {
re->r.threads= commandline_threads;
}
}

@ -2346,7 +2346,7 @@ static int get_next_bake_face(BakeShade *bs)
vlr= RE_findOrAddVlak(obr, v);
if((bs->actob && bs->actob == obr->ob) || (!bs->actob && (obr->ob->flag & SELECT))) {
tface= RE_vlakren_get_tface(obr, vlr, obr->actmtface, NULL, 0);
tface= RE_vlakren_get_tface(obr, vlr, obr->bakemtface, NULL, 0);
if(tface && tface->tpage) {
Image *ima= tface->tpage;
@ -2400,7 +2400,7 @@ static void shade_tface(BakeShade *bs)
VlakRen *vlr= bs->vlr;
ObjectInstanceRen *obi= bs->obi;
ObjectRen *obr= obi->obr;
MTFace *tface= RE_vlakren_get_tface(obr, vlr, obr->actmtface, NULL, 0);
MTFace *tface= RE_vlakren_get_tface(obr, vlr, obr->bakemtface, NULL, 0);
Image *ima= tface->tpage;
float vec[4][2];
int a, i1, i2, i3;

@ -501,6 +501,7 @@ void RE_set_customdata_names(ObjectRen *obr, CustomData *data)
if (layer->type == CD_MTFACE) {
strcpy(obr->mtface[mtfn++], layer->name);
obr->actmtface= layer->active_rnd;
obr->bakemtface= layer->active;
}
else if (layer->type == CD_MCOL) {
strcpy(obr->mcol[mcn++], layer->name);

@ -434,6 +434,8 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
shi->totuv= 0;
shi->totcol= 0;
shi->actuv= obr->actmtface;
shi->actcol= obr->actmcol;
if(mode & (MA_VERTEXCOL|MA_VERTEXCOLP)) {
for (i=0; (mcol=RE_strandren_get_mcol(obr, strand, i, &name, 0)); i++) {
@ -449,9 +451,9 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
}
if(shi->totcol) {
shi->vcol[0]= shi->col[0].col[0];
shi->vcol[1]= shi->col[0].col[1];
shi->vcol[2]= shi->col[0].col[2];
shi->vcol[0]= shi->col[shi->actcol].col[0];
shi->vcol[1]= shi->col[shi->actcol].col[1];
shi->vcol[2]= shi->col[shi->actcol].col[2];
}
else {
shi->vcol[0]= 0.0f;
@ -484,7 +486,7 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
suv->dyuv[1]= 0.0f;
}
if((mode & MA_FACETEXTURE) && i==0) {
if((mode & MA_FACETEXTURE) && i==obr->actmtface) {
if((mode & (MA_VERTEXCOL|MA_VERTEXCOLP))==0) {
shi->vcol[0]= 1.0f;
shi->vcol[1]= 1.0f;
@ -995,9 +997,9 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
if(shi->totcol) {
shi->vcol[0]= shi->col[0].col[0];
shi->vcol[1]= shi->col[0].col[1];
shi->vcol[2]= shi->col[0].col[2];
shi->vcol[0]= shi->col[shi->actcol].col[0];
shi->vcol[1]= shi->col[shi->actcol].col[1];
shi->vcol[2]= shi->col[shi->actcol].col[2];
shi->vcol[3]= 1.0f;
}
else {

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

@ -3314,7 +3314,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",
@ -5085,8 +5085,6 @@ static void editing_panel_mesh_tools1(Object *ob, Mesh *me)
uiBlockEndAlign(block);
uiDefButBitS(block, TOG, B_MESH_X_MIRROR, B_DIFF, "X-axis mirror",1125,0,150,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "While using transforms, mirrors the transformation");
uiDefButC(block, MENU, REDRAWBUTSEDIT, "Edge Alt-Select Mode%t|Loop Select%x0|Tag Edges (Seam)%x1|Tag Edges (Sharp)%x2|Tag Edges (Crease)%x3|Tag Edges (Bevel)%x4",1125,88,150,19, &G.scene->toolsettings->edge_mode, 0, 0, 0, 0, "Operation to use when Alt+RMB on edges, Use Alt+Shift+RMB to tag the shortest path from the active edge");
uiBlockBeginAlign(block);
@ -5536,7 +5534,7 @@ void sculptmode_draw_interface_tools(uiBlock *block, unsigned short cx, unsigned
uiDefButC(block,ROW,B_NOP,"Sub",cx+89,cy,89,19,&sculptmode_brush()->dir,15.0,2.0,0, 0,"Subtract depth from model [Shift]");
}
if(sd->brush_type!=GRAB_BRUSH)
uiDefButBitC(block, TOG, SCULPT_BRUSH_AIRBRUSH, 0, "Airbrush", cx+178,cy,89,19, &sculptmode_brush()->flag,0,0,0,0, "Brush makes changes without waiting for the mouse to move");
uiDefButBitC(block, TOG, SCULPT_BRUSH_AIRBRUSH, B_NOP, "Airbrush", cx+178,cy,89,19, &sculptmode_brush()->flag,0,0,0,0, "Brush makes changes without waiting for the mouse to move");
cy-= 20;
uiDefButS(block,NUMSLI,B_NOP,"Size: ",cx,cy,268,19,&sculptmode_brush()->size,1.0,200.0,0,0,"Set brush radius in pixels");
cy-= 20;
@ -5549,9 +5547,9 @@ void sculptmode_draw_interface_tools(uiBlock *block, unsigned short cx, unsigned
uiDefBut( block,LABEL,B_NOP,"Symmetry",cx,cy,90,19,NULL,0,0,0,0,"");
cy-= 20;
uiBlockBeginAlign(block);
uiDefButBitC(block, TOG, SYMM_X, 0, "X", cx,cy,40,19, &sd->symm, 0,0,0,0, "Mirror brush across X axis");
uiDefButBitC(block, TOG, SYMM_Y, 0, "Y", cx+40,cy,40,19, &sd->symm, 0,0,0,0, "Mirror brush across Y axis");
uiDefButBitC(block, TOG, SYMM_Z, 0, "Z", cx+80,cy,40,19, &sd->symm, 0,0,0,0, "Mirror brush across Z axis");
uiDefButBitC(block, TOG, SYMM_X, B_NOP, "X", cx,cy,40,19, &sd->symm, 0,0,0,0, "Mirror brush across X axis");
uiDefButBitC(block, TOG, SYMM_Y, B_NOP, "Y", cx+40,cy,40,19, &sd->symm, 0,0,0,0, "Mirror brush across Y axis");
uiDefButBitC(block, TOG, SYMM_Z, B_NOP, "Z", cx+80,cy,40,19, &sd->symm, 0,0,0,0, "Mirror brush across Z axis");
uiBlockEndAlign(block);
@ -5560,9 +5558,9 @@ void sculptmode_draw_interface_tools(uiBlock *block, unsigned short cx, unsigned
uiDefBut( block,LABEL,B_NOP,"LockAxis",cx+140,cy,90,19,NULL,0,0,0,0,"");
cy-= 20;
uiBlockBeginAlign(block);
uiDefButBitC(block, TOG, AXISLOCK_X, 0, "X", cx+140,cy,40,19, &sd->axislock, 0,0,0,0, "Constrain X axis");
uiDefButBitC(block, TOG, AXISLOCK_Y, 0, "Y", cx+180,cy,40,19, &sd->axislock, 0,0,0,0, "Constrain Y axis");
uiDefButBitC(block, TOG, AXISLOCK_Z, 0, "Z", cx+220,cy,40,19, &sd->axislock, 0,0,0,0, "Constrain Z axis");
uiDefButBitC(block, TOG, AXISLOCK_X, B_NOP, "X", cx+140,cy,40,19, &sd->axislock, 0,0,0,0, "Constrain X axis");
uiDefButBitC(block, TOG, AXISLOCK_Y, B_NOP, "Y", cx+180,cy,40,19, &sd->axislock, 0,0,0,0, "Constrain Y axis");
uiDefButBitC(block, TOG, AXISLOCK_Z, B_NOP, "Z", cx+220,cy,40,19, &sd->axislock, 0,0,0,0, "Constrain Z axis");
uiBlockEndAlign(block);
@ -5599,7 +5597,7 @@ void sculptmode_draw_interface_brush(uiBlock *block, unsigned short cx, unsigned
if(sd->brush_type == DRAW_BRUSH)
uiDefButC(block,NUM,B_NOP, "View", cx,cy,80,19, &sculptmode_brush()->view, 0,10,20,0,"Pulls brush direction towards view");
cy-= 20;
uiDefButBitC(block, TOG, SCULPT_BRUSH_ANCHORED, 0, "Anchored", cx,cy,80,19, &sculptmode_brush()->flag, 0,0,0,0, "Keep the brush center anchored to the initial location");
uiDefButBitC(block, TOG, SCULPT_BRUSH_ANCHORED, B_NOP, "Anchored", cx,cy,80,19, &sculptmode_brush()->flag, 0,0,0,0, "Keep the brush center anchored to the initial location");
uiBlockEndAlign(block);
/* Draw curve */

@ -982,7 +982,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);
@ -4172,8 +4172,9 @@ static void object_panel_particle_children(Object *ob)
uiDefButF(block, NUM, B_PART_REDRAW, "Rand:", butx+butw/2,buty,butw/2,buth, &part->childrandsize, 0.0, 1.0, 10, 1, "Random variation to the size of the child particles");
}
if(part->childtype == PART_CHILD_FACES) {
uiDefButF(block, NUM, B_PART_REDRAW, "Spread:",butx,(buty-=buth),butw/2,buth, &part->childspread, -1.0, 1.0, 10, 1, "Spread children from the faces");
uiDefButBitI(block, TOG, PART_CHILD_SEAMS, B_PART_DISTR_CHILD, "Use Seams", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Use seams to determine parents");
/* only works if children could be emitted from volume, but that option isn't available now */
/*uiDefButF(block, NUM, B_PART_REDRAW, "Spread:",butx,(buty-=buth),butw/2,buth, &part->childspread, -1.0, 1.0, 10, 1, "Spread children from the faces");*/
uiDefButBitI(block, TOG, PART_CHILD_SEAMS, B_PART_DISTR_CHILD, "Use Seams", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Use seams to determine parents");
}
uiBlockEndAlign(block);

@ -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);
}
}
@ -1404,6 +1409,8 @@ void playback_anim(void)
#ifdef WITH_FFMPEG
static void set_ffmpeg_preset(int preset);
static int ffmpeg_property_add_string(const char * type, const char * str);
static char ffmpeg_option_to_add[255] = "";
#endif
void do_render_panels(unsigned short event)
@ -1691,6 +1698,20 @@ void do_render_panels(unsigned short event)
}
allqueue(REDRAWBUTSSCENE, 0);
allqueue(REDRAWOOPS, 0);
#ifdef WITH_FFMPEG
case B_ADD_FFMPEG_AUDIO_OPTION:
if (ffmpeg_property_add_string("audio", ffmpeg_option_to_add)){
*ffmpeg_option_to_add = 0;
}
allqueue(REDRAWBUTSSCENE, 0);
break;
case B_ADD_FFMPEG_VIDEO_OPTION:
if (ffmpeg_property_add_string("video", ffmpeg_option_to_add)){
*ffmpeg_option_to_add = 0;
}
allqueue(REDRAWBUTSSCENE, 0);
break;
#endif
}
}
@ -2393,13 +2414,17 @@ static int ffmpeg_property_add_string(const char * type, const char * str)
AVCodecContext c;
const AVOption * o = 0;
const AVOption * p = 0;
char name[128];
char name_[128];
char * name;
char * param;
IDProperty * prop;
avcodec_get_context_defaults(&c);
strncpy(name, str, 128);
strncpy(name_, str, 128);
name = name_;
while (*name == ' ') name++;
param = strchr(name, ':');
@ -2664,11 +2689,27 @@ static int render_panel_ffmpeg_property_option(
static int render_panel_ffmpeg_properties(uiBlock *block, const char * type,
int xofs, int yofs)
{
short event = B_NOP;
yofs -= 5;
if (strcmp(type, "audio") == 0) {
event = B_ADD_FFMPEG_AUDIO_OPTION;
} else if (strcmp(type, "video") == 0) {
event = B_ADD_FFMPEG_VIDEO_OPTION;
}
uiDefBut(block, TEX, event, "", xofs, yofs,
170, 19, ffmpeg_option_to_add, 0.0, 255.0, 100, 0,
"FFMPEG option to add");
uiDefBut(block, BUT, event, "Add", xofs+170,yofs,
30, 19, 0, 0, 0, 0, 0,
"Add FFMPEG option");
uiDefBlockBut(block, ffmpeg_property_add_menu, (void*) type,
"Add FFMPEG Expert Option", xofs, yofs, 240, 20,
"");
"Menu", xofs + 200, yofs, 40, 20,
"Add FFMPEG option using menu");
yofs -= 20;
if (G.scene->r.ffcodecdata.properties) {

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

@ -4253,6 +4253,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) {

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

@ -55,6 +55,8 @@
#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
#include "DNA_modifier_types.h"
#include "DNA_ipo_types.h"
#include "DNA_curve_types.h"
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
@ -2971,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);
@ -2978,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;
@ -2991,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
@ -3850,7 +3856,7 @@ void unique_bone_name (bArmature *arm, char *name)
}
#define MAXBONENAME 32
/* helper call for below */
/* helper call for armature_bone_rename */
static void constraint_bone_name_fix(Object *ob, ListBase *conlist, char *oldname, char *newname)
{
bConstraint *curcon;
@ -3882,6 +3888,7 @@ static void constraint_bone_name_fix(Object *ob, ListBase *conlist, char *oldnam
void armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
{
Object *ob;
Ipo *ipo;
char newname[MAXBONENAME];
char oldname[MAXBONENAME];
@ -3905,7 +3912,7 @@ void armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
else return;
}
else {
Bone *bone= get_named_bone (arm, oldname);
Bone *bone= get_named_bone(arm, oldname);
if (bone) {
unique_bone_name (arm, newname);
@ -3914,7 +3921,7 @@ void armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
else return;
}
/* do entire dbase */
/* do entire dbase - objects */
for (ob= G.main->object.first; ob; ob= ob->id.next) {
/* we have the object using the armature */
if (arm==ob->data) {
@ -3936,7 +3943,7 @@ void armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
if (ob->pose) {
bPoseChannel *pchan = get_pose_channel(ob->pose, oldname);
if (pchan)
BLI_strncpy (pchan->name, newname, MAXBONENAME);
BLI_strncpy(pchan->name, newname, MAXBONENAME);
}
/* check all nla-strips too */
@ -3982,6 +3989,28 @@ void armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
}
}
}
/* do entire db - ipo's for the drivers */
for (ipo= G.main->ipo.first; ipo; ipo= ipo->id.next) {
IpoCurve *icu;
/* check each curve's driver */
for (icu= ipo->curve.first; icu; icu= icu->next) {
IpoDriver *icd= icu->driver;
if ((icd) && (icd->ob)) {
ob= icd->ob;
if (icu->driver->type == IPO_DRIVER_TYPE_NORMAL) {
if (!strcmp(oldname, icd->name))
BLI_strncpy(icd->name, newname, MAXBONENAME);
}
else {
/* TODO: pydrivers need to be treated differently */
}
}
}
}
}
}

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

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

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

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

@ -1588,8 +1588,7 @@ static void do_filesel_buttons(short event, SpaceFile *sfile)
BLI_strncpy(sfile->dir, butname, sizeof(sfile->dir));
/* strip the trailing slash if its a real dir */
if (strlen(butname)!=1)
butname[strlen(butname)-1]=0;
BLI_del_slash(butname);
if(sfile->type & FILE_UNIX) {
if (!BLI_exists(butname)) {
@ -1633,6 +1632,11 @@ static void do_filesel_buttons(short event, SpaceFile *sfile)
BLI_strncpy(sfile->dir, lib->filename, sizeof(sfile->dir));
BLI_make_exist(sfile->dir);
BLI_cleanup_dir(G.sce, sfile->dir);
/* forced re-reading the blend file */
if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata);
sfile->libfiledata= 0;
freefilelist(sfile);
sfile->ofs= 0;
scrarea_queue_winredraw(curarea);

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

@ -2114,7 +2114,7 @@ static int ui_act_as_text_but(uiBut *but)
static int ui_do_but_NUM(uiBut *but)
{
double value;
double value, butrange;
float deler, fstart, f, tempf, pressure;
int lvalue, temp, orig_x; /* , firsttime=1; */
short retval=0, qual, sx, mval[2], pos=0;
@ -2128,7 +2128,8 @@ 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 */
fstart= (value - but->min)/(but->max-but->min);
butrange= (but->max - but->min);
fstart= (butrange == 0.0)? 0.0f: (value - but->min)/butrange;
f= fstart;
temp= (int)value;

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

@ -438,15 +438,15 @@ void sculpt_axislock(float *co)
}
}
static void add_norm_if(const BrushAction *a, float out[3], float out_flip[3], const short no[3])
static void add_norm_if(float view_vec[3], float out[3], float out_flip[3], const short no[3])
{
float fno[3] = {no[0], no[1], no[2]};
Normalize(fno);
if((Inpf(((BrushAction*)a)->symm.out, fno)) < 0) {
if((Inpf(view_vec, fno)) > 0) {
VecAddf(out, out, fno);
} else if (out[0]==0.0 && out[1]==0.0 && out[2]==0.0) {
} else {
VecAddf(out_flip, out_flip, fno); /* out_flip is used when out is {0,0,0} */
}
}
@ -465,11 +465,11 @@ void calc_area_normal(float out[3], const BrushAction *a, const float *outdir, c
if(sculptmode_brush()->flag & SCULPT_BRUSH_ANCHORED) {
for(; node; node = node->next)
add_norm_if(a, out, out_flip, a->orig_norms[node->Index]);
add_norm_if(((BrushAction*)a)->symm.out, out, out_flip, a->orig_norms[node->Index]);
}
else {
for(; node; node = node->next)
add_norm_if(a, out, out_flip, me->mvert[node->Index].no);
add_norm_if(((BrushAction*)a)->symm.out, out, out_flip, me->mvert[node->Index].no);
}
if (out[0]==0.0 && out[1]==0.0 && out[2]==0.0) {

@ -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);
@ -1755,6 +1756,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 +1835,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);
@ -1957,6 +1960,10 @@ static TStripElem* do_handle_speed_effect(Sequence * seq, int cfra)
se = give_tstripelem(seq, cfra);
if (!se) {
return se;
}
if (cfra_left == cfra_right ||
(s->flags & SEQ_SPEED_BLEND) == 0) {
test_and_auto_discard_ibuf(se);

@ -214,7 +214,10 @@ void add_blockhandler(ScrArea *sa, short eventcode, short val)
break;
}
}
if(a==SPACE_MAXHANDLER) printf("error; max (4) blockhandlers reached!\n");
if(a==SPACE_MAXHANDLER) {
error("Only %i floating panels allowed", SPACE_MAXHANDLER-1);
}
}
void rem_blockhandler(ScrArea *sa, short eventcode)
@ -1077,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();
}
}
}
}

File diff suppressed because it is too large Load Diff

@ -314,7 +314,7 @@ short sbutton(char *var, short min, short max, char *str)
x1=mval[0]-250;
y1=mval[1]-20;
editvar = MEM_callocN(max, "sbutton");
editvar = MEM_callocN(max+1, "sbutton");
BLI_strncpy(editvar, var, max);
uiDefButC(block, TEX, 32766, str, x1+5,y1+10,225,20, editvar,(float)min,(float)max, 0, 0, "");
@ -2298,16 +2298,21 @@ void toolbox_generic( TBitem *generic_menu )
/* Add the menu */
for (menu = generic_menu; menu->icon != -1; menu++) {
if (menu->poin) {
but=uiDefIconTextBlockBut(block, tb_makemenu, menu->poin, ICON_RIGHTARROW_THIN, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, "");
uiButSetFlag(but, UI_MAKE_RIGHT);
uiButSetFunc(but, store_main, (void *)+32, (void *)ypos);
if(strcmp(menu->name, "SEPR")==0) {
uiDefBut(block, SEPR, 0, "", mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 6, NULL, 0.0, 0.0, 0, 0, "");
ypos-=6;
} else {
/* TODO - add icon support */
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, NULL, 0.0, 0.0, 0, menu->retval, "");
if (menu->poin) {
but=uiDefIconTextBlockBut(block, tb_makemenu, menu->poin, ICON_RIGHTARROW_THIN, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, "");
uiButSetFlag(but, UI_MAKE_RIGHT);
uiButSetFunc(but, store_main, (void *)+32, (void *)ypos);
} else {
/* TODO - add icon support */
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, NULL, 0.0, 0.0, 0, menu->retval, "");
}
ypos-=20;
}
ypos-=20;
}
uiBlockSetButmFunc(block, menu->poin, NULL);

@ -245,12 +245,12 @@ float InputVerticalAbsolute(TransInfo *t, short mval[2]) {
float InputDeltaAngle(TransInfo *t, short mval[2])
{
double dx2 = t->center2d[0] - mval[0];
double dy2 = t->center2d[1] - mval[1];
double dx2 = mval[0] - t->center2d[0];
double dy2 = mval[1] - t->center2d[1];
double B = sqrt(dx2*dx2+dy2*dy2);
double dx1 = t->center2d[0] - t->imval[0];
double dy1 = t->center2d[1] - t->imval[1];
double dx1 = t->imval[0] - t->center2d[0];
double dy1 = t->imval[1] - t->center2d[1];
double A = sqrt(dx1*dx1+dy1*dy1);
double dx3 = mval[0] - t->imval[0];
@ -265,6 +265,28 @@ float InputDeltaAngle(TransInfo *t, short mval[2])
dphi = saacos((float)deler);
if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi;
/* If the angle is zero, because of lack of precision close to the 1.0 value in acos
* approximate the angle with the oposite side of the normalized triangle
* This is a good approximation here since the smallest acos value seems to be around
* 0.02 degree and lower values don't even have a 0.01% error compared to the approximation
* */
if (dphi == 0)
{
double dx, dy;
dx2 /= A;
dy2 /= A;
dx1 /= B;
dy1 /= B;
dx = dx1 - dx2;
dy = dy1 - dy2;
dphi = sqrt(dx*dx + dy*dy);
if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi;
}
if(t->flag & T_SHIFT_MOD) dphi = dphi/30.0f;
@ -3326,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];
@ -3383,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);
@ -3392,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 */

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

@ -26,6 +26,7 @@
#include "MEM_guardedalloc.h"
#include "DNA_armature_types.h"
#include "DNA_curve_types.h"
#include "DNA_listBase.h"
#include "DNA_object_types.h"
@ -44,6 +45,7 @@
#include "BLI_editVert.h"
#include "BIF_editmesh.h"
#include "BIF_editarmature.h"
#include "BIF_interface.h"
#include "BIF_space.h"
#include "BIF_toolbox.h"
@ -605,6 +607,38 @@ int getTransformOrientation(float normal[3], float plane[3], int activeOnly)
result = ORIENTATION_NORMAL;
}
}
else if (G.obedit->type == OB_ARMATURE)
{
bArmature *arm = G.obedit->data;
EditBone *ebone;
for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
if (arm->layer & ebone->layer)
{
if (ebone->flag & BONE_SELECTED)
{
float vec[3];
VecSubf(vec, ebone->tail, ebone->head);
Normalize(vec);
VecAddf(normal, normal, vec);
}
}
}
Normalize(normal);
Crossf(plane, G.obedit->obmat[0], normal);
if (Inpf(plane, plane) < FLT_EPSILON)
{
Crossf(plane, G.obedit->obmat[1], normal);
}
if (plane[0] != 0 || plane[1] != 0 || plane[2] != 0)
{
result = ORIENTATION_EDGE;
}
}
Mat4Mul3Vecfl(G.obedit->obmat, plane);
Mat4Mul3Vecfl(G.obedit->obmat, normal);

@ -741,7 +741,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;

@ -368,7 +368,15 @@ public:
{
return m_bDyna;
}
/**
* Check if this object has a vertex parent relationship
*/
bool IsVertexParent( )
{
return (m_pSGNode && m_pSGNode->GetSGParent() && m_pSGNode->GetSGParent()->IsVertexParent());
}
bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data);

@ -129,6 +129,12 @@ public :
~KX_VertexParentRelation(
);
bool
IsVertexRelation(
) {
return true;
}
private :
KX_VertexParentRelation(

@ -69,13 +69,19 @@ KX_TrackToActuator::KX_TrackToActuator(SCA_IObject *gameobj,
m_upflag = upflag;
m_parentobj = 0;
if (m_object){
if (m_object)
m_object->RegisterActuator(this);
KX_GameObject* curobj = (KX_GameObject*) GetParent();
m_parentobj = curobj->GetParent(); // check if the object is parented
if (m_parentobj) { // if so, store the initial local rotation
m_parentlocalmat = m_parentobj->GetSGNode()->GetLocalOrientation();
if (gameobj->isA(&KX_GameObject::Type))
{
// if the object is vertex parented, don't check parent orientation as the link is broken
if (!((KX_GameObject*)gameobj)->IsVertexParent()){
m_parentobj = ((KX_GameObject*)gameobj)->GetParent(); // check if the object is parented
if (m_parentobj) {
// if so, store the initial local rotation
// this is needed to revert the effect of the parent inverse node (TBC)
m_parentlocalmat = m_parentobj->GetSGNode()->GetLocalOrientation();
}
}
}
@ -180,6 +186,8 @@ KX_TrackToActuator::~KX_TrackToActuator()
{
if (m_object)
m_object->UnregisterActuator(this);
if (m_parentobj)
m_parentobj->Release();
} /* end of destructor */
void KX_TrackToActuator::ProcessReplica()

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

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

@ -148,6 +148,16 @@ GetRootSGParent(
return (m_SGparent ? (const SG_Node*) m_SGparent->GetRootSGParent() : (const SG_Node*) this);
}
bool
SG_Node::
IsVertexParent()
{
if (m_parent_relation)
{
return m_parent_relation->IsVertexRelation();
}
return false;
}
void
SG_Node::

@ -152,6 +152,14 @@ public:
) ;
/**
* Return vertex parent status.
*/
bool
IsVertexParent(
) ;
/**
* Update the spatial data of this node. Iterate through
* the children of this node and update their world data.

@ -90,6 +90,15 @@ public :
NewCopy(
) = 0;
/**
* Vertex Parent Relation are special: they don't propagate rotation
*/
virtual
bool
IsVertexRelation(
) {
return false;
}
protected :
/**