# Creating expressions on selected verts

**URL:** https://forum.highend3d.com/t/creating-expressions-on-selected-verts/6057
**Category:** Maya
**Tags:** mel
**Created:** [July 3, 2002, 2:41pm UTC](https://forum.highend3d.com/t/creating-expressions-on-selected-verts/6057 "2002-07-03T14:41:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![deane](https://forum.highend3d.com/user_avatar/forum.highend3d.com/deane/32/58795_2.png) [@deane](https://forum.highend3d.com/u/deane)
#### Post date: [July 3, 2002, 2:41pm UTC](https://forum.highend3d.com/t/creating-expressions-on-selected-verts/6057/1 "2002-07-03T14:41:36Z")

</div>

This came up on another message board, and I thought I would try my hand at helping the poster out, but I have run into some problems.

## Here is what I have done.

## create a poly cube, and name it Bill. Select all the verts then source and execute the following script.

global proc vertExp()  
{  
 string $selVerts[] = `ls -sl -fl`;  
 int $numverts = size ($selVerts);

print ($numverts +"n");//debug

```
for ($i=0; $i {
		//string $expNameX = "vertexexpressionX";
		//string $expNameY = "vertexexpressionY";
		//string $expNameZ = "vertexexpressionZ";

		expression -o ("BillShape.pnts["+$i+"].pntx") -s {"0.2 * sin(time+(0.1*"+$i+"))"} -ae 1 -uc all ;
		expression -o ("BillShape.pnts["+$i+"].pnty") -s {"0.2 * sin(time+(0.1*"+$i+"))"} -ae 1 -uc all ;
		expression -o ("BillShape.pnts["+$i+"].pntz") -s {"0.2 * sin(time+(0.1*"+$i+"))"} -ae 1 -uc all ;
	}
```

}

* * *

When I execute it, I get the following:

* * *

source vertExp; vertExp;   
8   
// Error: {0.2 \* sin(time+(0.1\*0)); //   
// Error: Line 1.4: Syntax error //

I'm not sure where this error is being generated. Is it happening when the expression editor tries to create the expression?

Also, where is the curly brace at the begining of the expression coming from?

Can anyone shed some light?

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [July 3, 2002, 3:44pm UTC](https://forum.highend3d.com/t/creating-expressions-on-selected-verts/6057/2 "2002-07-03T15:44:17Z")

</div>

try making the object a softbody and use dynamic expressions instead... Besides its much faster.
