Repe [T3DU] and Moises Jpelaez updates

This commit is contained in:
2026-05-12 23:54:06 -07:00
parent 6b404f9da6
commit 39091e8db3
147 changed files with 5539 additions and 1750 deletions

View File

@ -11,6 +11,7 @@ class Object {
public var raw: TObj = null;
public var name: String = "";
public var filename: String = "";
public var transform: Transform;
public var constraints: Array<Constraint> = null;
public var traits: Array<Trait> = [];
@ -111,12 +112,15 @@ class Object {
**/
public function getChild(name: String): Object {
if (this.name == name) return this;
else {
for (c in children) {
var r = c.getChild(name);
if (r != null) return r;
}
else if (this.filename != "") {
if (this.name == name + "_" + this.filename) return this;
}
for (c in children) {
var r = c.getChild(name);
if (r != null) return r;
}
return null;
}
@ -209,6 +213,16 @@ class Object {
return null;
}
public function getTraitFromChildren<T: Trait>(c: Class<T>): T {
var t: T = getTrait(c);
if (t != null) return t;
for (child in getChildren(true)) {
t = child.getTraitFromChildren(c);
if (t != null) return t;
}
return null;
}
#if lnx_skin
public function getBoneAnimation(armatureUid: Int): BoneAnimation {
for (a in Scene.active.animations) {
@ -218,10 +232,21 @@ class Object {
}
return null;
}
public function getParentArmature(name: String): BoneAnimation {
for (a in Scene.active.animations) {
if (a.armature != null && a.armature.name == name) return cast a;
}
return null;
}
#else
public function getBoneAnimation(armatureUid): Animation {
return null;
}
public function getParentArmature(name: String): Animation {
return null;
}
#end
public function getObjectAnimation(): ObjectAnimation {
@ -229,6 +254,15 @@ class Object {
return null;
}
public function getAnimation(): Null<Animation> {
if (animation != null) return animation;
for (c in getChildren(true)) {
var a = c.getAnimation();
if (a != null) return a;
}
return null;
}
public function setupAnimation(oactions: Array<TSceneFormat> = null) {
// Parented to bone
#if lnx_skin