Bug: DecomposeMat44Array no output

I am using DecomposeMat44Array with an array of 4x4 Matrixes, but for some reason there is no output, but also no error message.

In the image you can see 6 matrixes going in, but no rotation vectors coming out. Any ideas why?

Alternatively is there a reason there is no Mat44ToXfoArray node?

Tagged:

Comments

  • Daniele NieroDaniele Niero Posts: 233 ✭✭

    Your BLOCK is wrong, you can't change an input port. In my test it return only identity matrices. I would have expected random results.
    Plus I recommend you to don't use push lightly in a node, because is adding a new entry every time the node is hit! That doesn't mean you never have to use it, just be sure that the node is hit the exactly number of time you expect.

    That said, the Decompose[] node looks wrong as well, indeed.
    Its code is:

    require Math;
    
    operator Math_Mat44_decompose_task<<<index>>>(
      in Mat44[] this
    , out Vec3[] scaling
    , out Mat33[] rotation
    , out Vec3[] translation
    ) {
      this[index < this.size() ? index : this.size() - 1].decompose(scaling[index < scaling.size() ? index : scaling.size() - 1], rotation[index < rotation.size() ? index : rotation.size() - 1], translation[index < translation.size() ? index : translation.size() - 1]);
    }
    
    dfgEntry {
      if( this.size() == 0) return;
      if( scaling.size() == 0) return;
      if( rotation.size() == 0) return;
      if( translation.size() == 0) return;
      Size task_size = this.size();
      if(task_size < scaling.size()) task_size = scaling.size();
      scaling.resize(task_size);
      rotation.resize(task_size);
      translation.resize(task_size);
      if(task_size < 10000 /* pex margin */) {
        for(Size index = 0; index < task_size; index++) {
          Math_Mat44_decompose_task(index, this, scaling, rotation, translation);
        }
      } else {
        Math_Mat44_decompose_task<<<task_size>>>(this, scaling, rotation, translation);
      }
    }
    

    Obviously scaling, rotation and translation, being outputs, are of size 0 the first time the graph enter this node, but there are those three lines that return if scaling, rotation and translation are of size 0, making the node basically impossible to execute! (unless I'm missing something here).
    So those three line must be removed.

    I've corrected the graph for you.

  • seltzdesignseltzdesign Posts: 80

    @Daniele Niero Thanks so much for the explanation and corrected code. I am still getting to grips with Canvas and starting to understand some of the main concepts, which are a little different to the visual programming tools I am coming from (mainly vvvv and grasshopper).

    I have now reverted to using the Xfo.SetFromMat44Array method, which doesn't need push and results in a definitive array size. But I will update my preset for the DecomposeMat44 node for future use.

    Thanks, Armin.

  • EricTEricT Administrator, Moderator, Fabric Employee Posts: 305 admin

    Just an FYI, the Mat44ArrayFromLines node needs its exec port plugged into the main graph's exec port. If you look inside that node, the array is plugged into the exec port thus executing only when that node executes. Once you plug that in, the decompose node will work.

    Keep in mind that when you get the port for the array on the right hand side of the Mat44ArrayFromLines node, it's just a short cut to the array. What should be done actually is a variable should be set up and it should be modified by the Mat44ArrayFromLines node and retrieved after the Mat44ArrayFromLines node executes.

    See attached.

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

Sign In or Register to comment.