Skip to content

Commit

Permalink
fx: add scale over fx time value
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoVgr committed Jan 24, 2024
1 parent 8d99264 commit 83e35ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hide/view/FXEditor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ class FXEditor extends FileView {
this.curveEditor.xOffset = xOffset;
this.curveEditor.xScale = xScale;
if(isInstanceCurve(curve) && curve.parent.to(hrt.prefab.fx.Emitter) == null || curve.name.indexOf("inst") >= 0)
curve.maxTime = 1.0;
curve.maxTime = curve.name.indexOf("OverTime") >= 0 ? 5000 : 1.0;
this.curveEditor.curves.push(curve);
this.curveEditor.onChange = function(anim) {
//refreshDopesheet();
Expand Down
4 changes: 4 additions & 0 deletions hrt/prefab/fx/Emitter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class InstanceDef {
var worldAcceleration: Value;
var localOffset: Value;
var scale: Value;
var scaleOverTime: Value;
var stretch: Value;
var stretchVelocity: Value;
var rotation: Value;
Expand Down Expand Up @@ -250,6 +251,7 @@ private class ParticleInstance {
var def = emitter.instDef;
var scaleVec = evaluator.getVector(idx, def.stretch, t, tmpScale);
scaleVec.scale3(evaluator.getFloat(idx, def.scale, t));
scaleVec.scale3(evaluator.getFloat(idx, def.scaleOverTime, emitter.curTime));
localMat.initScale(scaleVec.x, scaleVec.y, scaleVec.z);

// ROTATION
Expand Down Expand Up @@ -1410,6 +1412,7 @@ class Emitter extends Object3D {
{ name: "instMaxVelocity", t: PFloat(0, 10.0), def: 0., disp: "Max Velocity", groupName: "Limit Velocity"},
{ name: "instDampen", t: PFloat(0, 10.0), def: 0., disp: "Dampen", groupName: "Limit Velocity"},
{ name: "instScale", t: PFloat(0, 2.0), def: 1., disp: "Scale", groupName: "Particle Transform"},
{ name: "instScaleOverTime", t: PFloat(0, 2.0), def: 1., disp: "Scale over time", groupName: "Particle Transform"},
{ name: "instStretch", t: PVec(3, 0.0, 2.0), def: [1.,1.,1.], disp: "Stretch", groupName: "Particle Transform"},
{ name: "instStretchVelocity", t: PFloat(0.0, 2.0), def: 0.0, disp: "Stretch Vel.", groupName: "Particle Transform"},
{ name: "instRotation", t: PVec(3, 0, 360), def: [0.,0.,0.], disp: "Rotation", groupName: "Particle Transform"},
Expand Down Expand Up @@ -1650,6 +1653,7 @@ class Emitter extends Object3D {
d.worldAcceleration = makeParam(this, "instWorldAcceleration");
d.localOffset = makeParam(this, "instOffset");
d.scale = makeParam(this, "instScale");
d.scaleOverTime = makeParam(this, "instScaleOverTime");
d.dampen = makeParam(this, "instDampen");
d.maxVelocity = makeParam(this, "instMaxVelocity");
d.stretch = makeParam(this, "instStretch");
Expand Down

0 comments on commit 83e35ba

Please sign in to comment.