6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

シェイプレイヤーパスの真ん中の座標を取る方法 [AfterEffects][Expression]

Posted at

#シェイプ事の真ん中座標
テキストをシェイプに変換してテキストキャラ毎(文字毎)に真ん中の座標を取得する方法
キャプチャ.PNG

val = thisComp.layer("timetoeditアウトライン").content("t 2").content("t").path.points(0);

function center(arr){
	var tempx = [];
	var tempy = [];
	for (var i =0; i < arr.length ; i++){
		tempx.push(arr[i][0])
		tempy.push(arr[i][1])
	}
	var x = (Math.min.apply(null,tempx)+Math.max.apply(null,tempx))/2;
	var y = (Math.min.apply(null,tempy)+Math.max.apply(null,tempy))/2;
	return [x,y]
}

center(val)

6
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?