Slider Control in After Effects

You can link the Slider Control expression control to properties in After Effects to create a gui slider interface with a key-able value. An easy way to do this is to do the following.

  1. Make a null layer. Apply the Slider Control expression control effect to the null layer.
  2. Create an expression by option/alt clicking on the “stopwatch” of the property.
  3. Use the pick whip to connect the property to the Slider Control.



You can also link individual values of properties, the x position for example, to the slider if you highlight that value and then connect via the pick whip. You must be able to access the individual arrayed values of the property, so write your expression as below, for example:

[position[0],position[1]]



Highlight the value “position[1]” then use the pick whip to connect to the Slide Control. You will get this new expression as a result (if your null is named controllerNull):

[position[0],thisComp.layer("controllerNull"). effect("Slider Control")("Slider")]



Download example scene

The following expression is used to link a series layers to the slider. The “index” value is used to echo the layer number, here the z position of a 3d layer. The slider control is used as a multiplier on that value. The result is an accordion like effect.

[position[0],position[1], index*thisComp.layer("controllerNull").effect("Slider Control")("Slider")]

Urban Jungle 1


Mixture of photographic and 3d animation elements, and stock sound.

I like the feeling of these overgrown empty lots that you sometimes see around these parts. Trying to capture that mood.

Tools: Maya and paint effects.

MEL renaming

Maya has a built in re-naming tool, Rename Selected Objects, on the right side of the Status Line. Select Rename from the menu of line input operations, to the left of the input box.

image of Maya's Rename selected objects dialog

Basic rename script using Python:

#rename selected Maya nodes. Adds 4 digit padding to numbered name.
import maya.cmds as mc
mySel = mc.ls(sl=True)
count = 0
for obj in mySel:
	count +=1
	#customize name below
	mc.rename( obj, 'myObj2_' + str('%04d' % count))

Below are various methods to rename using MEL:

Simple approach

int $i; //Select the object(s) that you want to rename string $rename[] = `ls -sl`; int $selSize = `size $rename`; for ($i =0; $i <$selSize ; $i++){ //Change newName_, below, to the name that you want to replace. rename ($rename[$i]) ("newName_" + ($i +1)); }

Search and replace.
Designed to find and replace part of the name of similarly named nodes.

searchReplaceNames "myNode" "newNode" "selected";

This will change names in a selection. For example you can change 100 selected nodes names from “myNode000 – myNode100″ to “newNode000 – etc”. You can replace “selected” with “hierarchy” to rename all of the nodes in a selected hierarchy, or “all” to rename all nodes in the scene.

Search and replace 2

string $search = "myNode"; string $replace = "newNode"; string $Objs[] = `ls -sl`; for($obj in $Objs) { if(`startsWith $obj $search`) { rename $obj (`substitute $search $obj $replace`); } }

Rename and add custom number

//by pappapierre
//catch the object(s) current names, and clear your selection
string $sel[] = `ls -sl`;
select -cl;

//declare a string variable which will become your new name prefix

string $newNamePrefix = "myNewName";

//now run a loop to rename each elemnt in your selection list in the order
//they were selected
for($i=0 ; $i<size($sel); $i++){

//and rename your objects accordingly
rename $sel[$i] ($newNamePrefix + ($i+1));

}
//you can start your numbers anywhere by replacing the "1" in ($i+1) with
//your desired starting number.

Rename shape nodes:

//script 1. rename shapes unique names
string $rename[] = `ls -sl -dag -shapes`;

for ($i = 0; $i<size ($rename); $i++) {

rename($rename[$i]) ("myNewShapeName_" + ($i +1));

}

//script 2. remnameShapes (all the same name)

for ($i in `ls -sl -dag -shapes`) {

rename $i "myShape";

}

//script 3. rename types

for ($i in `ls -sl -dag -type “nCloth”`) {

rename $i "myShape";

MEL change attribute on multiple objects

Using the channel box or the attribute spreadsheet are good ways to manually change attributes on multiple selected objects.

In MEL, this script is set up to change attributes on selected nodes in the scene.

string $mySel[] = `ls-sl`; string $name; int $arraySize = `size $mySel`; for ($i = 0; $i < $arraySize; $i++) { $name = $mySel[$i]; $myNode = ($name + ".rotateX"); setAttr $myNode 100; }

If you want to make changes to the shape node, you will want to use ls -sl -dag -leaf:

string $mySel[] = `ls -sl -dag -leaf`; for ($each in $mySel) { setAttr ($each +".attribute") 1; } print $mySel;

MEL switch statement

$x = "bob"; switch ($x) { case "bob": print ("Hi Bob"); break; case "tom": print ("Hi Tom"); break; default: print ("Who's that?"); break; }

After Effects tips

Command + forward slash (apple), or control + forward slash will bring selected footage items into an open composition.

Command + option + forward slash (apple), or control + alt + forward slash will replace selected footage in the timeline with selected footage from the project panel.

Hit the asterisk key on the numeric keypad to add a layer marker to a selected layer at the current point in time.

Command/control + Y creates a new solid. Command/control + shift + Y opens solid settings.

Press the u key to reveal all key frames. Press uu to reveal all modified parameters.

To match the work area to a layer’s duration: select the layer, then type “ibon“. i sends the time indicator to the in point of the layer, b sends the in point of the work area to match the time indicator. o sends the time indicator to the outpoint of the layer, n sends the out point of the work area to the outpoint of the time indicator. Better yet use command+option+b to match the work area to the duration of all selected layers.

Use the bracket [] keys to move layers in/out to the time indicator. Option+bracket will crop the in/out points to the time indicator.

To go to the first or last frame of the work area, press Shift+Home or Shift+End.

Show only properties with keyframes or expressions: Press U


After Effects Keyboard Shortcuts