[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13722] trunk/blender/source/blender/src/ transform.c: Bugfix: Limit Constraints
Joshua Leung
aligorith at gmail.com
Sun Feb 17 07:17:04 CET 2008
Revision: 13722
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13722
Author: aligorith
Date: 2008-02-17 07:17:01 +0100 (Sun, 17 Feb 2008)
Log Message:
-----------
Bugfix: Limit Constraints
Rot/Scale-Limit Constraints with 'For Transform' option would sometimes act on location values too.
Modified Paths:
--------------
trunk/blender/source/blender/src/transform.c
Modified: trunk/blender/source/blender/src/transform.c
===================================================================
--- trunk/blender/source/blender/src/transform.c 2008-02-17 06:00:18 UTC (rev 13721)
+++ trunk/blender/source/blender/src/transform.c 2008-02-17 06:17:01 UTC (rev 13722)
@@ -1941,48 +1941,35 @@
/* Evaluate valid constraints */
for (con= td->con; con; con= con->next) {
float tmat[4][4];
-
+
/* only use it if it's tagged for this purpose (and the right type) */
if (con->type == CONSTRAINT_TYPE_LOCLIMIT) {
bLocLimitConstraint *data= con->data;
+
if ((data->flag2 & LIMIT_TRANSFORM)==0)
continue;
- }
- else if (con->type == CONSTRAINT_TYPE_ROTLIMIT) {
- bRotLimitConstraint *data= con->data;
- if ((data->flag2 & LIMIT_TRANSFORM)==0)
+
+ /* do space conversions */
+ if (con->ownspace == CONSTRAINT_SPACE_WORLD) {
+ /* just multiply by td->mtx (this should be ok) */
+ Mat4CpyMat4(tmat, cob.matrix);
+ Mat4MulMat34(cob.matrix, td->mtx, tmat);
+ }
+ else if (con->ownspace != CONSTRAINT_SPACE_LOCAL) {
+ /* skip... incompatable spacetype */
continue;
- }
- else if (con->type == CONSTRAINT_TYPE_SIZELIMIT) {
- bSizeLimitConstraint *data= con->data;
- if ((data->flag2 & LIMIT_TRANSFORM)==0)
- continue;
- }
- else {
- /* not supported */
- continue;
- }
+ }
- /* do space conversions */
- if (con->ownspace == CONSTRAINT_SPACE_WORLD) {
- /* just multiply by td->mtx (this should be ok) */
- Mat4CpyMat4(tmat, cob.matrix);
- Mat4MulMat34(cob.matrix, td->mtx, tmat);
+ /* do constraint */
+ cti->evaluate_constraint(con, &cob, NULL);
+
+ /* convert spaces again */
+ if (con->ownspace == CONSTRAINT_SPACE_WORLD) {
+ /* just multiply by td->mtx (this should be ok) */
+ Mat4CpyMat4(tmat, cob.matrix);
+ Mat4MulMat34(cob.matrix, td->smtx, tmat);
+ }
}
- else if (con->ownspace != CONSTRAINT_SPACE_LOCAL) {
- /* skip... incompatable spacetype */
- continue;
- }
-
- /* do constraint */
- cti->evaluate_constraint(con, &cob, NULL);
-
- /* convert spaces again */
- if (con->ownspace == CONSTRAINT_SPACE_WORLD) {
- /* just multiply by td->mtx (this should be ok) */
- Mat4CpyMat4(tmat, cob.matrix);
- Mat4MulMat34(cob.matrix, td->smtx, tmat);
- }
}
/* copy results from cob->matrix */
More information about the Bf-blender-cvs
mailing list