Traffic Lights

Posted in Cinema4D Misc on January 27th, 2012 by Tim

Here is a quick post to share a piece of python code that I use in nearly every C4D scene these days. It is really simple and all it does is take the current state of the objects “Visible in Editor” parameter and apply it to the same objects “Visible in Render” parameter.

I use this to hide objects that I don’t want to render. You can of course simply keyframe both parameters, but this means you only need to key the Visible in Editor parameter. Another option is to use a Display tag which will also allow you to keyframe the object visibility. So it is nothing revolutionary that I’m offering (sorry about that ;)

The reason I use this is simply because you have a visual indicator in the Object Manager of the current state of an objects visibility, you don’t get this with the Display Tag unfortunately. Would be kinda cool if the eyeball closed to indicate visibility, similar to PS layer switches.

Anyway here’s the code, simply copy and paste this into a Python Tag and then choose File > Save Tag Preset in the Object Manager. The tag will be there for you every time you need it.

Start copying here…

import c4d
#Welcome to the world of Python

def main():

# get object tag is attached to
obj = op.GetObject()

# get visibility from editor
visibility = obj[c4d.ID_BASEOBJECT_VISIBILITY_EDITOR]

# pass editor visibility to renderer visibility
obj[c4d.ID_BASEOBJECT_VISIBILITY_RENDER] = visibility

…Stop copying here

Thanks to Patrick Goski who actually wrote this little snippet of code.

By the way if you get errors when you copy and paste this, it may be because of the formatting, so make sure you don’t use tabs and that it looks like this..

pythontag

Python Tag

Tags: , , , , , ,

Cloner Visibility through Effectors

Posted in Cinema4D MoGraph on June 23rd, 2009 by Tim

When using MoGraph in Cinema4D, the effectors can be used for several things other than affecting the position, rotation or scale.  Another option is to control the visibility of clones. If you switch to the Parameter tab of an appropriate effector, scroll down and you will see an innocent little check box labeled Visibility.  Now you won’t find this on all the effectors as it just wouldn’t make sense on some of them.  On the effectors where you can use it however, this check box  . . .  believe it or not  . . . makes clones visible or invisible!

Visibility Checkbox

Visibility Checkbox

You can use this to simply control which clones are visible and which are not.  Of course you can use the Falloff to control this too.  I’m made a small example scene that demonstrates this using the Random, Shader and Step Effectors.  Although the Step Effector is only really using Falloff as it’s control.

Here’s a preview of the result.

You can download this example scene here.

Tags: , , , , , ,