-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: janusweb
action: commit
revision:
path_from:
revision_from: af26778d545795431b7df54061603f6c9881a157:
path_to:
revision_to:

git.thebackupbox.net

janusweb

git://git.thebackupbox.net/janusweb

commit af26778d545795431b7df54061603f6c9881a157
Author: James Baicoianu <james_github@baicoianu.com>
Date:   Mon Sep 20 12:57:21 2021 -0700

    Improved animation support

diff --git a/scripts/object.js b/scripts/object.js

index bd422770962f1d6e9db72a592a4b339d33d15e6b..

index ..b0e462c99ec5182185f8891ed877f888056aa40e 100644

--- a/scripts/object.js
+++ b/scripts/object.js
@@ -150,6 +150,13 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
         }), 0);
         this.jsparts.updateParts();
         this.assetloaded = true;
+        if (this.modelasset) {
+          this.initAnimations(this.modelasset.animations);
+          if (this.animations && this.anim_id && this.animations[this.anim_id]) {
+            console.log('start animation', this);
+            this.animations[this.anim_id].play();
+          }
+        }
         if (this.loadingindicator) {
           this.loadingindicator.die();
         }
@@ -279,6 +286,11 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
           this.refresh();
         }
       }
+      if (this.animationmixer) {
+        //this.animationmixer.setTime(new Date().getTime() / 1000);
+        this.animationmixer.update(ev.data);
+        this.refresh();
+      }
     }
     this.assignTextures = function() {
       //console.log('assign textures', this.name, this.objects['3d']);
@@ -319,6 +331,11 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
         if (!modelasset || modelasset.name != this.janusid) {
           modelasset = this.getAsset('model', this.janusid, true);
           this.modelasset = modelasset;
+
+          if (modelasset.animations) {
+            this.initAnimations(modelasset.animations);
+          }
+
         }
         if (modelasset.tex) {
           image_id = modelasset.tex;
@@ -560,8 +577,6 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
         blend_dest = srcfactors[this.properties.blend_dest];
       }

-      this.extractAnimations(this.objects['3d']);
-
       var scene = this.engine.systems.world.scene['world-3d'];
       if (!this.hasalpha) this.hasalpha = {};
       var hasalpha = this.hasalpha;

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 16:05:31 2024