Assume I have done numerous transformations on some objects and I get the data tree, can I extract the transformations of particular branch?
You should track and collect the transforms in the same way as the geometry you transform (The X output on all transform components). Or do all the transforms first without the geometry, combine them in the compound transformation component, transform the geometry with one compound transform - then it will be easier to keep track of the transform data.
Yeah, that is clear, but if you want to create a cluster give it to someone then he requires the transformation only of one branch to apply it to something else.
Or is it that data trees can gather only the objects after transformations have been applied?
I’m trying to figure out how useful data trees are with models other than Architectural Design.
Your thinking is correct that the data tree will just have the geometry. Data trees can hold any data but the transform data does not automatically come packaged with the geometry (because in the code transforms make a copy of the geometry as new). That is why I suggest to track the transformations as well, this way for a cluster you can also provide an “X” output if the transform data is needed. (This is what the GH components also do in code with their X outputs). So essentially, you will have two data trees that correspond. One of the geometry, one of the transformations. It would also be possible to put them in one data tree as 2 items branch (with something like merge or weave of the geometry and its transform data) but then the user will need to get each transform with a list item per branch.
Ah, so the transformations are also considered objects to be stored in the data tree. Interesting idea. I just have to think in advance, if I’m going to need the transformations or not.
Just some hours ago I dealt with a similar problem (storing transforms to be applied to other objects).
In the foillowing script, a C# component transforms some spheres internally, and it also outputs a list of the transforms to its Trx output so that the transforms can be applied also on the blue boxes. If the steps are not needed one can do like Michael said - combine them the entire list into one Transform using the Compound component.
transform_experiment.gh (14.7 KB)
Thanks a lot for sharing Rolf, it’s great.