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
   
 
Manipulate timeline with Expresso?
Posted: 23 September 2017 06:44 PM   [ Ignore ]  
Total Posts:  30
Joined  2016-10-05

Hello,

I made this simple example to build my question.

I have 3 moSplines, each one has its own spline (3 straight lines with different length)

This 3 moSplines have animated START/END position

The 3 have the same frame animation.

Timeline frame 0

Start 0%
End 0%

Timeline frame 50

Start 100%
End 100%

(In the time line “curve mode” I have changed the end animated curves in order to see the lines growing up)

My question is the following: Is there a way to change the position of the timeline in expresso?

What I want to do in this example is to change the duration of the animation based on the length of the splines. So the longer is the spline, the longer will be the animation.

I have attached the example.

Thanks smile

File Attachments
mosplines_EXpressoQuestion.zip  (File Size: 61KB - Downloads: 85)
Profile
 
 
Posted: 23 September 2017 07:26 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi JVerdugo,

Thanks for the example, always so much nicer to work on a question.

XPresso has no option to move keyframes. Python has, but it is not a simple task. Nothing that I would start to go into it here. Perhaps see the Cineversity WIKI about it or MAXON’s Developer forum.

Anyway, how to do it anyway via XPresso is, to set a max spline length. This can be also taken from the longest spline. The keys need to be set all to the longest wanted animation based on the longest spline.  With a Range Mapper one can now set the 0-100% values accordingly to the “Max L” [length] in relation to the “Var.L” for each.

To get the 100% set so the full animation is done quicker with short spline (compared to the longest or a given longest as constant, one need to move the Spline Interface of each Range Mapper. Note that you need to clamp Lower/Upper.

To get into the inner values of the Spline you need to drag the little icon into the XPresso editor. Keep it close to the Ranger Mapper main node, to avoid confusion. How to do it? Please have a look at this little one minute pointer. (download it for a better viewing experience.

Clip:
https://www.amazon.com/clouddrive/share/yxkql0aTVjWYNDlYk9yHjAgVQGTUS7CESsUQVYunfBW

I hope that helps.

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: 27 September 2017 10:06 AM   [ Ignore ]   [ # 2 ]  
Total Posts:  30
Joined  2016-10-05

Hello Dr. Sassi,

thanks for sharing this knowledge, very interesting.

However now I am more confuse than before smile. Is this solution able to iterate multiple splines?

You may want to watch first the video test and the expresso system here

The process:
I have done an illustration in VR with Quill, then I exported the alembic file with the splines information. I had to explode the segments of splines and get 899 splines, then I have created an iteration to link all this splines into the exact numbers of Mosplines. Because I wanted to animate each spline with randomly keyframes from start/end 0/0 to 100/100
Next I have iterated as well the cycles4d tag of every mospline to make the radius of the thickness depending on the length of the mospline.

I did this animation by hand, and just random “key time” values with x+rnd(x) formula. But this is very randomly, I wanted to know if I can accomplish this task with expresso and some inputs like length or color.

Now I wonder if this solution you have shared with me is possible with this system.

Thanks!

Profile
 
 
Posted: 27 September 2017 01:35 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi JVerdugo,

Yes, you need per iteration the length of the spline-object and then calculate the X value, based on a max value [constant], for the spline interface.

In this way, each spline object will be related to its very own spline interface and with that, the range Mapper will change.

That is the beauty of iterations.

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: 27 September 2017 01:51 PM   [ Ignore ]   [ # 4 ]  
Total Posts:  30
Joined  2016-10-05

Hi Dr. Sassi,

thanks for the reply.

So if I am understanding correctly, I should create a range mapper with a time node input and spline activated this will output the 0% 100%, then I drag the range mapper icon into expresso and link the spline lenght in the X(2) spline node and max length constant in the max input

For getting the max value I am thinking on creating a logic node that only print in console values higher than X to get low prints and discover max lenght. Is a better or more efficient way to do that?

Cheers

Profile
 
 
Posted: 27 September 2017 03:16 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi JVerdugo,

I got the impression that we need something more simple. Please have a look at the attached file. I work mostly with Iterations, not with the Object iteration. So, here is the file:
https://www.amazon.com/clouddrive/share/BuZLPzhECr65xv7mB2nMqZlkqPwlGAfcfM0BacOzEbz

It is not based on a Range Mapper or anything that needs too much attention. A simple math and thats it. I limit only the value for the end to max 1.0 (100%) so we have no problems there. Again, the offset of the MoSpline has a tiny value, which creates a more stable situation.
The Text is inside the object to see what is going on, you can feed any number to this Text, to see how things work. On the end it is not needed at all.


To get the max value that is something that needs to be known before anything else in the scene is calculated. So, why you can’t just set a Constant value and adjust that if needed? Since it need to be known before anything starts, that would be a manual step anyway, or it would take frame zero to do so, then switch everything. The simplest way to do so, is to have a plane mesh with enough points. That will be reset first to Y=0. Then each spline is calculated in length, and supplied to a point of the mesh (iteration step/index = plane point index). Then you take a Bounding Box and ask for the point that measures the highest Y. Simplest way to explain. (other than that, compare and store the larger value, then compare again, iteration. (Perhaps if you feel comfortable with Python, fill the values in a list and compare. I will not go here with this)

My best wishes

 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: 27 September 2017 03:34 PM   [ Ignore ]   [ # 6 ]  
Total Posts:  30
Joined  2016-10-05

Hello Dr. Sassi,

really thanks. I have looked at the formula and I can’t understand. Is the question mark a condition that has to be true every frame? In case yes, I don’t understand the condition if value1>=1;1;value1 I will be so intersted in knowing the theory.

Thanks

Profile
 
 
Posted: 27 September 2017 03:40 PM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Let me explain, JVerdugo,

?($1>=1;1;$1)

This is the normal writing for an Xpresso “if” statement.

If input $1 is greater or equal 1 then it is one, otherwise it is $1 (which means anything below 1 will stay the same, anything above 1 will be clamped.)

$1 or $2 are the input names of the Formula. The question mark introduces the if statement, then the condition comes, if true, then the first value, if not the second.

more about that:
https://help.maxon.net/us/#6194

Cheers

 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