Skip to content

Commit

Permalink
[fx] InitConstraints now handle subFXs, and ignore editor only constr…
Browse files Browse the repository at this point in the history
…aints
  • Loading branch information
EspeuteClement committed Jan 22, 2025
1 parent 741ed3f commit 6a061d7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions hrt/prefab/fx/FX.hx
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,20 @@ class FXAnimation extends h3d.scene.Object {
}

function initConstraints(elt : PrefabElement ){
if(!elt.enabled) return;
if(elt == null || @:privateAccess !elt.shouldBeInstanciated()) return;
var co = Std.downcast(elt, hrt.prefab.l3d.Constraint);
if(co != null) {
if(constraints == null) constraints = [];
constraints.push(co);
}
else
for(c in elt.children)
initConstraints(c);

var sub = Std.downcast(elt, SubFX);
if (sub != null) {
initConstraints(sub.refInstance);
}
for(c in elt.children) {
initConstraints(c);
}
}

public function resolveConstraints( caster : h3d.scene.Object ) {
Expand Down

0 comments on commit 6a061d7

Please sign in to comment.