Store an array of transform controllers in mat44[]

MunkybuttMunkybutt Fabric for Houdini, Fabric for MotionBuilder Posts: 18


Is there a way of storing an array of transform controllers in a mat44 array on a controller, so that they are not static references and rather update every time their parent is updated?

I am wanting to reference x amount of controllers with the intention of batch processing transform calculations.


  • MunkybuttMunkybutt Fabric for Houdini, Fabric for MotionBuilder Posts: 18

    Ignore me, I figured it out.

  • borjaborja Administrator, Fabric Employee Posts: 480 admin

    Hi Shea

    Mind sharing your approach? :)

    Borja Morales
    Technical Product Manager
    Fabric Software Inc.

  • MunkybuttMunkybutt Fabric for Houdini, Fabric for MotionBuilder Posts: 18

    Hey Borja,

    It seems that whilst I am able to set an input to be a Mat44[] and even set the max type to a MaxNode array.

    This however this seems to just translate into an empty array once fed in the Canvas graph:
    ( The first line is what is returned when the port is queried through Maxscript and
    The second is the canvas graph reporting the same port. )

    I have added the canvas graph for you to take a look.
    Currently, I have it assigned to a Fabric_Position controller on a helper object, and assigned another helper object to the inTransArray port.

    I guess this is a bug?

  • MunkybuttMunkybutt Fabric for Houdini, Fabric for MotionBuilder Posts: 18

    Just to add; I could set the max type to a Matrix Array and update the array values myself through callbacks, but that feels like a hacky work around ( Something I am very used to with Max ) and it would probably slow the scene down considerably, countering my intention which is to speed it up :)

  • MunkybuttMunkybutt Fabric for Houdini, Fabric for MotionBuilder Posts: 18
    edited October 2016

    Further update:
    I have had a pop at updating the Matrix Array with a TimeCallback, this has a performance hit, but on 100 items, it is small enough.
    The problem is now returning the modified array data as an output from the graph.
    You cannot access any other output other than the predefined one, which makes sense.
    So the data can be sent into, and processed by the graph, but it cannot be returned :(
    It is as if there needs to be a Fabric node/controller/class that can output any data type that is just there to process data, or make it possible to access any of the other outputs on a graph.

  • JudahJudah Posts: 64

    I'm not sure what your particular use case is, so this may not work for you, but we were facing a similar problem. The solution we came up with was to compute and store the mat44s elsewhere. We just use the controllers to look the value up in a singleton. Each controller is really basic: There is an input port of type UInt32, and then a string id. The UInt32 is used to index into the singleton data. The id is basically a key that allows us to store multiple collections of data. For example, the ids might correspond to a character, so we could have multiple characters in the scene. This organization allows to you generate the data in any manner you wish. I suppose you could use a graph, however, we are doing it with straight KL.

    I'll stop there in case this is of no use to you. If it is, just respond. I am happy to provide more detail.

    Also worth noting: In the latest release, 2.3.1, it is possible to chain multiple graphs together using the parameter wiring capabilities FE has provided. If you haven't seen that, it's worth a look.

    Good luck.

  • MunkybuttMunkybutt Fabric for Houdini, Fabric for MotionBuilder Posts: 18

    Hah! Judah, you have literally typed out my exact thoughts, or at least a more detailed description of what I have been mulling over for the past few weeks!
    I just cannot figure where to store the matrix data so that it can be accessed again by the multiple controllers.
    Are you running the computations as a callback function that populates a global array with the matrix values when the timeline changes ? - This was what I was going to try next.
    Currently I am merely using the graph to store pure KL functions, therefore a way of getting Fabric to interact with the scene.

    Basically, we do not have any set in stone requirements, I am just exploring how to get the most of Fabric in Max. And as far as I can see it, any way I can introduce multithreading into max's single core architecture is going to be a win.

    I have indeed seen the Fabric wiring capabilities which look very cool. Again, I am not sure on where this would sit in a logical pipeline, stuff that will be figured out over the next few weeks/months I guess.

Sign In or Register to comment.