Coder Social home page Coder Social logo

Comments (2)

vpenades avatar vpenades commented on June 12, 2024

Hmm... you're right that the time channel accessors could be reused across multiple animations, but it's a double edge sword, because if you want to edit one of the animations afterwards, you could inadvertently edit -all animations-

But it's true that glTF is not an editable format, but a final format, so it makes sense to optimize it in that way.

I guess I could add something that, when writing the glTF to disk, to look for equivalent accessors and "squeeze" them.

I could look into it, but I don't know when I'll have time to it; I have some other gltf tasks on queue... so I'll leave this issue open.

from sharpgltf.

idea-lei avatar idea-lei commented on June 12, 2024

That sounds great, or I could help to make a pr.
But as it may affect the current solution, it could be better if you do it alone or we discuss a solution for this and I can then implement the idea. But since I'm not quite familiar with your code, it would take some time and maybe the code style may not correspond.

Here are some general ideas to achieve this:

  1. As you mentioned, at the writing phase, we loop up the shared inputs and merge them into one array. But this will issue an extra traverse of the structure (or mainly the animation frames of each node relevant to the animation.)
  2. When we create a curve using CurveBuilder, we share the input, like the object pool. This will add some properties to the CurveBuilder and will need state management. (or define a new class? would be cleaner) But Since your interfaces (like IConvertibleCurve) are not supporting this, a solution based on this idea could be difficult / ugly...
  3. Like option 2, we create an object pool and in the AddPoint method we check if the new input is corresponding to the inputs in the pool. When writing to the file we check the marker in the CurveBuilder if there is an input array in the pool and use it as accessor.

There are of course other ideas, maybe you can choose one and then I can help or we can further discuss. (Since I need this function asap, I would like to help, of course)

from sharpgltf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.