Skip to content

Instantly share code, notes, and snippets.

@pjburnhill
pjburnhill / AutoFadeOpacity.jsx
Created October 30, 2022 15:36 — forked from animoplex/AutoFadeOpacity.jsx
Auto Fade Opacity - After Effects Expression by Animoplex
// Auto Fade Opacity - Created by Animoplex: www.animoplex.com
// Automatically fades a layer in and out based on the inPoint and outPoint of the layer.
// Full Tutorial: https://www.youtube.com/watch?v=BOPfs49VfLE&t=188s
fade = 1; // fade duration in seconds
fadeIn = (time - inPoint) / fade;
fadeOut = (outPoint - time) / fade;
if (time < inPoint + fade) {
ease(fadeIn, 0, 1) * value;
} else if (time > outPoint - fade) {
@pjburnhill
pjburnhill / ObjectPool.js
Created July 18, 2022 09:53 — forked from devcem/ObjectPool.js
To optimize object cloning on scenes, this plugin can be helpful.
var ObjectPool = pc.createScript('objectPool');
ObjectPool.attributes.add('maxCount', { type : 'number', default : 1 });
ObjectPool.attributes.add('sleepTime', { type : 'number', default : 0 });
ObjectPool.prototype.initialize = function() {
this.entity.enabled = false;
this.index = 0;
this.objects = [];