JonnyChappsMedia   jonnychapps@gmail.com

Create Flashing Lights in Cinema 4D

Posted by admin On June - 6 - 2009

In this Tutorial I will show you how to create multiple flashing lights in Cinema 4d version 10 using Xpresso.

 


Example of flashing lights

Download Scene File

Starting Off

  • First, create a Null Object by clicking Objects -> Null Object. Name it anything you want, I used flashing lights.

  • Right click on the Null Object and choose Cinema 4d Tags -> Expresso

  • This is what it will look like:

Xpresso Tag

  • Click once on the Xpresso Tag to open the Attributes Window on the lower right hand column.

  • Click on User Data -> Add User Data. Change the name to Speed, the Data Type to ‘Float’, the Interface to ‘Float’, the Unit to ‘Real’, the Min to ‘1′ and the Max to ‘100′ and leave the step at ‘1′.

  • Next create 3 Omni lights. Make them any color you want and under the ‘General’ tab, choose Visible Lights -> Visible and check “No Illumination”.  Leave everything else the same.

  • Separate the lights and place them where you want them and rename them 3 different names like “light1, light2 and light3.


Xpresso

  • Now for the fun part…..Double click on the Xpresso tag on your null Object to open the Xpresso window.

Xpresso Window

  • Drag the Xpresso Tag onto the Xpresso Screen. Left click on the red box and choose User Data -> ‘Speed’.

  • Right click on the screen and choose New Node -> Xpresso -> General -> Time.  Right click on the Time Port and choose ‘Delete Port’  then left click on the red box and choose ‘Frame’.

Example

  • Right click on the screen again and choose New Node -> Xpresso -> Calculate -> Math. With the Math Box selected, in the lower right hand column change the Data Type to Integer and the Function to Divide.

Math Node

  • Right click on the Xpresso screen and choose New Node -> Xpresso -> Calculate -> Math. With the Math Box selected, in the lower right hand column change the Data Type to Integer and the Function to Modulo.

  • Right click on the Xpresso screen again and choose New Node -> Xpresso -> Logic -> Compare. Hold down the ‘Ctrl’ Key and then click and drag the Compare Node to make a copy. Make as many copies as there are lights to control, in our case 3.

  • Now drag each on of your Light Objects onto the Xpresso screen. On each one, right click on the blue box and choose General -> Visible Light.

  • Right now your Xpresso screen should look like this:

Screen no connect

  • Now to connect the Dots. Click the red dot under the Time node, and without letting go, drag the line out to the top blue input under the Math:Divide Node and release.

  • Connect the rest as follows:
  • Xpresso/Speed -> Math:Divide/lower input
    Math:Divide/Output -> Math:Modulo/top input
    Math:Modulo/output -> each Compare/top input
    each Compare/output -> the respective Light/visible light

  • This is what you should have:

Xpresso connected

  • Click the Math:Modulo Node and in the Attributes screen change the input to the number of lights your controlling. In our case, 3.

  • Click the top Compare Node and make sure the input is at 0. Change the  second Compare Node’s input to 1, then the third’s input to 2. If you have more lights you would just keep adding up one on each node.

  • Now close the Xpresso screen and click once on the Xpresso Tag on your Lights Null Object to open the Xpresso User data at the bottom of the screen. Click on the User data and change the speed to what you want. (The lower the number, the faster the lights flash)

Finished

Congratulations! You have just fininshed the tutorial and hopefully when you hit play the lights flash. If they do not, go back through this Tutorial again and make sure you did not leave anything out.

I have included the scene file which you can download here.

The file was created in Cinema 4d v 10 and may not work in earlier versions.

Popularity: 33% [?]

One Response to “Create Flashing Lights in Cinema 4D”

  1. Elnora Spoto says:

    I love what you are doing!

Leave a Reply

Search





Connect with JonnyChapps






Advertisements