Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

@TimeToEdit

[aftereffects] コピペで使えるスクリプト 3Dレイヤーの位置を乱数配置 

コピペ用

複数の3Dレイヤーの位置(ポジションXYZ)を乱数でランダムに配置
乱数のmaxはrandom(num)のnum引数で渡す

bandicam 2018-10-31 10-42-06-861.jpg

//グローバル変数
var myComp =  app.project.activeItem;
var myLayer = myComp.selectedLayers;
//メソッド
function random (num){
    var random = Math.floor( Math.random() * (num+1) );
    return random;
}


for ( var i = 0 ; i < myLayer.length ; i++ ){
    var myPos = myLayer[i].property("ADBE Transform Group").property("ADBE Position");
    myPos.setValue([random(1920),random(1080),random(5000)])
}
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
0
Help us understand the problem. What are the problem?