How to rotate a mesh using a curve modifier and drivers without deformations

In Blender 2.82 I need to animate a character that is using a some kind of track for moving around ‘see pic’. I have used a curve for the deformation of the track and drivers to drive the track both along the X axis and ‘rotating’ following the Z axis. In the drivers properties I have a first variable for the deformation of the track and a second var_001 for the rotation on the Z axis… This is where I am lost. The track keeps deforming when trying to rotate on the Z axis… I use an Empty to drive the track… Can somebody point me where I miss something in my setup?282 GFF track rigging animation _01-01.blend (656.4 KB)
Thanks

I didn’t load with drivers, and your file doesn’t have an apparent animation in it, at least without drivers.

However, usually, if rotating a curve-modified object in Z axis doesn’t do what you want-- then don’t rotate that object in the Z axis. (It would be unusual to want to rotate a curve modified object, with x or -x axis for the modifier, in any but the local x axis.)

If I make a guess about what your goal is with this, I would suggest that you create an empty, parent both your curve and your track to that empty, and then rotate the empty in Z instead.

thanks bandages but :

If you have seen the pic showing the character you have seen that it is on an ovoid type of track/wheel… Having the wheel deforming along the x axis is ok. However if I want the character being able to slalom or turn left or right, then I need to constraint the wheel in its x axis to avoid its deformation… This is where I have an issue… Your suggestion to parent the curve and track to an empty does not work… In the blend file I did attach, the empty cube is parented to the curve and the track using ‘keep deform’… If I don’t keep deform then it does not roll at all. I took the track out to make it simpler but I did try that solution and it didn’t work… Where I think the solution may be is in the drivers to constraint the track by using the right type of constraint… I have tried all of the available and did not get the result I needed but I feel that it is somehow at that level… Off course I am not familiar with drivers but if I understand correctly how it is designed, it maybe that it is a euler rotation either in auto euler or one of the xyz euler selection in conjonction with the driver of the empty cube… Still cannot find out how to make it work…

… to add to my previous response, the wheel that you can see inside of the track where used for testing and those are turning when I rotate the empty cube… but the track is deforming as usual with the curve deform modifier…

I can provide the animation with the character but it is a large file… Just ask and I’ll provide a link to download it…

Thanks again

There are a lot of undefined terms being thrown about, so it would be easy for me to misunderstand. Just warning.

To rotate the tread around the curve, move the tread in its local x axis to rotate it around the curve.

To make the treat swivel a bit, rotate the tread in its local x axis, or change the tilt of one or more of the curve controls.

To rotate the entire structure, like to turn the character, rotate both the curve and the curve deformed object in the same way. That’s where you want a parented empty.

If the curve doesn’t have appropriate axes to make this easy, fix its axes (probably by recreating in default axes, so that parent with “keep deform” is same as parent without).

Here’s a quick file to demo. To make the tread rotate around the curve, move the cube-empty. To adjust the position of the entire structure, move or rotate (or scale for that matter) the cross-empty.

treaddemo.blend (108.5 KB)

If that doesn’t have the entire behavior you’re looking for, let me know, I could easily have misunderstood something.

Thank you for your suggestions. Rotation maybe the issue that cause the problem… I will work on the solutions you mentions and particularly the rotation of all the objects … Will let you know of the results and thank you again.

Ok I see that you did parent the empty to both the tread and the curve… That’s moving both and can turn both, but in that case the cube empty follows in sync and does not change the relative position with the origin of the curve which is needed to create the deformation of the tread as the tread is parented to the curve with deform… Still either I get the tread rotating around the curve on the X axis under the displacement of the empty cube but I may not parent the empty cube to the empty to be used for rotation… Also I saw that you did change from global space to normal? can you tell me why? I believe that to have both rotation and displacement for the character there is need for either rigging or drivers… but I maybe wrong as this is not my level of experience… I saw some tutorials using bones for rigging wheels, but in that case it’s simply rotation to be applied not deformation… Left the question is how to apply rotation and motion to a mesh without losing its shape or form? I also did explore shape keys but no success as as soon as the mesh is oriented out of the X axis it looses its shape…

I did try to ask on Stack Exchange but got no returns…

In attachment the animation of your setup and you will see that the empty cube follows the displacement driven by the empty and as such does not activate the deformation of the tread…

treaddemo anim tread deform if cube parent path.blend (107 KB)

It’s just how I have my startup file saved, that’s all. Doesn’t mean anything (since I have transform locks on the cube empty, which definitely can only ever move in local space, not world space.)

You have to also move the cube empty. In the case you’ve demonstrated-- following a path-- you can use a driver for this, but in many cases, you cannot. If you want to use a driver, you need to do some math (and perhaps measurement) to figure out exactly how much the tread needs to move.

Hey, I know Bandages is helping you out, but I’m just going to chime in here. First - you have rotations on ‘Empty’ which is a child of the path (BezierCurve), Not only that, but you must of ‘Parented’ the other ‘Empty.001’ to ‘Empty’ when it was rotated, Not good. Second - when you key-framed ‘Empty.001’ ‘X’ location, it’s the same - meaning there is no animation because the start value is the same as end value. And for the record - Drivers are not the answer, when working with curves and arrays and animating, this is a tricky thing, it’s all very much ‘axis’ dependent and there are pitfalls to this unless your doing it in a straight line (axis), it really is the same as animating tank tracks/treads, which Clockmender even wrote/scripted his own animation node to over come these issues. I am not saying it can’t be done in your case, but your mistakes are working against you. Sorry B, just had to put my 2cents in here.

ok thanks If drivers are not the answer, which I believe, then what is the answer? I read about rigging but could not understand how to keep the tread during a rotation using bones or else? I am reading about animation nodes and it seems that a solution for such a goal could be set… If I can make it work that way I’ll post the solution… In the mean time… Have a great one.

I’ll check on the rotations on empty you mention…

Well, you could move the box empty by eye.

If you want, you can measure the length of the path. I just did this by making a temporary strip of vertices, curve deforming it from the path, scaling until it reached the end of the path, then destroying the curve modifier. The length of that measuring strip is the length of path, which is how far the tread controller (the cube empty) has to move in the X axis. In your file, that’s about 33.4 units.

No worries, more people helping is better, right?

1 Like

I had to read it multiple times to get your point. So by knowing the exact length of the path and even when the path is twisted, rotating, by moving manually the cube empty it should rotate without creating a deformation of the tread that is driven by the empty? Hum! I’ll check on that now… Interesting… because rotating and deforming are two very different things in considered in 3D space global or local… Ok I’ll come back on that… I hope to finally make it work…

Hey, This is how I would go about doing it, this is going to be a sort of pic/text tutorial. First off we are going to work in ‘TOP’ view - due to the curve (BezeirCircle), re-shaped in ‘Edit’ mode. We have the ‘Cube’ re-shaped in ‘Edit’ mode, ‘Array’ modifier set to ‘Fit Curve’ (BezeirCircle), constant offset. Last we have an Armature - one bone- oriented to the ‘World’ axis in ‘Edit’ mode. All these objects have the same ‘Object Origin’ - 0,0,0 ‘World’ space. Next, ‘Parent’ the ‘Cube’ to ‘BezierCircle’ choose ‘Curve Deform’, that will put the ‘Curve’ modifier on the ‘Cube’.
Select the ‘Armature’ and put it in ‘Pose’ mode - select the bone, select the ‘BezierCircle’ then ‘Shift+Select’ the bone - ‘CTRL+P’ > Bone. Select just the Bone and go back to ‘Object’ mode, now we are working with the ‘Armature’ - in the Object Properties panel, change the rotation (XYZ) to ‘X’ = 90, ‘Y’ = 0, ‘Z’ = 90 degrees. Now we can go back to ‘Side/Front’ view. Select the ‘Armature’ go to ‘Pose’ mode and change the ‘Rotation’ mode to XYZ, lock X and Z.


So, the Bone in ‘Pose’ mode will allow your ‘Location’ and ‘Rotation’ for the assembly. To get the ‘Cube’ to translate the ‘BezierCircle’, you ‘KeyFrame’ the ‘X’ Location - DO NOT add a ‘Driver’ to do this - this WILL cause problems unless your going in a straight line. I, myself create 3 different ‘Actions’ for this, (1) Start, (2) Travel, (3) End - I put all these together in the ‘NLA’ editor. You can create one long ‘Action’ for this - that’s a personnel choice, but I use the 3 actions so I can re-use them.
Lastly, If you want all this to follow a path, I recommend using a ‘Follow Path’ constraint on the Bone and animate (KeyFrame) the ‘Offset’ - don’t hit the ‘Animate Path’ button - it’s linear, you have much better control if you animate the ‘Offset’ and you can still ‘KeyFrame’ the Bones rotation if you need to.

As I stated in my previous post, animating ‘arrays’ on ‘curves’ is a tricky thing - just search this forum for my name or animating tank tracks, you will see the pitfalls associated with this - this is the best solution (other than ClockMenders tank track AN node) I have been able to find, and I have put in over 100 hours of researching and trying stuff. Blender is great, but when it comes to ‘Rotations’, well I will just leave it at that :upside_down_face:
Hope this helps you in some way.

1 Like

Fantastic thank you to you… Great your solution is what I was intuitively looking for … Really thank you for your step by step and particularly for :

Select just the Bone and go back to ‘Object’ mode, now we are working with the ‘Armature’ - in the Object Properties panel, change the rotation (XYZ) to ‘X’ = 90, ‘Y’ = 0, ‘Z’ = 90 degrees. Now we can go back to ‘Side/Front’ view. Select the ‘Armature’ go to ‘Pose’ mode and change the ‘Rotation’ mode to XYZ, lock X and Z.<< That’s what I was missing or not knowing how to do …

Really great… thanks again…

I love the community and thanks to it…

1 Like

Ok guys Here is my take of the question. I did follow, test and study your suggestions and if one consider how to solve the deformation of a mesh during rotation and motion it is for sure a mathematical complexity that current software cannot handle very well. Then I read in a post that somebody did suggest to simply ‘visually simulate’ the effect that we are looking for… Yes that can be a solution but it’s not satisfactory intellectually speaking… So going through the parameters we can play with, and this under Blender 2.82, I did look at the array and did the fit curve was not a solution, but what about fit length? Once you have a mesh fitting the length of the curve it reduce at the maximum the potential distortions with the curve for as long as they are equal meshes elements than they are vertices elements in the curve -1…
Once you have adjusted your mesh to visually connect one can parent the mesh and the curve to an empty which then can be parented to a path. Ok that will not move the mesh given its origin will be locked to the origin of the curve. But if one position manually the origin of the mesh to a location ahead that correspond to the end of the displacement of the mesh during the animation then as you can see in the video, we get a rotation of the mesh all along the path… and we can rotate the mesh with the empty cube as needed… Ok I agree it’s not mathematically correct but one can make a scene animation with that… 282 Tread test _24_0001-0080.mkv (2.9 MB) 282 Tread and rotation _01.blend (723.8 KB)

AHHH…So you are talking about the mesh/object that is ‘parented’ to the curve with the ‘Array’ & ‘Curve’ modifier - that is being deformed ?? If so, That is simple to avoid, you use ‘Duplication’ - DupliFaces. You use a ‘Plane’ object, which is parented to the curve and has the array and curve mod - then you parent your part/object to it - on the ‘plane’ object you enable ‘DupliFaces’ and now you have a non-deforming part/object. You still use the ‘plane’ to traverse the curve (X Loc). I should have thought about that when I posted my second response - sorry about that :slightly_smiling_face:

Hey thanks @ajcdfin but using the plane makes that the mes doesn’t deform during translation and particularly along a curved path… What I did is to manually position the origin of the mesh that needs to deform with the curve, at the length of the path then I did animate the origin. The result is that during the displacement of the mesh along the path, it deforms normally but keeps its shape… Is you look at the video or the blend file I joined you will see that it is simple and for an animation it is enough as I don’t need to shoot the whole path, just when the mesh glide along the path in a curve… The motion of the camera complete the visual of slalom and turning… Thanks again for your help…

Hey, If you use the method I described in detail - but substitute a ‘plane’ for the ‘cube’ then
parent the’cube’ to the ‘plane’ and enable ‘DupliFaces’ - then you animate the ‘planes’ ‘X Loc’. This IS the tried and proven method of doing this type of thing. Your file you posted is flawed in several ways - some of which are repeats of your original file you posted, which I pointed out to you. First thing is your mesh object (Cube.001) IS being ‘deformed’ by the ‘BezierCircle’ because it (Cube.001) has a ‘Curve’ modifier - This IS exactly why you use ‘DupliFaces’. Second, you have ‘Empty’ parented to ‘BezierCurve’ (your path) and you tried to animate it (Empty) - but since you have your path (BezierCurve) animated, it is completely negated - look at your 'Fcurves for the ‘Empty’ - they are straight across - look at the number fields in the propery panel - they don’t change, Why?, because anything ‘parented’ to the path (BezierCurve) inherits its animation - this is old school stuff. I said “use a Follow Path constraint and animate the Offset because you have more control”, but you did not. Third, Bandages said “measure the path”, that means both of them, ‘BezierCurve’ & ‘BezierCircle’ - the length of ‘BezierCircle’ is going to determine how far it travels down the path (BezierCurve) to make one full revolution, yours runs far behind, too slow. Here is a file I created just for you, hopefully it will help you understand - but it’s nothing that I have not already stated.


DISCLAIMER: This file created in version 2.76, if using 2.7x it will open fine - if using 2.8x,
APPEND the objects from the ‘OBJECT’ folder.

OK but If I get the tire/tread rotating like a tread, I still cannot get the right setup to rotate it in the Z axis during translation… I have tried bones and drivers but if I believe I am not far from getting the rotation on Z axis working it’s still not there… I really appreciate if somebody could direct me to how to setup this rig… 282 GFF tire and wheel rotating on X but not on Z 01-2-02.blend (1.1 MB)
@ajcdfin I have tried your suggestions but I still could not rotate in Z axisi during translation along X axis… 283 GFF test translation _02_0001-0120.mkv (1.0 MB)