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

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@Misaki_Akatsuki

setValue()とsetValueAtTime()をまとめる

More than 3 years have passed since last update.

After EffectsスクリプトExtendScriptでsetValue()とsetValueAtTime()が分かれてるのがめんどうなので一つに。

setValueAtSmart.coffee
# キーフレームがすでに打たれているかの確認し場合によって値を実際に入れてゆく
Property::setValueAtSmart = (time, newValue) ->
  # プロパティがhiddenの場合に判別する手段がないため,tryで包む
  try
    if @numKeys is 0
      @setValue newValue
    else
      @setValueAtTime time, newValue
  catch err
    alert err

一応コンパイルしたのも

setValueAtSmart.js
// キーフレームがすでに打たれているかの確認し場合によって値を実際に入れてゆく
Property.prototype.setValueAtSmart = function(time, newValue) {
  var err;
  try {
    if (this.numKeys === 0) {
      return this.setValue(newValue);
    } else {
      return this.setValueAtTime(time, newValue);
    }
  } catch (_error) {
    err = _error;
  }
};
0
Help us understand the problem. What is going on with this article?
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

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?