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
   
 
Use xpresso for mograph selection tag
Posted: 16 December 2016 06:28 AM   [ Ignore ]  
Total Posts:  10
Joined  2014-02-11

Hi!

I’m trying to build a rig where I select mograph clones with a user data input. That part works fine.

The selection then needs to be put into a mograph selection tag via xpresso to drive a plain deformer to scale up the selected clone. This is where it gets really tricky. I can’t find a way to solve this.

Here’s a link to the scene file:
https://www.dropbox.com/s/r0tieydlg1i2qgq/Clone Test.c4d?dl=0
If someone have an idea what’s wrong in this setup I would be so glad to hear.


Also – where can I find more study material around this subject?

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

Hi martinlofqvist,

I have prepared a little file that has that functionality. See link below.

The main element might be the formula.

The formula reads as such:
If input1 ($1) equals input 2 ($2), then it is one (In Boole= True) otherwise it is zero (Boole = False).
True or False is then provided to the selection, and result in selected or not.
The Iteration goes one time per frame for rendering (or more often in the Editor view) through the ID numbers of the given range (retrieved from the Cloner Object) Since count is total but the iteration counts from zero, we need to subtract 1.

In the screen shot, on the left of the XPresso Editor you can see as well that I have sorted the flow to keep it “clean”: Top to bottom.

Based on the nodes you left in your file, I assumed that only the selected one should be scaled. If that is not the target, please let me know.

All the best

Scene file
https://www.amazon.com/clouddrive/share/dGSgDJNNHbQ70ZZGvq0QEud6LjWqQKWDXVo0d37gz1D?ref_=cd_ph_share_link_copy
Screen shot
https://www.amazon.com/clouddrive/share/FMtLwaggij3zUuEibeoh2PneHH6E7GvWKKZe8f6Kkqo?ref_=cd_ph_share_link_copy

 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: 16 December 2016 04:54 PM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Where to find more about?

The main content can be found while using the filter options to separate the XPresso based content. OR just place XPresso in the Tutorial search.

The manual is certainly not a bad idea either ;o)

Since it is not just about knowing the “Nodes”, my advice is get to know the nodes by exploring them and if needed just ask.
The main power of the nodes are given when combined, which is a creative work, combined perhaps with some math and the knowledge about.

This can’t be really taught, as your target and ideas will lead the finding process.

I have learned it way back in time by exploring it in that way, as no tutorials were available back then. Searching the web might speed up the learning much more.
I hope that the forum here will help as well, as XPresso is a very individual and creative task. Please never hesitate to ask, as others might benefit from your question, who didn’t even thought about the question in the first place and get already (hopefully an answer!.

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: 17 December 2016 09:05 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

P.S.: I saw some Python lines in your example, perhaps this little sketch will give you some ideas.
Click on the Python Effector to get to the User Data in the Attribute Manager.
https://www.amazon.com/clouddrive/share/t7jxXtcEa78PGXFypGhGouggjMZsqwacVl0TuWgx9bw?ref_=cd_ph_share_link_copy

Much simpler, with just a very small entry into the Formula Effector: ?(id=trunc(f);1;0)
https://www.amazon.com/clouddrive/share/rhegB17I8HR9su1tsIUozxZRCf940QSbJuCBaPfVDe6?ref_=cd_ph_share_link_copy

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: 18 December 2016 09:57 AM   [ Ignore ]   [ # 4 ]  
Total Posts:  10
Joined  2014-02-11

Hi Sassi!

Thank you very much for the detailed example and explanation.

The result is working! (woho!)
But I do not understand all parts of the xpresso setup. Which is frustrating. I’m attaching an image with questions. Do you care to explain the things I didn’t quite get?

It’s mainly the concept of how to use the Iteration and Forumla nodes that I don’t quite get…

Best

Profile
 
 
Posted: 18 December 2016 04:58 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi martinlofqvist,

Nice that it works for you.

Yes of course I will answer your questions. :o)


“Subtract by 1 to compensate for the array starting at 0?”

Yes exactly. As the Count is a total number like three , but the index number would be 0, 1, 2 for the three.
To the best of my knowledge, in the early days, memory space was expensive and the first bit 0/1 would be wasted to 50% if the zero wouldn’t have been used. Since then, often but not always, things start with zero.


“Why do wee need this Node? The output from it is 84 - same as from the subtract?”

The output from it is zero to the maximum value. It counts one time through the complete series of numbers, each time a new frame is given during rendering. While editing a scene typically while the scene is refreshed. In this set up it goes so fast that you see only the maximum value.
We need this Node, to create a individual scenario for each ID of Each clone to be processed. If a number is given out, all the connected expressions will be calculated or executed with this number, If it is done, the “Iteration” moves a step forward to the next.
In this way, we create an situation that “digests” for each clone and its selection entry in the tag “Index/Selection”, step by step.


“The Formula compares which input is greater and the result get computed? Q: Could not this been a Compare node?”

Yes, that is exactly what one could use as well. The compare node is flexible enough to do so. I use the Formula node based on its flexibility and that I can expand it later on without rebuilding parts of the scene. Perhaps one more input and another “If - Then” condition… Again, yes, compare would have been possible here.


“Feeding the result from the Formula and the value from the iteration. I don’t understand how this works…”

Think of a simple excel sheet where you have values in organized based on index numbers, 0- 84 for example.
the values in this tag is simple: Selection Tag feeds the “excel-sheet” into the Node.
This sheet is then addressed row by row. Which would be the index number, counting from “Iteration Start to Iteration Finish”.
While it is at a specific number the formula decides which number or row should be come a “Selected” Not select equals zero and selected equals 1.
Since you wanted to have only one clone scaled up, the only time the entry is “one” or in Boole terms “True” is when the “Controller” is equal to the “Iteration”.


====

I hope this gives you a starting point to explore it again and built your own set ups ASAP.

Let me know if there is something not clear, I will try in an other way then, until you feel comfortable.

Often when I was asked how to learn XPresso, as you did above, I answered that the first thing is certainly to know the difference of Integer, real, etc values, then Vector and Matrix, Local and Global as well String and Boole.
There is certainly more, but this is the core information that flows through the wires of Xpresso.

Also, have a look on the left of the XPresso Editor, the X-manager. THese entries should flow in sequence, will say from top to bottom, or how the information flows. In other words, is the inforamtion available when it is needed? This is often figured out by XPresso, but to support this flow is certainly helpful. Just drag the entries. It helps me to think it through again and find maybe mistakes I did earlier. wink

ENJOY

 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: 19 December 2016 02:06 PM   [ Ignore ]   [ # 6 ]  
Total Posts:  10
Joined  2014-02-11

Excellent. Thank you very much!!

Profile
 
 
Posted: 19 December 2016 02:49 PM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

You’re very welcome, martinlofqvist!

Let me know if there is anything else.

My best wishes for your 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