Hi all,
I would like to rotate an object and constrain other objects' rotations to that, and play with the weights, e.g. "rotate half as much as the parent object". When I set up everything, I realized the constrained objects suddenly change orientation, although the parent rotates smoothly. Looking more carefully, this happens when the parent object passes 180° rotation. When it is supposed to go to 181°, it shows me -179° instead. So it does not add the angles, it just goes up to 180 and then it goes down in negative. As for the given example: if the parent object rotates to 200° the constrained object should rotate to 100°. But 200° do not exist anymore. 200° has become -160° and the constrained object is now at -80° instead of 100°.
I don't know if that's the case since the last update or with v2024 or earlier, as I didn't rotate this much for a long time. I remember setting key frames for a rotation, then go to like frame 5000 and see the object is rotated a crazy amount of degrees and not stay within the 180° limit.
The main issue is not the orientation constraint, so I don't need a work around there. A lot of things depend on proper counting. So, is there a setting where I can change that behavior? If this has already been solved, I apologize. I didn't know how else to look that up or how else to ask about it.
Cheers,
Sam
*renamed the post for clarity
Although the Rotate Transform Type-In may switch from a positive angle to a negative angle when the angle passes 180°, the positive value can be used in a controller but you should keep in mnd that the angle may wind up.
For example, in the case below there are two teapots. When Teapot001 is rotated about its z axis Teapot002 will rotate by half the angle via a scipt controller.
The controller assumes radians so a conversion is necessasy. To demonstrate how the angle builds I added a format statement t print out the anggle (in degrees) and using the modulo function mod, the angle remainder after dividing the angle (in radians) by 2*pi.
At the right is what the Scripting Listener shows as teapot001 (t1 in the script) is rotated.
Hi there, thank you very much, @leeminardi and @wernienst for the responses!
I actually haven't wrapped my brain around scripting in 20 years of using Max once in a while. I keep using that Motion - Parameters - Assign Controller - Rotation - Orientation Constraint from the menu on the right side. Using that gives me jumping children when the parent rotates smoothly. This Script Controller seems to work pretty well!
I kind of hoped this is just a simple setting somewhere that I missed. I think I won't learn to script to work around a "faulty" annotation of rotation. As I wrote, Max must have changed that. It was possible to simply rotate the object and then see the final angle. Take the wheels of a car for example. The car went 20 miles and the wheels' final angle is -20°. That's not helpful at all. There is probably a workaround and initially a better way to get the info I want, but when I have 100 different examples I would need 100 different solutions just because one thing doesn't work how it should - or how I am used to 😉
I didn't quite get the Euler XYZ Controller thing. Isn't that the standard setting? That said, I haven't worked with Parameter Wiring at all yet. But aside from all the nice possibilities, I'd really like to know why Max doesn't let the angles add up and - more importantly - how can I set it up to do it the old way.
Thanks again!!
Cheers,
Sam
@Sam_Jay you have not said how you are determing that "the wheels' final angle is -20°" and how you are using that result to affect the rotation f another object. If not through a float script associated with another object or a Wire Parameter then how?
Note, if you set a keyframe via Autokey at frame 100 after rotating the object 2-3/4 turns (990°) Transform Type-In will indicate an value of -90 and the result will be -1/4 turn. YOu could edit the keyframe value of -90 to +990 and get the full 2-3/4 turns.
Alternatively, you could assign a TCB Rotation controller to the object and check the box for Rotation Windup. Then keyframe your rotation. Note for TCB rotation you'll want to set the tension to 50 to get linear rotations. TCB rotaton use an axis (which may be skewed in 3D space) and an angle which is always positive. Reverse directions of rotation are defined by the axis vector changing its direction. TCB controller are preferred for certain animations which could suffer from gimbal lock if Euler controllers were used.
Hello @leeminardi , thank you again!
The wheels were just a quick example, that's why I didn't tell more about them. Isn't it illogical to drive forward 50 miles and then see the wheel turned minus 20°instead of a) a positive value and b) a very huge value? Anyway, this was really just an example with which I tried to show the difference between a simple orientation (e.g. 1°) and one that came from a little journey (e.g. 361°= 1°obviously) and the necessity of the latter.
Why would I need this? I actually didn't question that at all because that's how it "naturally" worked last time, ages ago 😉 I built clock prototypes in the past and relied on this "winding up". Thanks for that term, by the way. I'm German and I wouldn't know which was the right one to use. I would really like to solve the issue at the source, not at one example. As much as examples may help to show the problem, they also distract from the original issue. Like trying to fix an error (setting up dozens of things that work in that particular case) instead of avoiding the error (simply allowing winding up in the first place).
So, this TCB Rotation controller seems to do the job. I made a second object that rotates only half as much using an orientation constraint with the main object and the world (so basically nothing) as evenly weighed targets. No jumps there. But that's this example. For any new thing, I'd need a new solution.
[edit] Stupid me built boxes. Quick and effective, right? No. I did not see child box' jump in its rotation because around its z axis it is perfectly symmetric. A sudden 180° turn looks like 0° and 360°. I extruded one face of the box to make it asymmetric, and now I see it jumps - quick 180° turns. So even if I set up the TCB Rotation controller for the first box, it does not pass the ability of winding up to the child box. I'd ask if I can combine Orientation Constraint with TCB Rotation to allow winding up there as well, but I'd rather don't dig this deep of this particular example [end of edit]
So when I set up this TCB controller, I need another window for the rotation, which I would live with, but it seems I need to set up key frames in order to actually type something in there. Maybe I don't want to animate (that's where the example distracts from the main issue). But let's say I want to animate, because often I do. So I set up two frames inside that Controller window. Then I checked the curve editor and there is no graph. Then I scrapped that and used the good old key frame bar (official name may vary) at the bottom of the window. There is also no graph in the curve editor.
I am used to having no key frames in the child object because it does not rotate in its own, but why not in the parent object? Complex graph behavior of the parent object cannot be done, once I set up a TCB controller? That asked, I'd rather know how rotation can wind up without any further steps that fix one problem, not avoid dozens of problems.
Definitely big thanks again, also for the images and the example file and mainly for your time!!
@Sam_Jay I'm glad I was of some help.
You lost me a bit on what you expect to happen especially with the "So even if I set up the TCB Rotation controller for the first box, it does not pass the ability of winding up to the child box" story. Can you post a file that shows the behavior of what you are getting and describe what you want to happen?
Yeah, I got a little lost as well 😉
So in the attached file, the dark (left) teapots are the parents, the light (right) ones are the children.
The blue teapot was animated, how I was used to. Press Auto, go to frame 40, rotate close to 360° by hand, then enter 0° in the rotation menu. Rotating by hand defines which way it shall rotate to 360°/0° otherwise how would it know? Entering 360° obviously doesn't help, hence the manual workaround. Anyway, the light blue has an orientation constraint, half the blue teapot, half the world, so it rotates half as fast as the blue teapot. When you slide over the 20th key frame, the light blue teapot jumps from +90° to -90° instead of turning to 91° and further.
The green teapot has a key frame at 10 and is rotated by 90° (so 1/4 of the blue teapot). I set up the rotation to go on (in out-of-range-types). I tried that in my desperation, but it didn't do the trick. The rotation graph (a straight line) goes on and on in the curve editor, but numerically (in the little rotation menu) the rotation angle goes up to 180°, then turns negative and goes down to 0° again and again, just as in the blue teapot.
The red teapot uses the TCB Rotation controller. Although it counts up to 360°, the light red teapot interprets 181° as -179° and thereby has a sudden jump in its rotation. Fun fact: Although I don't see the animation in the curve editor, I can extend the animation and let it go on and on. Once I did it and checked if the menu "Key Info" keeps counting up the angles beyond the 360°. It does not. This is beyond weird.
The brown teapot is set up to rotate 90° at key frame 10 and then continue to rotate. Weirdly the angles here also count up to 360° and then down again.
Ok, once I set all that up, I made the purple teapot. I gave it the TCB controller, went to key frame 80 and rotated it 720°. I did it because I was weirded out by that counting down from 360°. Well its values restart after the 720°, so nothing hopeful to gain from here. Needless to say the light purple teapot behaves like the other light ones.
I just realized, sometimes the rotation jump is at key frame 20, sometimes at 21. I would not try to figure out why because 🙂 that would be fixing something that shouldn't be.
So, verdict: Using the TCB controller has the angles winding up for the parent object. As for the children, any angle above 180° is seen as a negative angle equal to or below 180° and THEN multiplies it with 1/2 and rotates accordingly.
Any non-script help would be nice. I don't give up the hope that this winding-up behavior is just a setting, as I didn't have this issue before. I might check if I find an old 3ds Max on an old laptop and see if it really was how I wrote it. But nevertheless, it wouldn't change the present.
Please beware - I would like to have the parent to rotate properly for any kind of future endeavor. The misbehaving light teapots are just one example, one way of revealing the weird (imho) rotation behavior of the dark teapots. Fixing the light teapots' relation with the dark teapots might not help for the next thing. Anything that helps to make the angles of the dark teapots wind up, will help in the long run.
Thanks for reading!
@Sam_Jay
There are a variety of ways to associate the rotation of one object with another. These include wire parameters, function scripts, transform scripts, and controllers assigned in the motion panel. You used an orientation constrain to the rotation component of the transform for the teapot. It's inappropriate to refer to a child-parent relationship in this case. This is not the technique I would use to control rotation but it could work. Have you tried working with Wire Parameters? This might be the easiest approach but I think you'll need to use TCB controllers to allow for angle wind up.
You state “Rotating by hand defines which way it shall rotate to 360°/0° otherwise how would it know?” Rotating “by hand” has nothing to do with the direction of rotation. In fact, you cannot define the direction of rotation. Keyframe rotation values only store the current angle for a specific axis whether one of the Euclidean axes X, Y, or Z, or the axis associated with the TCB controller. The angle you see in the keyframe dialog is plus or minus the value from the previous keyframe. For euclidean rotation controllers the sign (+ or -) of the angle determines whether it's added or subtracted. For TCB controllers the direction of the unit vector defining the axis specifies the angle difference from the last keyframe.
Have you ever seen a movie of a spoked wheel that appears to be turning backwards? If the wheel rotation from 1 frame to the next frame is 10° in a clockwise direction then a series of 10° changes will appear to make the wheel spin in a clockwise direction. However, give the rotation or 350° for each frame, a series of frames in this case would give the appearance that the wheel was rotating counterclockwise.
Try using Wire Parameters as suggested by @wernienst with Euclidian rotational controllers and see if that does what you want. If windup is an issue change to TCB controllers.
Here is another file to play with.
The MASTER teapot performs 3 complete rotations up to frame 60 and then rolls back to 0.
The "Wired to MASTER" teapot is negative wired to MASTER and is rotating in the opposite direction.
The second teapot (top row) is constrained to MASTER and copies its rotation. The third teapot is constrained to both MASTER and "Wired to MASTER" via Target List and doesn't rotate (as expected) but changes orientation several times.
And the teapot down right is also wired to those via a Rotation List Controller. It also doesn't rotate as expected but gets mad when altering the weight values.
In conclusion, IMHO Parameter Wiring is best for simple relations.
I've also tried TCB and Smooth Rotation instead of Euler XYZ Controllers with mixed results.
Finally, I created this file in Old Max 2013 just to show that there is no change in behavior when loaded into Max 2024.
Have fun!
You asked "I[n] which way is "parent-child" inappropriate? Logically, technically or in terms of political correctness?"
Looking at the properties off both objects in your file you would see that their parent object is root. Therefore neither object is technically a child of the other.
You may think of an object as rotating in one direction of another but in fact the object is not rotating at all! It just appears to you to be rotating due to seeig an object at different orientations from frame to frame. As an analogy, think of an old fashion analog clock. All the hands rotate in a clockwise direction. Now consider a digital clock that is trying to look like an analog clock (e.g., a Apple watch). The second hand on it may appear to be rotating but what you are seeing is a sequence of lines (that have been rasterized) in different positions that give the appearance of rotating. Nothing is in fact "rotating".
When keyframing rotations you can specify an absolute angle or, via the transform type-in, a relative angle.
As an example, using Autokey set a 60° rotation for a teapot at frame 20. You will have,
Now move the time slider to frame 10 and hit Ste Key (or k), and you will add a key at frame 10 of 30°. The absolute value of 60 will remain at frame 20. My error if I said it would be relative. Entering an absolute angle is not an error. Sorry to imply otherwise. Note, you mention "the straight line in the curve editor". Its purpose is to show how the tween frames should be calcuated based on the previous and subsequent key frames. If you enter an angle of 1080 in frame 100 for an object that has an angle of 0 in frame zero the object will appear to make 3 complete revolutions in the positive (right-hand-rule) direction.
Since @wernienst is offline at the moment I hope he doesn't mind me answering your question "So can I use the same parameter for multiple wirings?". The short answer is Yes. You have a couple of options the choice of which depends on how you think you may want to change the rules later. For example, you could:
Option A
Object #2 references the angle of #1, Object #3 references the angle of #2, etc.
Option B
Object #2 references the angle of #1, Object #3 references the angle of #1, etc.
With Option A you do not directly edit the relationship between #1 and #3. You must edit #2's as well. With opton B, Object #3's angle relative to #1 will not be affected by changes in the wiring equation between #1 and #2.
Can't find what you're looking for? Ask the community or share your knowledge.