Ramón López Posted November 2, 2007 Share Posted November 2, 2007 Hi, I'm treating to get an expression to be able to control a point with the movement of several other points, I mean a point that moves automatically the average of the distance the controller points move, you know, just like when you add several "Translate To" dynamic constraints to a one bone and it moves in the middle when any of that controllers bones is moved... I have tried to "concatenate" (cause it seems not possible to add several expressions to a same parameter) little expressions in this way "..|..|..|Spline #164|CP #169.Translate ..|..|..|Spline #165|CP #170.Translate" but it doesn't works and I have tried to join'em in all the ways I can imagine "&, |, /, ., etc..." with the same "Sintax error in the expression" message (except in the "&" case, but it neither works at last ), so well... any help in this unknowed area to me it'd be very appreciated , THANKS! Quote Link to comment Share on other sites More sharing options...
Luuk Steitner Posted November 2, 2007 Share Posted November 2, 2007 I think the way the do this is to use an expression for each axis like translate.x = (x1 + x2) / 2 Quote Link to comment Share on other sites More sharing options...
Ramón López Posted November 2, 2007 Author Share Posted November 2, 2007 Ey, thank you for the quick answer!!! But for some reason I get the same "Sintax error in the expression" message when I try to control any axis separately, any "..|..|CP #1.Translate.X" or "..|..|CP #1.Translate.Y" results in the same message and, of course, with any effect over the controlled points, and... well, finally I 'm not totally sure about that "= (x1 + x2) / 2" part means in this case, oh! my maths... Any other possible way? THANKS! Quote Link to comment Share on other sites More sharing options...
Ramón López Posted November 2, 2007 Author Share Posted November 2, 2007 I get the same "Sintax error in the expression" message when I try to control any axis separately, any "..|..|CP #1.Translate.X" or "..|..|CP #1.Translate.Y" results in the same message and, of course, with any effect over the controlled points BTW, do you think this could be something to be Reported? Cause it should works in the same way as in the bones case, is't? Or... am I missing something, that could be very probable... Quote Link to comment Share on other sites More sharing options...
Luuk Steitner Posted November 2, 2007 Share Posted November 2, 2007 Syntax error means that your expression is not ok. try this on the translate.X expression: (..|..|..|Spline #164|CP #169.Translate.X + ..|..|..|Spline #164|CP #170.Translate.X) / 2 That should give the average X of CP 169 & 170 If this doesn't work I'll try it in A:M but I think this is correct. Quote Link to comment Share on other sites More sharing options...
johnl3d Posted November 2, 2007 Share Posted November 2, 2007 just a thought why not assign bones to the points and use expressions to control their positions which would therefore move the points. We know bones work with expression not sure if splines do Quote Link to comment Share on other sites More sharing options...
Ramón López Posted November 2, 2007 Author Share Posted November 2, 2007 ...YoO-HOoOoo!!! That "+" sign was the solution! The result is exactly this: "..|..|CP #1.Translate/2+..|..|CP #3.Translate/2" (without the ".X" part as I'll explain you below) And well, I don't know why I didn't realize it... Maybe cause I was thinking more in something like a special "concatenate" sign to join different "elements" into the same expresion, maybe I have no idea ...Anyway, THANK YOU very much for the good & quick help! Syntax error means that your expression is not ok But in this case it shouldn't happen, isn't? I mean what could be wrong in a simple expression like this "..|..|CP #1.Translate.X"? That's cause I thought it could be a bug that should be Reported unless I be missing something... Ah, and the main reason to use expressioin directly over points to me, is cause I think that in some situations this way offers certain facilities and possibilities working with animatable points into Distortion Boxes and in the more practice way, it's really difficult to explain to me here... but beliveme if I say you it's important and if not I'd use the other way, just cause it seems more the way A:M is intended to work... BYE & THANKS again! Quote Link to comment Share on other sites More sharing options...
Luuk Steitner Posted November 2, 2007 Share Posted November 2, 2007 But in this case it shouldn't happen, isn't? I mean what could be wrong in a simple expression like this "..|..|CP #1.Translate.X"? That's cause I thought it could be a bug that should be Reported unless I be missing something... The other expressions you showed had 3x "..|" That could be the problem. (Translate.X is a child of Translate so that's one step more) The best way to avoid mistakes is to select the variables with your mouse and not typing them. Quote Link to comment Share on other sites More sharing options...
Ramón López Posted November 2, 2007 Author Share Posted November 2, 2007 Hi again! Well I have been testing all the "..|" possibilities and nothing seems to work when a parameter like ".X" is present... I'd like to be wrong, but can you see something wrong in this simple example that should make jump that warning window? I think I have probed too all the possibilities here but I thought too in the other issue and you had a solution, so I still have some hope , THANKS! Quote Link to comment Share on other sites More sharing options...
Luuk Steitner Posted November 2, 2007 Share Posted November 2, 2007 It says "Translate = ..|..|CP #1.Translate.X" That's wrong. "Translate.X = ..|..|CP #1.Translate.X" or "Translate = ..|..|CP #1.Translate" would be ok. Quote Link to comment Share on other sites More sharing options...
Ramón López Posted November 2, 2007 Author Share Posted November 2, 2007 Ohhh... I can see it now... And it seems more like an Expression CP limitation than a bug, cause I can't see the way to acces to each axis separately, I mean, as opposed to bones there is no way (or I can't see it) to can use an expression called "Translate.X =" for CPs as you suggest , so if I decide to report it, finally it should be more like a Feature Request than a Bug Report and probably it'll never arrive... Again I'd love to be wrong, but now I'm almost sure that actually there is no way to get it... Anyway, THANKS to make me know! And, of course (and again), for all the other invaluable help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.