Jump to content
Sign in to follow this  

Making textures change randomly

Recommended Posts

MP4 is what most of my files are in so it's mostly a convenience thing...yeah, they can be converted no doubt, but I reckon that would fill a folder with an image for each individual frame which would be very large...is this true ?


I was thinking of doing it in post indeed, but I'm not sure how I'd go about telling my editor to replace just that one portion of the screen, since the scene is "moving", so the screens of the TVs will always be in a different place....powerful editors can probably do tracking and stuff, but I don't think I'm up to the challenge of learning a new editor just for 20 seconds of intro :))


Had a look at Xpresso to at least get an idea of what it does - it can get extremely complicated, but I got the general idea: a parameter changes others. How would this apply to textures though ? I saw the guy using it for sizes and stuff...

Share this post

Link to post

Many free Batch Converters to convert a whole folder of MP4's to whatever codec you need. 

Is a 2 gigabyte folder filled with PNG files still large in 2018? That shouldn't be an issue with todays HD prices.


The integration with AE (After Effects)  and C4D is very good for this. You just place a grid to the place where the screen is and give it an External Compositing tag.  And you can save out an AE file, and this will generate a composition with your camera and a  solid in 3D. And you can render separate passes for the reflection and overlay them. Plus side is it renders replacing the screen visuals is super fast because you don't need to re-render from cinema. But, if you don't know After effects, this route may be too much. And this works best for flat screens.


Xpresso is extremely powerful, and specific for what YOU need it for. So, what you want to do with it? The weakness, for me, is that when I start layering stuff, the Xpresso doesnt let me control those parameters, like a noise in a layershader.






Share this post

Link to post
2 hours ago, westbam said:

Xpresso is extremely powerful, and specific for what YOU need it for. So, what you want to do with it?

Well someone suggested I'd use Xpresso and I figured I'd look into it. Didn't look too deep though, like I said. I thought perhaps it could randomly switch between a video, static (perhaps a video file also) and maybe other videos too (like the TVs changing channels), since I ASSUME it's just a matter of getting it going and then you can tell it to mess around with as many textures as possible.

Share this post

Link to post

Like the example Xpresso showed that Jed posted, you can switch between textures, but for your own convenience, you really need to understand the very basics a bit, so you can set up your own controllers (aka user data). 


The most simple idea I can can up for you is using the multishader. You can put all your clips in here, and than drive it with the color from a shader effector.

This only requires a Xpresso setup that applies a value to a color that is driving a multishader with all your videos in there.

I did the same for a material, where I made a noise, and the expresso is driving the alpha.

3 Nodes, super simple. (use interactive render region to see it)


But to be honest, you should just prepare your video the correct way.... or do it all in post.... C4D is not a video editor... or at least a very hacky one.




Share this post

Link to post

re: randomness in C4D - although I'm a big fan of using random events in Cinema, it does come with some caveats.


Depending how you set things up, you can have 'random and different every time' or 'same sequence of randomness every time'. It's quite possible to get a scene that uses random looking good in the viewport, then the render turns out different. I use Team Render and (if I'm careless) have often found my resulting movie (that has randomness) jumps around because each render node was producing different random timing.


The other thing is our perception of random. If I'm generating a random sequence of 0s and 1s, one run might give me 6 or more consecutive zeros - but you'd say 'there's an error - that's not random', but it is. If I bought a lottery ticket, and the numbers were 1-2-3-4-5-6, I'd probably think it had less chance of winning compared to more evenly spaced numbers. Six movies playing randomly might play as 1-6-1-6-1-2-1-6 etc - not what you'd want.


TLDR - I'd say compose the random TV screen manually in After Effects (or equivalent), and use the mp4 as the screen material.

Share this post

Link to post

I'll probably go down the easy route, which is composing the video in an external editor and loading it pre-made for the sake of time, but for the sake of learning and building skills, I might come back to it at some point, no doubt about it...not really on a deadline or anything - it's just for my own personal entertainment - though it would be nice if it didn't take all year either :))

Share this post

Link to post

Ok guys, update: I installed quicktime and now upon loading an MP4 file, the frame counters do show up (they're no longer 0) but the video's still black...

Share this post

Link to post

Sorry it has taken me so long to reply.

Here is an Xpersso Random Material Changer.

It was made with R11.5  in the hope that most folks here will be able to use it if they want to.

I have not given it a proper test but it seem to be working OK.


The probability Spline was an after thought that I added at the last minute, so, I am not sure how useful it will be.

Most of the controls are self explanatory  but I have included a few notes.

The coloured materials (1 to10) can be deleted and/or replaced with your own. But do not delete DESTINATION MATERIAL from the object manager or the materials manager.


Anyway, hope this helps.

Regards Bishka.


Any problems just PM me, I can't promise anything  but I'll try.


Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...