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
   
1 of 2
1
Mograph - How would I create a multi dimensional bar / area graph
Posted: 05 March 2021 07:14 PM   [ Ignore ]  
Total Posts:  9
Joined  2021-03-05

Hi All,

Im having difficulty getting my head around this one.

I’m trying to create a multi dimensional bar / area graph that is using a Matrix Object to define points from CSV and each needs to have their own value of height from CSV file?

I’m currently using an Object to define points in the structure but how do I set the heights as i’m using the structure to define where all the locations of the bar graphs.

Do I need to go to python scripting or is there a way to link more than 3 columns of userdata?

Do I need to jump into python or can I get around with importing ascii data?

The full thing I need to do is have a the bargraphs animation with a full matrix per keyframe but I can start by just solving viewing one keyframe of the bar graph

Let me know if you can help on this one, much appreciated.

Cheers!

Profile
 
 
Posted: 05 March 2021 07:56 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi stevehuon,

If you have practice with Python, that will work. Maxon has its own developer forum for Python:
https://plugincafe.maxon.net/

A simple way would be to copy the values you need and paste them into a List or Tuple. Perhaps get familiar with Dictionaries. Which are easily set up, compared to read out documents.
Again, for any further Python, use the link.

In FXPHD.com (course c4d208), this was discussed in Class ten. It is kind of old: The given code works independent if you run Python2 or Python3.

There is a very nice Python course on Amazon Prime, which goes into the text options of Python, and how to search needed parts

LinkedIn Learning also has Python courses, though no at all anything related to C4D.

====

Since the Python code relies on how the text was structured, I would use the ASCII route as before, as it is simple and can hold lots of data. If you need an animation, you can have one document for each “key-point” and then use those to blend among them.

With some Xpresso, you can also read one imported ASCII data set and start for each new keyframe in distances of 10 or 20, … 100, etc.  (depending on your amount of data. If you do not think in X, Y, and Z, but rather in lines for each bar, you gain many options.

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: 05 March 2021 08:28 PM   [ Ignore ]   [ # 2 ]  
Total Posts:  9
Joined  2021-03-05

Thanks Dr Sassi!

Appreciate the fast response.

Is there a way I can link another Object structure container with the information to the height of each of the children in the Cloner that is linked to the Object Matrix for XZ position?

I was thinking for a quick fix now I could just link the 2 Object / Structures via a sort and then come back to it once I know python better.

I have:

Point, X, Y, Z as the Object importing positional data from CSV.

I just need to have another Object and to set height values for each Cloned Extrusion.

Attached is view of the Data as imported into object from CSV.

Appreciate the support.

Cheers!

Profile
 
 
Posted: 05 March 2021 09:37 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Thanks for the extra information, stevehuon.

Here is a little example:
https://www.amazon.com/clouddrive/share/t32Tfo0Elr2z6DHMyb6RJ1bOCUxOvtGLRBcGJU43HEr

You could change the object in each frame or use two objects with the math>Mix node to blend between these two.

Another way is to have for each frame an object in an Object List and iterate from there. (There is an option to daisy chain two iterations!)

I think it is more comfortable with a scene file in the discussion.
Let me know what you miss.

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
 
 
Posted: 05 March 2021 10:06 PM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

P.S.: This is the simplest Python I can think of.
https://www.amazon.com/clouddrive/share/XbmD1BO7E8gexHI9fxcgoG8rsdseWeOqFxd0gBHzn49

When you have your numbers in the structure: value-comma-value-comma, etc., you can paste them between the [].
Please test carefully before you use it.

 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: 06 March 2021 02:17 AM   [ Ignore ]   [ # 5 ]  
Total Posts:  9
Joined  2021-03-05

Thank you Dr Sassi,

I really appreciate your time on this. The file you sent me is really close. And I appreciate the python training.

In the file I have provided, I’m using a Cloner with an Extruded Shape, that gets its locations from a Matrix that is defined by Empty polygon with CSV data.

I have Values for height of these objects in Similar Matrix - Polygon Object files. I wish to animate from Values_01 in one keyframe and then animate to Values_02 (100 keyframes later) and then animate to Values_03 (100 keyframes later).

I like how you are using a Plain Effector to do this as that might give me some options for animation but you would know better than me.

Is it possible to set a keyframe or something that changes the object used for data.

If you could let me know how you would make this work and or update the c4d file I would be very grateful.

I really like Cinema4d!

Cheers!

File Attachments
Graph_Animation_002.c4d.zip  (File Size: 53KB - Downloads: 158)
Profile
 
 
Posted: 06 March 2021 05:55 AM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi stevehuon,

Here is your file back:
https://www.amazon.com/clouddrive/share/vBkzOOSUjVODIwlGoh45aWoSM8W3XTzSydR2xeqMVVf

I have set up three sliders for each “database”. You will find the user data as HUD or click one time on the Xpresso tag> Attribute Manager.

The values are fed into the Weight tag. The Weight tag defines how much of the Modify Clones in the Plain Effector will affect the Blend mode in the Cloner. The Blend mode creates a clone between the two child objects under the Cloner.

To “merge” the data smoothly, I used the max(a;b) formula, here with three values, accordingly max(a;(max(b;c))). For four values that would be
max((max(a;b));(max(c;d))) and so on. In that way, I avoid all priorities problems, the highest value wins. So, keep the other sliders at zero when only one value needs to be shown. It also blends nicely.

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: 06 March 2021 07:38 AM   [ Ignore ]   [ # 7 ]  
Total Posts:  9
Joined  2021-03-05

Thank you, Thank you, Thank you!

Perfect!

In all my years I haven’t had this much support and responsiveness help from anyone.

Thanks Dr Sassi.

I will update my project and let you know when it is finished. Thanks for your help!

Cheers!

Profile
 
 
Posted: 06 March 2021 07:41 AM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Thank you very much for your feedback, stevehuon!

Let me know if there is anything else. I’m happy to look into it.

Have a great weekend.

 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: 06 March 2021 09:59 PM   [ Ignore ]   [ # 9 ]  
Total Posts:  9
Joined  2021-03-05

Hi Dr Sassi,

Thanks for everything! I have one last update to the file and then I think it is done.

Are you able to use your great formula and link up the complete 16 Value objects to sliders?

I will then animate sliders with keyframes to produce 16 frames with transitions between.

Thank you!

Cheers!

File Attachments
Graph_Matrix_008.c4d.zip  (File Size: 136KB - Downloads: 147)
Profile
 
 
Posted: 06 March 2021 10:33 PM   [ Ignore ]   [ # 10 ]  
Total Posts:  9
Joined  2021-03-05

Ok i’ve wired up everything for 16 sliders, just need the formula for 16 inputs for max((max($1;$2));(max($3;$4))).

File Attachments
Graph_Matrix_010.c4d.zip  (File Size: 130KB - Downloads: 154)
Profile
 
 
Posted: 06 March 2021 10:38 PM   [ Ignore ]   [ # 11 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi stevehuon,

Just a pointer on how those things should be done: This should be solved with a Python List and get the max(mylist) from that list. But, the forum for Python is mentioned above.

Anyway, here is the formula, set up with 16 sliders, so you can see how it works. This would create a very crowded XPresso setup. Not really my taste.
https://www.amazon.com/clouddrive/share/arkiEkWzENlQ2n4D8d8Efy76XL0Fh2rg4eepY3T0p9P

As you were able to see, the left side has the starting point, the middle the processing, and the right side always its results. I got typically from top to bottom. The same way I list the X-Manager (super crucial at times!)
I dislike placing things all over the screen, and it becomes hard to read. Think of opening a convoluted Xpresso after a year. How much time would it cost to sort this out!? Messy is not pro-level. It never was.

So, to keep things organized, as two instead of three would work already, it could be even less. What I mean by that. Take a look at the file.
You pick a value, then animate the amount it is visible. Pick another and animate that while dialing back the previous. In the previous “value/set”, select a new data set. Etc.

I hope the image below makes that clear.

Enjoy

P.S.:
max((max((max(max((max($1;$2));(max($3;$4)))));(max(max((max($5;$6));(max($7;$8)))))));(max((max(max((max($9;$10));(max($11;$12)))));(max(max((max($13;$14));(max($15;$16))))))))

 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: 06 March 2021 10:54 PM   [ Ignore ]   [ # 12 ]  
Total Posts:  9
Joined  2021-03-05

I tried this for 16 but it has an error.

max((max((max((max($1;$2);(max($3;$4));(max((max($5;$6);(max($7;$8))));(max((max((max($9;$10);(max($11;$12));(max((max($13;$14);(max($15;$16)))))

It works for 8.

max((max((max($1;$2));(max($3;$4))));(max((max($5;$6));(max($7;$8)))))

Cheers!

Profile
 
 
Posted: 06 March 2021 11:05 PM   [ Ignore ]   [ # 13 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi stevehuon,

Sure, yours can’t work, as you missed some )))

When you check the file …XPmf_01.c4d, you will see that it works.

Here is a screen-capture:
https://www.amazon.com/clouddrive/share/QaEXV862oKInYhtqliEwZpQbmqvlUCYUz3SHFpzJL3k

That’s why I love scene files and share them.

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: 07 March 2021 12:01 AM   [ Ignore ]   [ # 14 ]  
Total Posts:  9
Joined  2021-03-05

I did miss some ))) smile

Thank you for going through all this, I have learnt a lot!

I just sent you a file and preview .mp4. If you have the time can you suggest a way to smooth out the transition from one object to the next?

I need it to transition smoothly from one to the next without adding extra data so fading from one object to the next. then I will be done! smile

You are amazing!

cheers!

Here is the link sorry file too large.
https://www.dropbox.com/s/pq4rruhn9s6l2iq/Archive.zip?dl=0

Profile
 
 
Posted: 07 March 2021 02:48 AM   [ Ignore ]   [ # 15 ]  
Total Posts:  9
Joined  2021-03-05

Got it. Thanks again. Everything is working well.

Cheers!

Profile
 
 
   
1 of 2
1