1
$\begingroup$

I have a car model I am rendering. I have several render layers I am compositing. It is simple enough to render and output the animation, but I also need to render the same animation from two different cameras. Furthermore, I need to also render from the same two cameras but with the car being a different color.

It was easy enough to create a new scene that is linked to the other so I can have a scene for CameraA and a scene for CameraB, both with the car being the same color: Blue...

I am going to use a Python script to render all of the scenes instead of me having to hit render for each one, but I cannot figure out a good way to create the scenes for the other color of the car. If I link the scene, changing the color changes it for all scenes. If I make a full copy of the scene, I could have the color be independent, but then I have multiple copies of cameras and everything.

I wonder if there is a way to make a material color change depending on which scene is active or being rendered. Any ideas?

(I am using Cycles, if that matters.)

EDIT: Here's a basic setup to see what I am wanting to do. If there was some sort of switch or script that would select the Blue node if rendering Scene1, the Red node in Scene2, and the Grey node for Scene3. enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

If you can afford to actually make a copy just of the car object, you can have two objects with the same settings but different material. For this you need to switch the material from Data to Object, otherwise it still has the same material for the same mesh.

enter image description here

However, if you can't copy the object you may have to do some python trickery to get it working. Below you'll find a quick test using a scene_update_pre handler function. This is called when the renderer updates each scene, so you can use it to switch colors or do anything else needed. You will have to adjust the handler according to your blend file and material setup.

$\endgroup$
3
  • $\begingroup$ What does it mean to switch the material from Data to Object? I don't know what those are or what they do. $\endgroup$
    – Ben Mora
    Sep 17, 2015 at 21:47
  • $\begingroup$ By default the material is associated with the Mesh data block used by the object. If you make a shared copy (alt+d) of the object, so that it uses the same data block, it would still share the same material as well. But if you switch this setting to Object the material is instead associated to the object itself, and can use a different material for both instances. $\endgroup$
    – lukas_t
    Sep 18, 2015 at 6:05
  • $\begingroup$ Unfortunately it won't work for me to duplicate the object. I know in theory (but I've not done it in Blender yet) that you can link data in interesting ways, such as, for example, link the Red channel of a color to the X distance from another object, or something like that. I don't suppose I could link the color in some way to the scene being rendered or the camera being used. $\endgroup$
    – Ben Mora
    Sep 18, 2015 at 21:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .