branches/2-44-stable

Merge from trunk:

revision 11187:11188
	removed "btHingeConstraint::" prefix, in btHingeConstraint::btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,btVector3& axisInA);
    Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11188

revision 11196:11197
    Bug #6924: Add WITH_FFMPEG compilation switch when WITH_BF_FFMPEG is true for scons.
    Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11197

revision 11197:11198
	Was a missing -DWITH_FFMPEG here so I added it.
    Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11198

revision 10754:10755
	ID Property Fix.
    Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10755

revision 11199:11200
	ID Property Fix.
    Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11200

revision 11201:11202 (BugFix #6900)
    Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11202

revision 11223:11224
    Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11224

revision 11224:11225
    Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11225

revision 11225:11226 (BugFix: #6931)
    Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11226

revision 11230:11231
    Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11231

revision 11232:11233
    Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11233
This commit is contained in:
Diego Borghetti 2007-07-12 04:56:00 +00:00
parent 8bde36ca54
commit 82ac965d4f
13 changed files with 140 additions and 77 deletions

View File

@ -60,7 +60,7 @@ public:
btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB, btVector3& axisInA,btVector3& axisInB);
btHingeConstraint::btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,btVector3& axisInA);
btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,btVector3& axisInA);
btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btTransform& rbAFrame, const btTransform& rbBFrame);

View File

@ -78,6 +78,11 @@ void IDP_LinkID(struct IDProperty *prop, ID *id);
void IDP_UnlinkID(struct IDProperty *prop);
/*-------- Group Functions -------*/
/*checks if a property with the same name as prop exists, and if so replaces it.
Use this to preserve order!*/
void IDP_ReplaceInGroup(struct IDProperty *group, struct IDProperty *prop);
/*
This function has a sanity check to make sure ID properties with the same name don't
get added to the group.
@ -132,6 +137,7 @@ void IDP_FreeIterBeforeEnd(void *vself);
to create the Group property and attach it to id if it doesn't exist; otherwise
the function will return NULL if there's no Group property attached to the ID.*/
struct IDProperty *IDP_GetProperties(struct ID *id, int create_if_needed);
struct IDProperty *IDP_CopyProperty(struct IDProperty *prop);
/*
Allocate a new ID.

View File

@ -255,7 +255,10 @@ void copy_constraints (ListBase *dst, ListBase *src)
for (con = dst->first; con; con=con->next) {
con->data = MEM_dupallocN (con->data);
/* removed a whole lot of useless code here (ton) */
/* NOTE: the pyconstraint system aren't implemented
* in the stable branch.
* - bdiego
*/
}
}

View File

@ -53,8 +53,8 @@ static char idp_size_table[] = {
1, /*strings*/
sizeof(int),
sizeof(float),
sizeof(float)*3, /*Vector type*/
sizeof(float)*16, /*Matrix type, we allocate max 4x4 even if in 3x3 mode*/
sizeof(float)*3, /*Vector type, deprecated*/
sizeof(float)*16, /*Matrix type, deprecated*/
0, /*arrays don't have a fixed size*/
sizeof(ListBase), /*Group type*/
sizeof(void*)
@ -104,6 +104,31 @@ void IDP_ResizeArray(IDProperty *prop, int newlen)
MEM_freeN(prop->data.pointer);
}
static IDProperty *idp_generic_copy(IDProperty *prop)
{
IDProperty *newp = MEM_callocN(sizeof(IDProperty), "IDProperty array dup");
strncpy(newp->name, prop->name, MAX_IDPROP_NAME);
newp->type = prop->type;
newp->flag = prop->flag;
newp->data.val = prop->data.val;
return newp;
}
IDProperty *IDP_CopyArray(IDProperty *prop)
{
IDProperty *newp = idp_generic_copy(prop);
if (prop->data.pointer) newp->data.pointer = MEM_dupallocN(prop->data.pointer);
newp->len = prop->len;
newp->subtype = prop->subtype;
newp->totallen = prop->totallen;
return newp;
}
/*taken from readfile.c*/
#define SWITCH_LONGINT(a) { \
char s_i, *p_i; \
@ -116,6 +141,19 @@ void IDP_ResizeArray(IDProperty *prop, int newlen)
/* ---------- String Type ------------ */
IDProperty *IDP_CopyString(IDProperty *prop)
{
IDProperty *newp = idp_generic_copy(prop);
if (prop->data.pointer) newp->data.pointer = MEM_dupallocN(prop->data.pointer);
newp->len = prop->len;
newp->subtype = prop->subtype;
newp->totallen = prop->totallen;
return newp;
}
void IDP_AssignString(IDProperty *prop, char *st)
{
int stlen;
@ -154,7 +192,7 @@ void IDP_FreeString(IDProperty *prop)
}
/*-------- ID Type -------*/
/*-------- ID Type, not in use yet -------*/
void IDP_LinkID(IDProperty *prop, ID *id)
{
@ -169,6 +207,38 @@ void IDP_UnlinkID(IDProperty *prop)
}
/*-------- Group Functions -------*/
/*checks if a property with the same name as prop exists, and if so replaces it.*/
IDProperty *IDP_CopyGroup(IDProperty *prop)
{
IDProperty *newp = idp_generic_copy(prop), *link;
for (link=prop->data.group.first; link; link=link->next) {
BLI_addtail(&newp->data.group, IDP_CopyProperty(link));
}
return newp;
}
void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
{
IDProperty *loop;
for (loop=group->data.group.first; loop; loop=loop->next) {
if (BSTR_EQ(loop->name, prop->name)) {
if (loop->next) BLI_insertlinkbefore(&group->data.group, loop->next, prop);
else BLI_addtail(&group->data.group, prop);
BLI_remlink(&group->data.group, loop);
IDP_FreeProperty(loop);
MEM_freeN(loop);
group->len++;
return;
}
}
group->len++;
BLI_addtail(&group->data.group, prop);
}
/*returns 0 if an id property with the same name exists and it failed,
or 1 if it succeeded in adding to the group.*/
int IDP_AddToGroup(IDProperty *group, IDProperty *prop)
@ -260,6 +330,15 @@ void IDP_FreeGroup(IDProperty *prop)
/*-------- Main Functions --------*/
IDProperty *IDP_CopyProperty(IDProperty *prop)
{
switch (prop->type) {
case IDP_GROUP: return IDP_CopyGroup(prop);
case IDP_STRING: return IDP_CopyString(prop);
case IDP_ARRAY: return IDP_CopyArray(prop);
default: return idp_generic_copy(prop);
}
}
IDProperty *IDP_GetProperties(ID *id, int create_if_needed)
{
@ -323,26 +402,6 @@ IDProperty *IDP_New(int type, IDPropertyTemplate val, char *name)
/* heh I think all needed values are set properly by calloc anyway :) */
break;
}
case IDP_MATRIX:
prop = MEM_callocN(sizeof(IDProperty), "IDProperty array");
if (val.matrix_or_vector.matvec_size == IDP_MATRIX4X4)
prop->data.pointer = MEM_callocN(sizeof(float)*4*4, "matrix 4x4 idproperty");
else
prop->data.pointer = MEM_callocN(sizeof(float)*3*3, "matrix 3x3 idproperty");
case IDP_VECTOR:
prop = MEM_callocN(sizeof(IDProperty), "IDProperty array");
switch (val.matrix_or_vector.matvec_size) {
case IDP_VECTOR4D:
prop->data.pointer = MEM_callocN(sizeof(float)*4, "vector 4d idproperty");
break;
case IDP_VECTOR3D:
prop->data.pointer = MEM_callocN(sizeof(float)*3, "vector 3d idproperty");
break;
case IDP_VECTOR2D:
prop->data.pointer = MEM_callocN(sizeof(float)*2, "vector 2d idproperty");
break;
}
default:
{
prop = MEM_callocN(sizeof(IDProperty), "IDProperty array");
@ -370,10 +429,6 @@ void IDP_FreeProperty(IDProperty *prop)
case IDP_GROUP:
IDP_FreeGroup(prop);
break;
case IDP_VECTOR:
case IDP_MATRIX:
MEM_freeN(prop->data.pointer);
break;
}
}

View File

@ -409,7 +409,8 @@ void *copy_libblock(void *rt)
id->newid= idn;
idn->flag |= LIB_NEW;
if (id->properties) idn->properties = IDP_CopyProperty(id->properties);
return idn;
}

View File

@ -65,7 +65,7 @@ typedef struct IDProperty {
/*totallen is total length of allocated array/string, including a buffer.
Note that the buffering is mild; the code comes from python's list implementation.*/
int totallen; /*strings and arrays are both buffered, though the buffer isn't
saved. at least it won't be when I write that code. :)*/
saved.*/
} IDProperty;
#define MAX_IDPROP_NAME 32
@ -75,21 +75,12 @@ typedef struct IDProperty {
#define IDP_STRING 0
#define IDP_INT 1
#define IDP_FLOAT 2
#define IDP_VECTOR 3
#define IDP_MATRIX 4
#define IDP_ARRAY 5
#define IDP_GROUP 6
/*the ID link property type hasn't been implemented yet, this will require
some cleanup of blenkernel, most likely.*/
#define IDP_ID 7
/*special types for vector, matrices and arrays
these arn't quite completely implemented, and
may be removed.*/
#define IDP_MATRIX4X4 9
#define IDP_MATRIX3X3 10
#define IDP_VECTOR2D 11
#define IDP_VECTOR3D 12
#define IDP_VECTOR4D 13
#define IDP_FILE 14
/*add any future new id property types here.*/
/* watch it: Sequence has identical beginning. */

View File

@ -137,25 +137,33 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
static void node_composit_exec_math(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
/* stack order out: bw */
/* stack order in: col */
if(out[0]->hasoutput==0)
return;
/* input no image? then only color operation */
if(in[0]->data==NULL) {
CompBuf *cbuf=in[0]->data;
CompBuf *cbuf2=in[1]->data;
CompBuf *stackbuf;
/* check for inputs and outputs for early out*/
if(in[0]->hasinput==0 || in[1]->hasinput==0) return;
if(out[0]->hasoutput==0) return;
/* no image-color operation */
if(in[0]->data==NULL && in[1]->data==NULL) {
do_math(node, out[0]->vec, in[0]->vec, in[1]->vec);
return;
}
else {
/* make output size of input image */
CompBuf *cbuf= in[0]->data;
CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */
composit2_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, do_math, CB_VAL, CB_VAL);
out[0]->data= stackbuf;
/*create output based on first input */
if(cbuf) {
stackbuf=alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
}
/* and if it doesn't exist use the second input since we
know that one of them must exist at this point*/
else {
stackbuf=alloc_compbuf(cbuf2->x, cbuf2->y, CB_VAL, 1);
}
/* operate in case there's valid size */
composit2_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, do_math, CB_VAL, CB_VAL);
out[0]->data= stackbuf;
}
bNodeType cmp_node_math= {

View File

@ -20,4 +20,7 @@ if env['WITH_BF_QUICKTIME']==1:
if env['WITH_BF_OPENEXR'] == 1:
defs.append('WITH_OPENEXR')
if env['WITH_BF_FFMPEG'] == 1:
defs.append('WITH_FFMPEG')
env.BlenderLib ( libname='blender_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype=['core','game2'], priority = [60,115] )

View File

@ -86,9 +86,6 @@ PyObject *BPy_IDGroup_WrapData( ID *id, IDProperty *prop )
array->prop = prop;
return (PyObject*) array;
}
case IDP_MATRIX:
case IDP_VECTOR:
break;
}
Py_RETURN_NONE;
}
@ -141,12 +138,12 @@ int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value)
return 0;
}
PyObject *BPy_IDGroup_GetName(BPy_IDProperty *self)
PyObject *BPy_IDGroup_GetName(BPy_IDProperty *self, void *bleh)
{
return Py_BuildValue("s", self->prop->name);
}
int BPy_IDGroup_SetName(BPy_IDProperty *self, PyObject *value)
int BPy_IDGroup_SetName(BPy_IDProperty *self, PyObject *value, void *bleh)
{
char *st;
if (!PyString_Check(value))
@ -206,7 +203,7 @@ PyObject *BPy_IDGroup_Map_GetItem(BPy_IDProperty *self, PyObject *item)
/*returns NULL on success, error string on failure*/
char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, PyObject *ob)
{
IDProperty *prop = NULL, *prop2=NULL, *prev=NULL;
IDProperty *prop = NULL;
IDPropertyTemplate val = {0};
if (PyFloat_Check(ob)) {
@ -285,15 +282,7 @@ char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, PyObje
Py_XDECREF(vals);
} else return "invalid property value";
prop2 = IDP_GetPropertyFromGroup(group, prop->name);
if (prop2) {
prev=prop2->prev; /*we want to insert new property in same place as old*/
IDP_RemFromGroup(group, prop2);
IDP_FreeProperty(prop2);
MEM_freeN(prop2);
}
IDP_InsertToGroup(group, prev, prop);
IDP_ReplaceInGroup(group, prop);
return NULL;
}

View File

@ -45,6 +45,9 @@ endif
CFLAGS += $(LEVEL_1_C_WARNINGS)
ifeq ($(WITH_FFMPEG), true)
CPPFLAGS += -DWITH_FFMPEG
endif
CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include

View File

@ -4388,7 +4388,7 @@ static void editing_panel_mesh_tools(Object *ob, Mesh *me)
uiDefButBitS(block, TOG, B_JOINTRIA_UV, 0, "Delimit UVs", 10, -40, 78, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Don't join pairs where UVs don't match");
uiDefButBitS(block, TOG, B_JOINTRIA_VCOL, 0, "Delimit Vcol", 90, -40, 78, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Don't join pairs where Vcols don't match");
uiDefButBitS(block, TOG, B_JOINTRIA_SHARP, 0, "Delimit Sharp", 170, -40, 78, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Don't join pairs where edge is sharp");
uiDefButBitS(block, TOG, B_JOINTRIA_MAT, 0, "Delimit Mat", 250, -40, 74, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Don't join pairs where material dosnt match");
uiDefButBitS(block, TOG, B_JOINTRIA_MAT, 0, "Delimit Mat", 250, -40, 74, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Don't join pairs where material doesn't match");
uiBlockEndAlign(block);

View File

@ -2656,11 +2656,14 @@ void common_insertkey(void)
}
else if(G.buts->mainb==CONTEXT_OBJECT) {
ob= OBACT;
if(ob && ob->type==OB_MESH) {
if(ob) {
id= (ID *) (ob);
if(id) {
event= pupmenu("Insert Key %t|Surface Damping%x0|Random Damping%x1|Permeability%x2|Force Strength%x3|Force Falloff%x4");
if(event== -1) return;
if(ob->type==OB_MESH)
event= pupmenu("Insert Key %t|Surface Damping%x0|Random Damping%x1|Permeability%x2|Force Strength%x3|Force Falloff%x4");
else
event= pupmenu("Insert Key %t|Force Strength%x3|Force Falloff%x4");
if(event == -1) return;
if(event==0) {
insertkey(id, ID_OB, NULL, NULL, OB_PD_SDAMP);

View File

@ -704,6 +704,7 @@ static void error_cb(char *err)
static void mem_error_cb(char *errorStr)
{
fprintf(stderr, errorStr);
fflush(stderr);
}
void setCallbacks(void)