[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11236] branches/2-44-stable/blender: branches/2-44-stable
Diego Borghetti (Plumiferos)
bdiego at gmail.com
Thu Jul 12 06:56:01 CEST 2007
Revision: 11236
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11236
Author: bdiego
Date: 2007-07-12 06:56:00 +0200 (Thu, 12 Jul 2007)
Log Message:
-----------
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
Revision Links:
--------------
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11187
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11196
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11197
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10754
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11199
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11201
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11223
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11224
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11225
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11230
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11232
Modified Paths:
--------------
branches/2-44-stable/blender/extern/bullet2/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h
branches/2-44-stable/blender/source/blender/blenkernel/BKE_idprop.h
branches/2-44-stable/blender/source/blender/blenkernel/intern/constraint.c
branches/2-44-stable/blender/source/blender/blenkernel/intern/idprop.c
branches/2-44-stable/blender/source/blender/blenkernel/intern/library.c
branches/2-44-stable/blender/source/blender/makesdna/DNA_ID.h
branches/2-44-stable/blender/source/blender/nodes/intern/CMP_nodes/CMP_math.c
branches/2-44-stable/blender/source/blender/python/SConscript
branches/2-44-stable/blender/source/blender/python/api2_2x/IDProp.c
branches/2-44-stable/blender/source/blender/python/api2_2x/Makefile
branches/2-44-stable/blender/source/blender/src/buttons_editing.c
branches/2-44-stable/blender/source/blender/src/editipo.c
branches/2-44-stable/blender/source/creator/creator.c
Modified: branches/2-44-stable/blender/extern/bullet2/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h
===================================================================
--- branches/2-44-stable/blender/extern/bullet2/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h 2007-07-12 02:01:07 UTC (rev 11235)
+++ branches/2-44-stable/blender/extern/bullet2/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h 2007-07-12 04:56:00 UTC (rev 11236)
@@ -60,7 +60,7 @@
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);
Modified: branches/2-44-stable/blender/source/blender/blenkernel/BKE_idprop.h
===================================================================
--- branches/2-44-stable/blender/source/blender/blenkernel/BKE_idprop.h 2007-07-12 02:01:07 UTC (rev 11235)
+++ branches/2-44-stable/blender/source/blender/blenkernel/BKE_idprop.h 2007-07-12 04:56:00 UTC (rev 11236)
@@ -78,6 +78,11 @@
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 @@
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.
Modified: branches/2-44-stable/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- branches/2-44-stable/blender/source/blender/blenkernel/intern/constraint.c 2007-07-12 02:01:07 UTC (rev 11235)
+++ branches/2-44-stable/blender/source/blender/blenkernel/intern/constraint.c 2007-07-12 04:56:00 UTC (rev 11236)
@@ -255,7 +255,10 @@
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
+ */
}
}
Modified: branches/2-44-stable/blender/source/blender/blenkernel/intern/idprop.c
===================================================================
--- branches/2-44-stable/blender/source/blender/blenkernel/intern/idprop.c 2007-07-12 02:01:07 UTC (rev 11235)
+++ branches/2-44-stable/blender/source/blender/blenkernel/intern/idprop.c 2007-07-12 04:56:00 UTC (rev 11236)
@@ -53,8 +53,8 @@
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 @@
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 @@
/* ---------- 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 @@
}
-/*-------- ID Type -------*/
+/*-------- ID Type, not in use yet -------*/
void IDP_LinkID(IDProperty *prop, ID *id)
{
@@ -169,6 +207,38 @@
}
/*-------- 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 @@
/*-------- 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 @@
/* 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 @@
case IDP_GROUP:
IDP_FreeGroup(prop);
break;
- case IDP_VECTOR:
- case IDP_MATRIX:
- MEM_freeN(prop->data.pointer);
- break;
}
}
Modified: branches/2-44-stable/blender/source/blender/blenkernel/intern/library.c
===================================================================
--- branches/2-44-stable/blender/source/blender/blenkernel/intern/library.c 2007-07-12 02:01:07 UTC (rev 11235)
+++ branches/2-44-stable/blender/source/blender/blenkernel/intern/library.c 2007-07-12 04:56:00 UTC (rev 11236)
@@ -409,7 +409,8 @@
id->newid= idn;
idn->flag |= LIB_NEW;
-
+ if (id->properties) idn->properties = IDP_CopyProperty(id->properties);
+
return idn;
}
Modified: branches/2-44-stable/blender/source/blender/makesdna/DNA_ID.h
===================================================================
--- branches/2-44-stable/blender/source/blender/makesdna/DNA_ID.h 2007-07-12 02:01:07 UTC (rev 11235)
+++ branches/2-44-stable/blender/source/blender/makesdna/DNA_ID.h 2007-07-12 04:56:00 UTC (rev 11236)
@@ -65,7 +65,7 @@
/*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 @@
#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. */
Modified: branches/2-44-stable/blender/source/blender/nodes/intern/CMP_nodes/CMP_math.c
===================================================================
--- branches/2-44-stable/blender/source/blender/nodes/intern/CMP_nodes/CMP_math.c 2007-07-12 02:01:07 UTC (rev 11235)
+++ branches/2-44-stable/blender/source/blender/nodes/intern/CMP_nodes/CMP_math.c 2007-07-12 04:56:00 UTC (rev 11236)
@@ -137,25 +137,33 @@
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)
+ 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;
-
- /* input no image? then only color operation */
- if(in[0]->data==NULL) {
- do_math(node, out[0]->vec, in[0]->vec, in[1]->vec);
}
- else {
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list