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
   
 
Can’t Iterate Clones in XPresso
Posted: 13 January 2022 10:10 AM   [ Ignore ]  
Total Posts:  4
Joined  2020-04-29

Hi
I don’t see an opportunity to iterate through the clones in XPresso. I was referring to this video: https://www.youtube.com/watch?v=bgYgcwTEGSU
and tried something as simple as just getting the indexes of the clones, but all my setups always returned only the total number of clones. I also tried with Data node, Iteration node and ObjectList node. But the result is alsway the same: insteaf of returning indexes the nodes return the total count.

Here is my example an the exmaple from the video for comparison:

Mine:
https://forum.c4d.space/assets/uploads/files/1642006386688-c93ea540-021c-4306-aa10-0f8be57bcb2e-image.png

From video tutorial:
https://forum.c4d.space/assets/uploads/files/1642006309120-f57d76ba-6624-4410-becb-cd34b3d4ecbf-image.png

Please, tell me what I’m doing wrong?
Thank you in advance!

P.S. How can I change my forum name? smile

Profile
 
 
Posted: 13 January 2022 07:48 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi licenses,

Yes, a great idea to change the name. Please use the contact us button in the lower-left corner. Thank you.

Please share a scene file, preferably as an attachment (zipped), or I can share an upload link if you have Cineversity Private Messages or email enabled. Your name didn’t allowed me to sent an upload link!

Images are super limited to explore what happens.

Please check if that works:
https://www.amazon.com/clouddrive/share/VQTmEmPZxiWp1D9KeSVcKmh9I8ga5m7jaJMNAhjWDbT

(If you share things, I use ONLY and strictly cloud services from Dropbox, Adobe, Apple, Wetransfer, Google, and Amazon. In times with ransomware, I really can’t just click everywhere; since I share a lot of files here, I have to be extra careful.)

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: 13 January 2022 09:45 PM   [ Ignore ]   [ # 2 ]  
Total Posts:  4
Joined  2020-04-29

Hello, Dr. Sassi
Thank you for your reply.
To begin with, I must say that we’ve found the solution (thanks to flashant). But it includes Python and I still wonder whether it is possible to iterate through the clones without Python? Because there is a special “Iteration” node and I assume it is done specifically for that purpose.

I’ve attached 2 c4d scenes in the archive:
can_iterate.c4d — flashant’s solution based on Python.
cannot_iterate.c4d — the suggested solution from Cineversity tutorial.

P.S. In general I understand why it doesn’t work in my case: because I’m just returning the total clones count for the each clone. But I don’t understand why it works in the tutorial, while it shoudn’t.

File Attachments
xpresso-iteration.zip  (File Size: 346KB - Downloads: 99)
Profile
 
 
Posted: 13 January 2022 10:37 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi licenses,

If the one above isn’t working, here is a UserData version.

Please have a look here:
https://www.amazon.com/clouddrive/share/LwkTODDw2Rs7cDrSXApeVNjoKcgy0fzHmGPhFdySfft

The idea is to provide the Text object with a UserData (UD) entry.
Then connect this UD with the Text field via XPresso.
Copy it one time, so you have two objects. Top UD is set to 1.
The second object gets a Clone>Count added into the XPresso. (Sort the X-Manager top to bottom)
The Cloner is set to Blend.

To stress this point, I have set the second text a little smaller in the example, just showing the options, indicating the Blend mode. Set it to the same size if needed, of course.

Your examples missed the point in the tutorial, which in all fairness was not explained, but there was a second Text in it, and the Cloner needs to be Blend mode for a progressive Sequence.

Is that working for your project?

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: 14 January 2022 05:29 AM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

P.S.: I have checked this with several releases, and the suggested setup works. Yes, as mentioned above, the tutorial doesn’t voice it, but it shows in the interface the needed settings. Not verbalizing it left you with the problem; sorry about that. I hope this post provides the missing parts.

Here is the file from the first part of the tutorial, Cloner set to Clones: Blend!
The Math node can have multiple inputs for this setup.
The first Text object needs the entry “1” to start the sequence. The second one will be the max (count) number. Since we start with 1, the count is the max. Note that clones start with zero, and the last id is Count-1, which is essential to know, as it can lead to problems otherwise. For example, the Link-List node starts over if the count is not adjusted to the ID. The ID starting from zero was used in the early days of coding, as the binary one is a zero. Bits back then were “expensive”. Today we use it anyway.

Example from the first part of the tutorial
https://www.amazon.com/clouddrive/share/g4j1UxS1dQE5EaEOUnCf4qEALcnGxlXyvbCmWcpZ9tT

Some more points:

• This doesn’t work in Render or Multi-Instance mode.
• If you use the solution from post #1, it doesn’t work with Clone offset.
• Using the MoGraph Selects/Hide Selection, the missing Clones will count.

I hope that solves all mysteries.

Enjoy your long 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: 14 January 2022 02:40 PM   [ Ignore ]   [ # 5 ]  
Total Posts:  4
Joined  2020-04-29

Thank you for your help. Now I get how it works!
And at this moment I stumbled upon the problem that I cannot do anything more with this index data rather than visualize it.
My initial question about iteration sounded like it sounded because iteration was the only one problematic point in my (bigger) XPresso setup. But at the end of the day what I’m going to do is to use the clone indexes as seed values for generating random integers. But with the Cloner blending it looks like I can only use those indexes for visualization (I might be wrong).

So, in short, is it possible to somehow modify each index value and apply the result to the correspondent clone?
Here is my example (again with Python). Here I’m using indexes as seed to randomize the number of clones: https://i.imgur.com/IGTww5z.png

And the main question is: is it possible to simplyfy the part highlighted with red? At least, make to it without Python?

Profile
 
 
Posted: 14 January 2022 07:48 PM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Licenses,

Here is a simplified file while producing the results in your image.
Example:
https://www.amazon.com/clouddrive/share/ZdfW7E7XDvOewB4pq7EPQWesUZpx5o3U3CmP2IBRkcl

First, you create with two Cloners the possible outcome, which is based on Parent Cloner set to Blend. This Cloner produces only a single result based on the two Cloners (child objects) beneath it. The Cloner also holds a Plain Effector with a field. This field is random and produces different values across the space. (Space: Global, Field or None)

At the moment the top Cloner places clones of that set up below, every single clone “reacts” to the random field based on the value that the random field produces for the Modify Clone value. In this way, the results vary randomly.

Is that working for you? Let me know if something else is needed. I’m happy to look into it. If it is a new question, please open a new thread. Thanks.

Any luck progress with the name change?

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: 15 January 2022 12:21 PM   [ Ignore ]   [ # 7 ]  
Total Posts:  4
Joined  2020-04-29

Thank you! That’s an interesting approach and I definitely will use it.

I wrote to the support team via the Contact Us page the same day when you adviced it, but nothing changed. Got no reply either.

Profile
 
 
Posted: 15 January 2022 05:18 PM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

You’re very welcome, licenses.

The more I know about your target, the better I might be able to support it. Let me know if there is any other idea.

Yes, please allow for some time with the change. I hope it is OK to thank you for your patience in this.

Enjoy your 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