Update Instance Transform sets rotation to 0/0/0

Am I allowed to say I am not 100% satisfied with the support? It’s awesome that you are willing to look at bugs and even download my whole project for this, but really, you know how much time I have spent writing here and trying to find out how to bypass this bug? I don’t know exact numbers, but I guess this bug has cost me ~7h of time I would have been able to spend on “productive” things.
I don’t really want to criticize you because I know it really doesn’t go without saying that I even get support at all, Unity devs would probably not have helped me at all and fixed it in some release 2 years later.
I don’t know what exactly you could make better, I just wanted to say I am not 100% satisfied, and I hope you can understand that :slight_smile:

were you able to reproduce it now?

any update?

Hi ,

It took some time to track this one down. It has nothing to do with the Update Instance Transform & Get Instance Transform nodes, but it’s the InstancedStaticMesh component itself. It can’t hold a rotation value if the Scale is set to zero. You can test this by entering the values directly in the components Element.

I’ve entered this as JIRA UE-9021 in our tracking software and our developers will be investigating it further.

Cheers,

TJ

Hi ,

I’m the engineer who’s assigned this issue.

The basic problem you’re running into is that InstancedStaticMesh is intended to render lots of instances as fast as possible, and in order to do that it stores the transform as a Matrix which can be directly used by the GPU.

Unfortunately a Matrix stores the translation, scale and rotation in a combined form so that the various numbers depend on each other, and as you’ve seen zeroing out the scale zeroes out the rotation.

I can change the representation for each instance to actually store an FTransform object with independent translation/rotation/scale, but that will slightly slow down every addition or modification operation because the transform will need to be converted to a Matrix when regenerating the rendering data.

Version 4.7 adds support for millions of foliage instances all using InstancedStaticMesh, so I’m going to have to test that making this change doesn’t make the foliage painting tool noticeably slower when working with large numbers of instances. 4.7 is now in release testing, so it’s too late to get this change in for that, but if I can make this change without much impact, it will be in 4.8.

As a workaround, about the only option in Blueprint is to store the existing transform in a local variable before setting the scale to 0 and restoring it afterwards.

If you guys are using source code, I would be happy to send your programmers a small patch that makes the change to use an FTransform and will fix this for you guys. Please let me know if you are interested in that.

Cheers

Hi, thanks!
My project is blueprint only, so I won’t need any patch. My workaround at the moment is to just set the scale to 0.01/0.01/0.01. This looks not much different than 0/0/0.

Hi , it has been a few months since I last thought about this problem, using very small numbers works quite well, but is it possible to use the value 0 now without losing the rotation? Thanks!

Hey ,

I’m sorry it’s been a few days. is quite busy right now but I did speak with him about this.

The fix he described can’t be implemented because it would effect the efficiency like he mentioned above. There is going to be some changes in this area in the future but it’s not something that will solve the issue you reported.

He still suggests to back up the transform in a variable or array variable and restore it that way. Or of course use the workaround like you have been doing.

Cheers,

TJ