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
   
 
Sinewave Xpresso optimization
Posted: 07 February 2016 02:25 PM   [ Ignore ]  
Total Posts:  434
Joined  2012-01-05

Hello

In this scene file -
https://www.dropbox.com/s/uslx0i9q9ekdm19/SineWaveXpresso.c4d?dl=0
I have a setup that creates sine waves, with some user data to give me some control over the frequency, amplitude, speed and the time from which the wave starts (I need the line to travel straight before it becomes a sine wave - and the “mix” node is to create a smooth transition between straight and wave).

I have two questions
1/Am I doing this correctly or is it too complex a setup?
2/One thing I’m trying to add to the setup is the ability to move the null’s initial position individually.  So what I tried to do is use a Math:add to add the current position of the null to the sine wave operation.  Howver, as you can see with the Null I applied this to, it is also increasing the wave amplitude dramatically. 
I guess what I need is some kind of rest position?

What is the best way to achieve this?

Thanks!

Profile
 
 
Posted: 07 February 2016 05:16 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Alex,


My ideal would be to have the XPresso Null as a child under a Parent. The parent allows then for the initial position. This needs then [local] “Position” instead of “Global Position’ in the set up.

A typical set up to add the initial position, while changing the position over the the project time, results in a problem during start, frame zero.

The Null for the Tracer must be re-positioned to the place it was plus the distance you like to have as individual position. Which is certainly possible, but require an extra Time>Frame request with an Frame Zero Check [Node>Logic> IS Null] to feed a different and then switch to the add new value to current position. Which kind of makes me thing that we can’t avoid the “Global Position” then. Otherwise any parent will overwrite the values..

Lots of stuff, just to avoid the Parent Null as in the example.

The XPresso version to do that has another problem, the MIX. If you change the Switch time from “flat line” to Sine, this mix value has to be adjusted in time so you get really a nice transition. Which would be possible to do in XPresso as well perhaps with a “Mono-Flop”. … and it becomes even more complex. I have even sorted the XGroup for you, so if you like to try, it might be a better start. I have sorted the Nodes as well, to have no crossing lines and to make the flow of information a little bit clearer. Doing XPresso since over a decade have shown me, that any “salad” aesthetic will make it hard to dive in a month or so later, hence my left side is the given or input, the middle always the “computing” and the right side always the result. It is worth it.
As a side note, to use Object inside, e.g., Null.4”, you can set them to relative or absolute in the Attribute Manager, which allows for an much easier use of the XPresso Node. I certainly like XPresso a lot, but I always look for the more usable solution.

What I would simplify would be in the …XPsw_02 file, why having a time switch and a MIX slider, this could be done in one. Note that I have deleted the Constant Nodes as well, as an unused port uses the values in the Attribute Manager. Just animate the Mix slider and you are done.


======

Having said that, let me show you an alternative. Which is easily set up, and can be copied and reused many times, has a slider build in, and is set up in seconds.

I use here an Objects>Empty Polygon, in which I have added in the Structure Manager one line, so it has a “point’ at Pos zero [xyz].

This point is then moved forward with a Time Effector set to Attribute Manger>Deform>Object, and set in its Parameters accordingly in position for that movement.

Then I used a Formula Effector in the same way [deformer.object] and here the parameters to get the up and down movement, which is set up for sine by default. The Time slider below is working for the Effector. Note that the Tracer records only one position per frame, so Nyqvist theorem based, there is a limit.

The real beauty with the Formula Effector comes into the game with the falloff. Which is the transition from flat line to sine. Easy to set up, to adjust and to move, all of that visually.

All the best


The reduced XPresso:
…XPsw_02.c4d
https://www.amazon.com/clouddrive/share/5OntXdIK6IrrnsMIP4hdMmung3wd2WnTnMvTc7wlRlg?ref_=cd_ph_share_link_copy

File Attachments
CV2_r17_drs_16_MGsw_01.c4d.zip  (File Size: 49KB - Downloads: 145)
CV2_r17_drs_16_XPsw_01.c4d.zip  (File Size: 54KB - Downloads: 136)
 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: 07 February 2016 05:49 PM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Here is an one minute clip of the MoGraph version. The Falloff could be also set to, e.g., Cube or even to Source [Particles]

https://www.amazon.com/clouddrive/share/WhrBYQstmkLvCnOxSntxFGKUGN3MRbKSjBXGtBdQnC2?ref_=cd_ph_share_link_copy

You can download the clip.

 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: 10 February 2016 02:51 AM   [ Ignore ]   [ # 3 ]  
Total Posts:  434
Joined  2012-01-05

Sassi

I’ve just seen this response now for some reason, and this AMAZING!  I just learned so much just by reading these posts.  Very excited to apply this!

Thanks!

Profile
 
 
Posted: 10 February 2016 02:53 AM   [ Ignore ]   [ # 4 ]  
Total Posts:  434
Joined  2012-01-05

Ah, just as I was about to watch the video you uploaded I got notified the file is no longer there.  Did you remove it from the cloud drive?

Thanks again

Profile
 
 
Posted: 10 February 2016 02:57 AM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

You’re welcome, Alex, thanks for the nice feedback!

I haven’t taken any files down, please let me know which file (post number #?)  and I will check. But please try again and perhaps press the refresh.

If it doesn’t work, I will instantly change the “share” options, or use drop box.

All the best

 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: 10 February 2016 03:10 AM   [ Ignore ]   [ # 6 ]  
Total Posts:  434
Joined  2012-01-05

A refresh fixed the problem…This is such an elegant solution, I really feel like a few new pathways in my brain were opened…

Thank you!

Profile
 
 
Posted: 10 February 2016 03:11 AM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Great, I love to hear that!

Alex, let me know if there is anything else, I’m happy to look into it!

My best wishes for the project!

 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