0
$\begingroup$

I try to translate objects local the following way:

enter image description here

The problem is it resets all other things like scale and rotation (that are set not using a matrix). I have seen this topic:

How to move object in its local transform orientation in Animation nodes?

But that does not work in my case. (It's like all previous non matrix editing gets undone).

Here is the file, I hope someone can take a look:

Here is the data it loads: https://pastebin.com/raw/Lu7Cj8SH


Edit:

I tried isolating the problem and I already have hit a wall. Why does this not work?

enter image description here

$\endgroup$
4
  • $\begingroup$ (It also seems AN is really bugged using matrices) $\endgroup$
    – clankill3r
    Apr 21, 2017 at 19:36
  • $\begingroup$ I think the problem is that some of the modes in the Object Matrix Output node don't work the way we would expect. This is just Blender behavior leaked into the UI. I was aware of it but thanks for the "report". I will put these options in the advanced settings as you really have to know what you do. My guess is that these matrices are more meant to be read than changed. $\endgroup$ Apr 21, 2017 at 20:07
  • $\begingroup$ @JacquesLucke then what is the point of having an output type? $\endgroup$
    – clankill3r
    Apr 21, 2017 at 20:09
  • $\begingroup$ You are right. The modes are there because I thought it might be useful to some people to be able to output those. As I just said, I will move this into the advanced settings and include a warning. docs.blender.org/api/blender_python_api_current/… $\endgroup$ Apr 21, 2017 at 20:12

1 Answer 1

1
$\begingroup$

The thing is the matrix translation node is basically a compose matrix node but with no control about rotation and scale. This means whatever you do with the translation matrix node it is always going to output a matrix with a 0, 0, 0 rotation and a 1, 1, 1 scale. If the objects you are looping through had a rotation and scale, they are going to "lose" them by going through this kind of loop. One way to solve this is in the following setup:

matrix

Here all the objects in the 3D view are going through the loop but are not loosing their initial loc, rot and scale. From there if you add a compose matrix node in the free input (which is going to input a loc: 0, 0, 0 rot: 0, 0, 0 scale: 1, 1, 1), you can controle all the objects realtive to their intial position, instead of overwriting it. I don't know if this is also valid in the master branch of AN, but their is a handy thing added to the object matrix output node, which is dealing with object and matrix lists. The latest version of an can be found here. You don't have to loop anymore. The thing is there still is no matrix list math node (at least I've not found one), so you will still have to loop but this is useful for making a grid (if you are not playing with indices).

matrices


This is only an answer to the first part of the question, indeed animation nodes seems to have problems dealing with matrices. You can find the bug report here in order to solve matrices problem. I don't know why this happens but somewhere your node setup you are trying to get elements from a list but this list is empty so it shows an error. I hope this was kind of helpful

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .