Pivot Painter 2 - 3ds Max script outputting strange results, makes no sense

So I’ve been trying out Pivot Painter 2 in unreal in hopes of implementing it for foliage assets…

Unfortunately I’ve encountered some weirdness that I can’t resolve.

For the record I’ve encountered this issue even with the most simple setups… like two cubes attached to another cube in a simple hierarchy…

In the screenshot below you see two assets, the left one from the unreal content examples map that showcased PP2 (working just fine) and a similar mesh created by me on the right.

They both use the same master material and the only difference in the material instance are the texture inputs (pivot position & x vector).

As you can see… they are very different.

My asset also straight up breaks when rotated at particular angles.

Naturally I’ve tripled checked everything I could, such as texture and asset settings, pivot directions in 3ds max, unit setup, etc. Tried in both max 2017 and 2022. As I said, all my assets suffer from this issue, no matter how simple they are.

My asset starts to resemble the one from the example map when I invert individual channels of the ‘x vector’ map… but that’s not enough to fix this unfortunately. However it makes me think that it’s the x vector map that’s broken somehow.

The left asset’s ‘x vector’ map:
2022-02-13 20_06_37-SimplePivotPainterExampleMat_Inst

The right asset’s ‘x vector’ map:
2022-02-13 20_06_44-SimplePivotPainterExampleMat_Inst2

They look different but not sure if that matters. Help appreciated.

1 Like

Never actually used it, but.

The probelm is probably the texture…
Is SRGB on or off for it? Is the compression settings on it the same as the content example stuff?

And is the node you are using in engine set to the same settings you use the tool with?
I’d asusme there must be a setting of some sort to tell it how many splits it has within the texture in terms of data points.
These need to match up or the read info wont work right.

Maybe the fact they look different does matter.
The color in each zone represents whatever the animation has to be or a position that a vertex needs to reach in x/y/z space.
However you should compare it to what the script produces directly to know if colors look “ok” or not.
Different textures made for different models will always look different…

Also, vertex order probably matters when the object is exported.
At a base level the script should be tagging specific vertex to specific areas of that pixel block texture it produces so that values can be read in to generate the animation for it.
Exporting with quads causes the engine to triangulate. This is likely to change vertex order…

Surely, theres a 3dsMax tutorial you can follow on how to do it correctly out there?

Thank you for the reply. I actually figured it out… but I will address the rest first.

And is the node you are using in engine set to the same settings you use the tool with?

I was actually considering this. In the documentation the script is actually kind of old and was being used in max 15/16 so I was wondering if in 4.26 the nodes are actually expecting an input from an updated version of the script that I don’t have… well no, I can confirm that the current script works with all versions of unreal.

I’d assume there must be a setting of some sort to tell it how many splits it has within the texture in terms of data points.
These need to match up or the read info wont work right.

I was looking into how the information is split in the node but it was over my head unfortunately. I really should take some kind of TA course…

The color in each zone represents whatever the animation has to be or a position that a vertex needs to reach in x/y/z space.
However you should compare it to what the script produces directly to know if colors look “ok” or not.
Different textures made for different models will always look different…

So yeah this was the part that helped. The issue was that if your asset is messed up there’s really nothing you can compare it to. Pivot placement, hierarchy, etc. all the things you are setting up actually gets lost when importing to unreal and they don’t provide the .fbx they use in the sample scene.

When I was comparing my asset to the unreal asset it was clear that most things were fine, but the pivot rotation was incorrectly interpreted during the baking process… Like yeah the assets are not identical, but it’s not like all the X axis are facing downwards or in some other unnatural direction… so the baked out textures should have similar-ish values.

What actually threw me off is that I saw someone’s palm tree had similar values to my asset… so I figured oh never mind it’s something else then. But of course that palm tree was structured differently and did in fact had its X axis facing very differently from my own…

It wasn’t until much later that I came back and realized that I wasn’t correctly following the “X axis along the length” instruction. Sooo that would look like this:

2022-02-14 14_13_34-3dsmax

And of course now the baked out X vector texture resembles the example ones much closer… and all the wind effects are correct without distortions.

I will note that even though the script lets you bake Y vector and Z vector textures as well… that won’t help if your assets don’t follow this X vector direction, as the wind node in unreal expects the X vector in that specific way, no matter what… from what I can tell.

Exporting with quads causes the engine to triangulate. This is likely to change vertex order…

For sure how and when you triangulate can mess up the most random things, this is actually fine as the UVs of the asset are shrunk down and aligned with the relevant pixel in the texture automatically through the script.

Surely, theres a 3dsMax tutorial you can follow on how to do it correctly out there?

Actually not a lot of stuff out there other than the official documentation, but in the end that had the solution anyway… :sweat_smile:

1 Like