Foliage Actor Instance Pivot? Help with foliage wind material

Hey guys, hope someone can help me with this rather specific and tricky problem.

I’m trying to achieve a wind like effect on my foliage actors within the material. I’m using the “Rotate About Axis” node to achieve this simple nodding effect. (see above) Ideally I want all of my foliage to use this effect.
Here is what the “World Position Offset” of the material looks like

The only problem is, while using this function for foliage instanced actors, the pivot point of the “Rotate About Axis” node becomes the global foliage actor pivot… (see below) in other words, on an individual hand placed actor this effect works fine, however when using the foliage tool to “paint” foliage the effect breaks.

I imagine there may either be a simple fix for this that I’m overlooking, or no real way to fix this issue.

-Chris

You can get instance pivot location by transforming 0,0,0 from local to world in a vertex shader.

I tried this method and it resulted in the same problem occurring.

-Chris

Use the “object position” node instead of “actor position” for your pivot point.

Edit: As noted “object position” will rotate around the center of the mesh, for a rotation around the object origin use the “object pivot point” node instead.

This is really close!! Although this does work, it also adjusts the pivot from the actor pivot to the center of the actor.

Here is what that looks like (below)

I can probably solve this problem with some math, but if you know any simpler solutions please let me know. Thanks for the help!

-Chris

The simplest solution would be to either change the model in your 3D tool so that it starts at the origin or you can change it directly in Unreal for your static mesh with the “import translation” setting so that the origin is where you want it to be (you’ll have to reimport the mesh for it to take effect, I think).

Not sure I quite understand what you are asking me to do. The current Pivot of the mesh is also where I want it to rotate from, however the “Object Position” node ignores the pivot and instead uses the center mass of the object, adjusting the pivot has no effect. Again if I’m misunderstanding you let me know.

-Chris

Ah, sorry, you are right, in this case it’s simplest to use the object pivot point node (it’s just a transform of (0.0, 0.0, 0.0) from local to world space).

PERFECT! That worked like a charm, thanks so much witch-dev for the help really appreciated! I’ll add some more screen, for anyone in the future looking for the same solution.

-Chris

Here is how the final WORKING structure looks, for future reference.

-Chris