View Full Version : parameter wiring & binding problem
ChristophZollinger 10-15-2002, 10:39 AM Hi there,
besides my work here in the game company, I am working on a private animation project.
Well the ideas, modelling and texturing arenīt real problems because I am still in preproduction and testing some animation techniques.
Now, I have a problem, which someone here is able to solve - I hope.
I am just setting up a robotīs leg.
The structure is very simple, as shown in the attachment.
I have a blue sphere ( supposed to be an electric motor) and a red sphere ( bearing ball of the first leg joint, like hip joint in human skelet)
Further I have a simple IK system to complete the robotīs leg.
Now, what I want to have, is when I take the IK-handle and move it around xyz, that the red sphere inherits the motion of the first bone and gives it to the blue sphere.
I tried to wire the rotation parameters of the two sphere so that they move against each other. It worked with a "-" in the dialog.
But now, when I bind the red sphere to the first bone, the connection to the blue sphere breaks.
My question now is: Can I use both "parameter wiring" AND object binding, or must I exlude on of these.
Then, I am thinking about a rotation script for the blue sphere to inherit the motion of the red sphere. So I donīt have to "wire" these two together.
For this I need a script that "gets" the motion of the red sphere and outputs it with a minus.
Any solutions?
So long
|
|
Iain McFadzen
10-15-2002, 10:53 AM
What do you mean by "bind"? Do you mean "link"?
Anyway, I'd probably leave the wiring between the two balls as it is, and instead of linking the red ball to the bone apply an Orientation Constraint to the red ball and pick the first bone as it's target, or, apply a Look-At Constraint instead and pick the second bone as the target.
This might not work on the actual rig, not sure, but it should work for your cut-down example. Unless I am completely miss-understanding the problem :)
ChristophZollinger
10-15-2002, 11:12 AM
Yes, it was linking.
Well, your solution had the same effect, now the red sphere moves in the right way if you move the IK-Handle, but its motion is not given to the blue sphere.
Iain McFadzen
10-15-2002, 12:03 PM
Well I'll be damned, you're right it doesn't work. OK I'm a little stumped, I'll have a think about it when I get a minute.
In the meantime if anyone else has any ideas I'd also be glad to hear 'em :)
ChristophZollinger
10-15-2002, 02:06 PM
What about a rotation script for the blue sphere?
Maybe I could make it like this:
I give the red sphere an Euler XYZ Rotation Controller, link it to the first bone.
Take the blue sphere and give it a rotation script in the "Assign Controller" Tab.
Then I have to make a little script with a simple definition like:
get the rotation angle from red sphereīs Euler XYZ and put it out with the negative value for the blue one.
Before I now have to work me through the Script Reference, can someone post the commands which are neccessary for this?
Gonzo The Great
10-15-2002, 11:26 PM
What about Rotation Reactor?
ChristophZollinger
10-16-2002, 08:51 AM
Well, that doesnīt function, too.
Nobody out there who had to solve the same problem?
gaggle
10-16-2002, 11:22 AM
Mastermind, using the expression-controller shouldn't be too hard, at most it just takes a little getting used to. I don't have MAX infront of me, so yell out if this doesn't work and I'll have a look later when I get the chance. Anyways, it goes something like this:
Apply the expression-controller on a rotational axis of the blue ball, then make a variable from the expression-editor window. Make it a..idunno..scalar? I can't remember right now, if the first one doesn't work, the 2nd one will :)
But make the variable, and hook it up to one of the red ball's axis. This will give you a number to work with. Punch in the variables name, and multiply with.. ah.. -1 I suppose oughta do it (ie. "BlueBall_rot*-1"). Hit Evaluate, and hopefully you should get the inverse number of the variable.
And that's it. But again, who knows how many steps I just skipped.
There's a part that I'm not sure on, you may have to convert the numbers to and from radians and degrees. If both balls has a Rotation XYZ controller on them, then I don't think there'll be a problem. If your rotation goes completly wonky though, you'll need to do a bit of DegToRad and RadToDeg conversion fun.
And a final disclaimer: I suck at MAXScripting and I don't really know how to do much of anything, so anyone spotting errors and whatnot, point 'em out asap :)
Chris Thomas
10-16-2002, 12:58 PM
Mastermind, can you please post a simple version of this rig? (zipped or compressed max file) I'll post a solution for you when I get home tonight. It sounds like an expression controllers is your bst bet here. Gimmie the file and I'll supply the relavent expresion and post back here. Cheers
Chris Thomas
ChristophZollinger
10-16-2002, 01:38 PM
Okay,
here is it.
The .max file contains the same simple IK-system plus the two spheres and some notations.
You can get the file HERE (http://www.zolli.de/upload/robot_IK.zip) itīs a Max4.2 file
I hope it helps you -
and, of course me.
So long
Chris Thomas
10-16-2002, 11:07 PM
Ok, bit of a thorny one this and big thanks goes out to my mate Gordon Chapman for an explanation that made all clear.
In max all objects have a base transformation, i.e. position, rotation and scale. This is then modified by its controllers (if any).
in this case the linked sphere03 has no controller, and as a result you cant instance it or reference it via a script. (usual method). You can however reference its base rotation (which all objects have). So, get sphere04, assign a script controller to its Y rotation and put this in it
dependson $sphere03
$sphere03.transform.rotation.y
that shoudl do the trick. now if you want to mod the roation of sphere04 just put the sphere03 in brackets and do some math on it i.e.
dependson $sphere03
($sphere03.transform.rotation.y)*-1
or
dependson $sphere03
($sphere03.transform.rotation.y)/10
and so on, hope this makes sense :)
Chris Thomas
ChristophZollinger
10-17-2002, 07:42 AM
Thanks for that post.
well Iīll give it a try, when itīs lunchtime :-)
So long
ChristophZollinger
10-17-2002, 10:59 AM
So, itīs lunchtime.
I inserted these lines into the script dialog of the controller, but pressing "evaluate" brings an error :
"unable to convert: 0.535472 to type : Quaternion"
So it doesnīt work, too.
Reality3D
10-17-2002, 11:55 AM
You are working with quaternion(tcb) rotation. The examples are supposed to work with euler type rotation. Go to the motion panel and change the rotation controller to euler. Hope this help
Chris Thomas
10-17-2002, 11:55 AM
Unfortunately I'm at work, and don't have Max, I'll have to get back to you later on it. Or, you could earch the maxscript help and have a crack at getting it working yourself?
Chris Thomas
p.s. not sure quite what the problem is
ChristophZollinger
10-17-2002, 12:39 PM
@Reality3D
No, I am not working with TCB, the Error message "blablabla.. Qauternion" appears in when I try to use the Rotation Script Controller.
At the moment I have only my lunchbreak to try, this weekend is also very bad for digging through Maxīs Script Reference, because I am going to make a portrait of my girlfriend as a birthday present, so Iīll spend my time on this.
I hope this animation problem wonīt be a lifetime job
gaggle
10-17-2002, 12:54 PM
Reality3D sounds like he's right on the money, select your balls (hee hee), and make sure both the position and rotational controllers are of the Euler XYZ type.
You do that by going to the.. er.. motion tab? And in the Controller-rollout, select "Rotation", and then the little green button right over it with the tooltip "Assign Controller".
You get a list of possible controllers to assign, find the one called Euler XYZ, and you're in buisness. I suggest you hit "default" and answer yes to the confirmation box, that way all future objects you create will have this controller assigned. Its the default controller for all objects in MAX5, so even Discreet seems to know of its neatness :)
Apologies if you already knew how to assign controllers, just trying to make sure everything is covered :)
Anyways, as long as both balls have their controllers set that way.. then.. er.. it oughta work. The Qauternion (nice name huh) thing should only happen because of one controller reporting numbers another controller can't understand. I posted a different way of keeping track of the other balls rotation earlier, by making a variable and all that, you could try that as well I guess, if this dependson thing ends up not working (I've used a few times before and, er, it oughta work.. :shrug:
ChristophZollinger
10-17-2002, 01:07 PM
I think, the whole thread is going in the wrong direction.
Well I worked with nearly all controllers available in Max, so I already know how to apply these things to an object an further I know, how to set up relationship between objects via parameter wiring.
the problem in this case here is only the following.
I canīt wire the rotaion of both sphere, when I further try to link the red sphere to the first bone (Bone04) in any way, to get its motion.
Actually thatīs all.
Doesnīt sound so big
gaggle
10-17-2002, 01:36 PM
Indeed, I hadn't picked up on the problem I guess, sorry about that. Well if that's the case.. hm.. *ponders*.
..so you wire the rotation of the red ball into the blue ball. And then wire the rotation of something else into the red ball? And the red/blue ball connection is lost?
Or you wire something completly different to the red ball, and still the rotational wireing of red/blue ball is lost?
..anyways, in any event, have you tried to link the red ball to a dummy, and then wire whatever you want to the dummy? If it's transforms you're wireing at any rate..
Feel free to describe the problem further if I've missed the point again. I've read through the previous messages, and I can't rule out that I'm either too tired or too blind to pick up on the point :)
Iain McFadzen
10-17-2002, 02:10 PM
I reckon the problem must somehow come from the fact that it's an IK solution which is driving the whole system. I tried every imaginable combination of linking, wiring, position/orianentation/look-at constraints, controller types (including several variations of list controller), and varied the heirarchy to include dummys at every joint (in order, then all at the same time). Nothing worked. As soon as the first ball is constrained (either with position or look-at, or straight linked) to match the rotation of the upper bone you cannot wire the second ball to it, no matter how many nulls you include in the system.
I strongly recommend you post this on the Discreet webboard, because it damn well should work the way you originally thought it would work, and as it doesn't then it's something Discreet should be looking at. Besides, it's bugging hell out of me now and I want to know the answer too :)
ChristophZollinger
10-17-2002, 02:58 PM
@Ian
:scream: :scream: that sounds familiar to me.:scream: :scream:
--
Iīll post my problem on the discreet board, but besides that, everybody feel free to post an idea on my problem.
thatīs not the end
derelict
10-17-2002, 03:41 PM
...now itz every max users problem.hehe.
Nevermind.
Chris Thomas
10-17-2002, 04:06 PM
Ok, by the magic of the internet...
here's the file. Its max 5, hope thats ok?
Chris T
derelict
10-17-2002, 04:39 PM
how about assigning the blue ball with the orientation constraint to the red ball.
ChristophZollinger
10-18-2002, 07:27 AM
@jmonkey:
Sorry pal, I only have Max4.2 :-( so it doesnīt work for me.
@derelict:
Well the effect will be, that the blue sphere would rotate exactly like the red one. And they should rotate against each other.
derelict
10-18-2002, 07:37 AM
Yes it will....
You see the parameter for the xyz for your orientation constraint? the is a jog dial for the percentage? just jog it to 180 max limit, it should reflex the opposite direction. (base on your file, you have to adjust your balls to coordinate in the same direction b 4 your new jog dial settings)
ChristophZollinger
10-21-2002, 08:41 AM
New week, new luck
@derelict:
I donīt really know, what you mean, beacause I only see the orientation target an weight as parameters in the tab.
I am very glad that you guys have all these ideas, but on the other hand they are too theoretical.
Today Iīll post my problem on the discreet board, when I know how to do that, because the layout of their board isnīt very comfortable.
But in the meantime, it would be a cool thing, if there were more ideas about solving my problem, maybe with the help of an picture or a max4.2 conform file.
Chris Thomas
10-21-2002, 12:37 PM
Yeah, that file came from a friend, I'll do a 4 version and post tonight when I get home, cheers.
Chris T
CGTalk Moderation
01-13-2006, 07:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.