Author Topic: Scaling FBX scales layer masks?  (Read 1336 times)

The quick version: If I start working on painting an FBX, then later scale the FBX and reimport it into Substance Painter, all Masks will also be scaled, despite UV maps not changing. This seems really surprising to me, as the masks are based on the UV map, which hasn't changed.

Here's a simple way to demonstrate this:

1. In Blender (or whatever program), start a new project. A simple cube is fine. Unwrap the cube, and export the FBX.
2. Bring the FBX into Substance Painter.
3. Add a Fill layer, then add a "black mask" to that layer.
4. Paint somewhere on the mask, allowing some of the fill to show. Save the project.
5. Return to Blender, and scale the object down (say .75 on each axis.) Apply the scale change. Note that we haven't adjusted the UV map. Feel free to unwrap the object again, but uniform scaling shouldn't change the UV map.
6. In Substance Painter, reimport the FBX into that same project.

You may not need to turn on/off the fill channel before you see the result, but you should now observe that the mask contents appear to have been scaled, despite the UV maps not having changed. This bug means that resizing an object has a very destructive effect on the Substance Painter project, even if the UVs are identical before and after.

The two attached screenshots show a Before and After. In the Before, I've put a triangle in the mask. I then scaled the FBX up to 3 on each axis, applied the scaling, and reimported it. The After shows that the triangle is now tiny, even though the UV map hasn't changed.

I think it's how procedural maps work.  If you bake out the procedurals and re-apply as bitmaps, re-scaling mesh won't change how it looks in the viewport.

You can test this in blender.  Add a procedural material (brick or checker, if there are any) versus applied bitmap image.  Rescale mesh and see if the procedural doesn't adapt to re-scaling versus the bitmap which, in theory, "sticks" (maybe except if you use cubic uv mapping instead of cut up uv islands).

Good luck!

Edit: to fix in SP, I think you'll need to re-bake base maps especially world position.
Last Edit: November 15, 2018, 06:15:19 pm

I guess I don't really understand. In blender, I can add a UV Grid material, as I've done in the first two screenshots. In this test case, I'm starting with an object in blender, unwrapping it, and assigning the material. The second screenshot shows the same object after doubling its scale. The texture has "grown" to cover the object the same as it originally looked, just larger. This is exactly what I would expect.

The second two screenshots show the before and after for this object in SP. I have two layers: One is a plain Fill layer, with the diamond pattern. The other is a Fill layer with another material, using a mask to "paint" the gear on the object. The "before" picture is what I actually painted. The "after" picture occurs when I double the scale of the object in blender and reimport the FBX. Note that the plain fill has "grown", the same way the UV Grid did in blender. However, the "gear" symbol has not. Rebaking in SP doesn't have any effect on the outcome.

Playing with this a bit more, it seems that the masks are stored in the same way as paint stroke information, somehow storing it as 3D coordinates rather than as being tied to the UV map itself. The effect is the same as if I'd uses a Paint layer to paint the mesh, then scaled the FBX and reimported.

In that case, I don't suppose there's a general solution to mesh scaling? Some way to tell substance "I scaled the mesh by X, please adjust your coorindates" ?

Paint strokes are recorded in world space and are not tied to a specific UV map.

You can't scale or move your objects if you want manual paint strokes to be preserved.

Painter has no way of knowing if the object you import is the same one scaled down, from where to where you have moved it, if it is a completely different one alltogether, or where to apply the strokes on that new object.

You can change your UVs at any time, but the location of the object in 3d space is fixed.
Last Edit: November 16, 2018, 02:40:59 pm

I was just informed of the correct way to resolve this. The layer masks behave similarly to paint layer, where the position is stored in 3D space rather than relative to the UV map. If you want to scale a model, and all you've done is to scale the model since the last import, you can simple uncheck "Preserve strokes position on mesh". Upon doing so, the mask will correctly update and retain its relative position on the model.

The caveat is that if you want to scale the model, you should make sure that a scale change is the only change since the last import. That is, since you need to disable "Preserve strokes position on mesh" to get the scale change to work, you wouldn't want any other changes in the model that require "Preserve strokes position on mesh" to import properly.