AML Template Tutorial

 

 

Switch TV

Want to watch TV? Want to change the Channel? You mean you want a TV that actually can turn on and off and change the channels? Ok, I guess that�s not too much to ask for. In this lesson you will learn about perform commands to turn visibility on or off for objects.

In this tutorial you will learn how to switch TV channels simply by using Visible Clips. To make it work, just set the target image plane visible, and let all others remain invisible.

In the illustration above, you can create as many images planes and attach the images planes (child nodes) to the TV (parent node).

Create the TV with Switch Channels in iClone

In iClone, you can use a single texture to simulate the animated texturing effect as the image follows.

  1. Create two animated textures.

         

         

Please refer to Animated Texture Online Help for more information about how to create Animated Texture. Animated texture ini samples are located iClone Template > Texture > Animated.

  1. In iClone, import a plane from 3D Blocks. Have the plane in selection and rename the plane "TVChannel01".
  2. Position the plane and load the material of the animated texture "TVChannel01_0_Diffuse" for the Diffuse channel.

         

  1. Add another plane and rename it "TVChannel02". Position the plane and load the material of the animated texture "TVChannel02_0_Diffuse".
  2. Drag a TV into the scene. Resize and position the image to the TV. Click "Pick Parent" in the attached section, and then select TV.

         

  1. Now both TVChannel01 and TVChannel02 are the child nodes of the TV itself.

         

Please make sure you run this project under PixelShader mode so that you can see the animated texturing effect.

Set Switch Channels in AML Scripting

  1. Select Perform Command and click "Add".
  2. Rename the command "TVChannel01".
  3. With the Right Menu enabled assign the hotkey "Perform1".

         

  1. Add a visible clip to TVChannel01 command. Rename it "TVChannel01-on".
  2. Set the attributes for the selected visible clip. Target Type: object. Target Node: $.TVChannel01, where "$" represents the parent "TV" and TVChannel01 represents the child which will be controlled by this command. To turn on the visibility of the animated texture check visible.

         

  1. Add a new visible clip to TVChannel01 to set channel visibility OFF. Rename the clip to "TVChannel01-off". Since we want TVChannel01 to turn off and turn on TVChannel02 (simulating changing channels from channel 01 to channel 02), we have to change target node to "$.TVChannel02".

         

  1. Follow the steps above to add a TVChannel02 command and two visible clips. Assign hot key "Perform2" to this command. This time, set TVChannel02's visibility ON and TVChannel01's visibility OFF.

         

  1. Add a new Perform Command to set all the channels OFF. Rename it "Turn Off". Assign hot key "Perform3".
  2. Add two visible clips to the command. Set one TVChannel01-off and one TVChannel02-off.
  3. Set target node: $.TVChannel01 and $.TVChannel02.
  4. Check off both visible. This will cause both animated textures to be invisible and only the texture of the �off� TV screen will remain, simulating that the TV has been shut off.

         

Here is the end to this tutorial. You may apply this concept to any other things for you to switch between textures or when you wish to turn on or off lights. The thing to remember is, when one animated texture is visible; make sure the other is invisible.