A new version of Cineversity has been launched. This legacy site and its tutorials will remain accessible for a limited transition period

Visit the New Cineversity
   
 
sewing machine
Posted: 28 February 2014 08:19 PM   [ Ignore ]  
Total Posts:  19
Joined  2007-04-23

I was wandering how I can control a sewing machine head to move up and down continuously in relation to moving on its x?  When the sewing machine stops moving on x the head stops moving up and down.  I can use set driver to animate the head one way but not back down again and repeat.  Probably more complex than I imagined.

Profile
 
 
Posted: 28 February 2014 09:31 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Fortie,

It is rather simple to do, as the two movements are mechanically connected in a sewing machine. In the moment the needed goes down into the fabric, the transport has of course to stop, but if the needle is above, the movement up and down in that area is always in sync with the transport movement. The transport moves down on the way back to not move the fabric back of course.

I have attached a scene with a motor. This motor is just a Null moving up and then moving up again. Have a look to the F-Curve, it is repeated. If you like to increase the speed—move the second keyframe to the left, perhaps lock the parameter value in the Attribute Manager as I did already for this. Note that the full motion would be 400units, but the last frame of the cycle and the first first frame would be doubled then (so 400*44/45 to get the value of the last frame if the cycle is 45)

The idea is to have a sine curve like motor information and relate via “Range Mapper” all the movements needed for that. Each value has a “Range Mapper” and the Spline interface adjust the needed value for it for the whole cycle. As the motor delivers already a sine curve (rotation) the “Range Mapper” can be done linearly, but can be done in a curve (like I did for the Needle—an artistic freedom ;o).

Good Luck with your project

Sassi

P.S. CMotion could be used here as well, but XPresso seems to be simpler to set up.

File Attachments
CV2_r15_drs_14_ANsm_01.c4d.zip  (File Size: 26KB - Downloads: 112)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 01 March 2014 06:31 AM   [ Ignore ]   [ # 2 ]  
Total Posts:  19
Joined  2007-04-23

Hello Dr Sassi. 

Its good to put a face to a name (or voice) as I have been doing many of your tutorials on here.  Thank you for your reply, I have attached a scene file as my animation is slightly different to what I might of described.  In the scene file I have included what I am trying to achieve.  This uses conventional keyframes but as I need many animations of this I need more of a robust solution. What I am trying to work out is when the machine moves forward (on Z axis only), it activates the up and down movement of the mechanism.  When the machine stops moving(on z axis) the sewing mechanism stops moving and and down.  Hope thats more clear, sorry if confusing.

File Attachments
sewing machine_V001.c4d.zip  (File Size: 133KB - Downloads: 115)
Profile
 
 
Posted: 01 March 2014 04:18 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Fortie,

I get your idea now, you like to have a traveling sewing machine.

If you like to have that kind of interactivity, just the movement is animated and the up and down only triggered from it, then have a look to the file I have attached.

In a nut shell: the up an down movement needs to be stored somewhere. So I animate a Null Object and use this in an Inheritance Effector, which is set to Deform>Object. The Null is dragged into the field Attribute Manager>Effector>Object, and the Inheritance Mode is set here to “Animation”. The key part is a very tiny Falloff which is set to Inverse (All in the Falloff tab of the Effector)

The idea is now to use the “Previous Position” of the needle and transfer this to the Inheritance Effector via a simple XPresso solution.

In the moment the Needle (cone in the example) moves, the previous position moves the Inheritance Effector away from the Needle and the animation from the “Null/motion” is transferred to the Needle. In the moment the Needle stops, the motion stops a frame later. If it stops slowly, the mini falloff works toward this.

I have set up the Null/motion animation based on the idea that a forward move an a sine like up and down motion wouldn’t work, as the needle would stop the motion in the moment it dove into it. Based on that, the movement to and from the lower part is faster. If you have worked on a sewing maching, you might have notice, that pulling on the fabric results in broken needles. ;o)

All the best

Sassi

File Attachments
CV2_r15_drs_14_ANsm_11.c4d.zip  (File Size: 39KB - Downloads: 107)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 01 March 2014 04:27 PM   [ Ignore ]   [ # 4 ]  
Total Posts:  19
Joined  2007-04-23

Thanks Dr Sassi.  Brilliant as always!!

Profile
 
 
Posted: 01 March 2014 04:49 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

You’re welcome, Fortie.

Have a great weekend

Sassi

P.S.: ;o) Besides that the CMotion could do such animation along a spline, perhaps this option might be worth to mention. Just to give you a variety:

As a little side note, you might utilize the Position Velocity of the travel movement, to multiply it with the up and down movement (Null/motion times velocity times adjustment [range-mapper] equals “up and down only while travel”).
As you need only P.Z animations for the travel, the velocity can be read out then via Adapter>Vector to Real. Certainly a little bit trial an error work, but perhaps it works. With the Range mapper you can also limit a max movement. But if the velocity is zero, the up and down is zero. The up and down dynamic is changing, not the frequency though.
Just a sketch—see file

File Attachments
CV2_r15_drs_14_ANsm_21.c4d.zip  (File Size: 63KB - Downloads: 110)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 01 March 2014 05:16 PM   [ Ignore ]   [ # 6 ]  
Total Posts:  19
Joined  2007-04-23

Maybe we should leave this till Monday but Is there a way to activate and freeze a motion clip using expresso?  So when I move a null it activates a cube moving up and down and when I stop moving the null it deactivates the cubes movements..

I got this far then got stuck..  This moves one cube on Y a value when another cube moves X which is the same as a set driver which is annoying.  I couldn’t workout how to get the cube to move up a value then back down a value….. you mentioned to tweak the range mapper to do this, can you explain bit more please?

Profile
 
 
Posted: 01 March 2014 05:52 PM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Fortie, I have not found yet an option to get values from XPresso to the Timeline. Perhaps someone with a savvy Python/C.O.F.F.E.E. background might know a way.

The Range Mapper allows to adjust the motion from a little above zero velocity to limit it to a certain velocity, so a nice speed for teh up and down is possible with out extremes based on the travel speed.

I guess one point in your set up above will be the characteristic of the “Condition/Switch”, as this might lead to jumps in the motion. Perhaps smoothed with a Delay effector?

However:
Given the simplicity of the z-travel only, how about the idea of the file attached?

I think it is the smallest set up and you get only up and down movements while the object is traveling in Z.

sin is for the up and down, based on the idea that it is rotational based, 360 would be the only number, smaller leads to shorter cycles, but with a cut,
mod allows to set a certain relation to the distance,
abs avoids polarity problems (+/-), and the
number—the smaller the faster the movement, as it relates to the distance-p.y (the number could be replaced with the “f” slider.)

Have a great weekend

Sassi

P.S. see below, I have update version _31 to v_32 so the frequency is adjustable.

File Attachments
CV2_r15_drs_14_ANsm_31.c4d.zip  (File Size: 47KB - Downloads: 114)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 01 March 2014 05:58 PM   [ Ignore ]   [ # 8 ]  
Total Posts:  19
Joined  2007-04-23

Thats perfect!! Thanks, you too.

Profile
 
 
Posted: 01 March 2014 07:56 PM   [ Ignore ]   [ # 9 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

It was fun to explore, so thanks as well. :o)

Here a version with a slider to set the “frequency”—the f slider. (The “tracer” is only to show—it has no impact on the scene)

File Attachments
CV2_r15_drs_14_ANsm_32.c4d.zip  (File Size: 78KB - Downloads: 122)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile