User data Mat switching works now

Quick update on this. When I saw they added user data to the nodes I figured it would probably be doable now.

Useful for those of us that do product viz with many variations of cmf’s.

Pretty simple setup, add a vray object tag to a null, doesn’t matter if its empty or not; you are just using it to pull data from. Then feed that into your xpresso with your integer user data driving the vray tag object id field. Then use the User Integer node in your material set to VRay_ObjectID. I personally created a Group with ports to have a cleaner setup, you dont have to. Then in that node for each layer you will need to have a Float Arithmetic node with the User Integer plugged into Float A of each node you have. Then you simply set them to Difference and go one value higher than your user data value.

In my case the 0, 1, 2, 3. So 3 Math nodes needed set to 2, 3, 4 so that they correctly activate blend node layers as you click through your user data interface. Then 3 separate outputs from the group node to drive each separate layer. Thats all.

Not the cleanest or smartest setup but works for now :slight_smile:

Hey @seth_richardson thank you for sharing this interesting setup.
Our other V-Ray integrations have a V-Ray Switch material type that switches between different materials based on a value or a texture. It should save some time when doing such setups. I’ll check with the devs to see how much time the implementation could take and add it to the roadmap.

The switch material would be really helpful. Its a great solution for product viz with multiple variations. great for multiple hdri-s when lighting! It would be really great to have it in cinema! :slight_smile:

Hello @akos_kiss

I wanted to let you know that the Switch Material is now supported by V-Ray for Cinema 4D. You can find it implemented into the latest Stable build: Chaos
You can find it among the other Materials: http://ftp.chaosgroup.com/support/scenes/Cinema\_4D\_2023-09-14\_12-06-26.mp4

Feel free to test and share any feedback you may have for us.​