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
   
 
How can I swap the same texture set across multiple objects using data sliders and Xpresso?
Posted: 26 February 2019 04:23 AM   [ Ignore ]  
Avatar
Total Posts:  121
Joined  2014-03-14

I have a model made of cubes that I am animating using Pose Morph. I want to be able to change the colors of the cubes as they morph to accentuate the final shapes. So I set up an Xpresso controller that lets me swap textures on a single object. However, when I expand that to control multiple objects with the same texture set, it doesn’t allow for individual control. All the objects swap the same colors at the same time, regardless of how I set the individual controls. Creating a separate control and texture set for each object would be too cumbersome for the application - which requires quick changes of colors as needed.

Going in I thought a better approach would be to use the multi-shader, but I didn’t see a way to control the switching from layer to layer with Xpresso. Entirely possible that I haven’t looked hard enough.

Sample files attached.

File Attachments
Texture Swapper Template.c4d.zip  (File Size: 73KB - Downloads: 30)
Box Morph Texture Swap Export.c4d.zip  (File Size: 117KB - Downloads: 35)
Texture_Archive.zip  (File Size: 36KB - Downloads: 29)
Profile
 
 
Posted: 26 February 2019 06:09 AM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi mford610,

Thanks for the files.

Yes, it works with one material. In the Box Morph file, you keep one material as well. You have many Texture Tags in it, not many materials. In your XPresso setup, the Bitmap Node is, based on that, each time the same. If you change the order in the X-Manager (XPresso), then the lower positioned Bitmap will win.
Whatever is the last one (lower) has the highest priority. In other words, it is then executed last and shown on all the cubes.  The “Panel” node has no effect at all, it reads a number and shares the same, it is not used at all.

You can either iterate through many materials or use a different setup, e.g., MoGraph based. The provided example below sets the cube colors to a gray value. This will in return select a specific image in the MG-Multi-Shader. The numbers and the gray values must correspond to each other. Have an eye on that.

Scene file and screen capture:
https://www.amazon.com/clouddrive/share/gDMHmJ5ovh8KH1pGwzBOzh0Tw2woxS19Q8EV2eUu4PR

The Multi Shader offers an excellent overview, which allows to use it as a reference to pick the image numbers from. The User Data interface of the Controller will give you quick feedback on what is selected at the moment.

I think that is the fastest and most organized way, if I understand your target correctly.

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: 26 February 2019 11:43 PM   [ Ignore ]   [ # 2 ]  
Avatar
Total Posts:  121
Joined  2014-03-14

Super! I knew there must be an elegantly simple way to do it.

Thank you!

Profile
 
 
Posted: 27 February 2019 01:11 AM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Thanks for the kind feedback, mford610.

I assume it will be 18 panels for now, so I completed the file accordingly.

Scene file
https://www.amazon.com/clouddrive/share/RQejjkI40PvcrMwTpV4HUz5XiiF4IpaG2DV9IlrAJlk

The Multi-Shader should always have 18 textures in it. IF you have a folder with 18 images, that is easy to load at once, after the other 18 are deleted.

Screen shot
https://www.amazon.com/clouddrive/share/oSsnOQWcwnP4NDpZ0XK1EjRJl3nVeuII4lTQg6Pfhv3

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
 
 
Posted: 27 February 2019 11:45 AM   [ Ignore ]   [ # 4 ]  
Avatar
Total Posts:  121
Joined  2014-03-14

Excellent! Thank you.

I don’t understand how 18 user data outputs feeding into 18 condition inputs can change the texture on 18 objects when there’s only one condition output - and it’s going into only one panel object. Is the key the iteration output to the condition switch? Or the Link List output to the object? The Formula operator? Egads!

These are all aspects of Xpresso I’ve never seen before, so I have some homework to do to reverse engineer it. Is there a tutorial on this by chance? I wouldn’t know what to search on.

Thanks for all the help!

Profile
 
 
Posted: 27 February 2019 12:03 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Thanks for the question, mford610.

Yes, you are spot on, the iteration is the key here.
There is a Link List, this list is iterated one by one. It provides with each step the Object needed at that moment. The iteration also goes step by step through the Switch. In this way, one object is supplied to the Object Node and at the same time the Switch “channel” provides the value for the object color. Then it goes to the next object in the list and the next entry in the switch. Link Lists start from zero to the max (amount minus one).

Does this make sense? It does it one time per frame (or each time a refresh of the editor scene happens), but for rendering, it moves one time per frame.

Let me know if you need something else to feel comfortable with this technique. It is powerful, but yes, it needs some time to get used to.

Perhaps this little clip will support your efforts:
https://www.amazon.com/clouddrive/share/0YapBAIETf1DfkVnN8s9rbiPUWxXZLyYgaS5GlVngtE
The information of the Null is shared with three objects (0-2) first, then only to two objects (0-1). Please note how the order in the Link List is crucial as well.

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 February 2019 06:56 PM   [ Ignore ]   [ # 6 ]  
Avatar
Total Posts:  121
Joined  2014-03-14

It’s truly magical! “Who knew it could be this complicated?”

Yes, I think I see how the iterator works, and how it affects all in sequence: the switch calls up each panel in sequence and “presents” it to the object node. Sort of like the object node is a kind of stage where the color swap is effected. Once complete, the former panel in its new color goes off stage right and the next panel enters stage left, and so on.

Probably best to not overdo the metaphors smile

I will have to spend some time digesting before I foray out, but I feel like I’m getting the theory anyway.

Thank you!

Profile
 
 
Posted: 28 February 2019 01:47 AM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Thanks for the reply, mford610!

Yes, that would be a good metaphor. The actors appear the stage, get their outfit and leave. Next!

It is perhaps complicated, but it has saved me a lot of time so far. Instead of connecting each actor by itself, perhaps hundreds of times, only one information flow is needed.

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