2
$\begingroup$

I'm now working on textures with Object Texture Coordinate on a model with animation. I've discovered that Blender may use real-time coordinates for texture mapping, which makes the texture slide along the surface of the model.

My question is that, how can I use the static original Object Texture Coordinate at the first time step, rather than the dynamic real-time ones, for mapping, in order to make the texture sticking on the model during the animation.

In this question, the answers suggested to use Generated and UV Texture Coordinates. But for there's something different about what I want to paint on the model, so any other Texture Coordinates, especially Generated and UV Texture Coordinates, are not expected, if possible.

(Anyway, here's what I want to do with the static coordinates I asked for above. I'm modifying a model for MikuMikuDance in blender. With Object Texture Coordinates and 'constant' color ramp, I want to divide several rectangular areas on the character for future texturing. Of course, UV Texture Coordinates can also do this, but the area will be only rectangular on uv, but not on Cartisian coordinate. That's why I insist about Object Texture Coordinates. )


Thanks to @MarkusvonBroady and @RobinBetts 's answer. I've met a defect of baking method: cracks may occurs between adjacent meshes due to the inaccuracy of baking:

enter image description here

However @MarkusvonBroady 's method of geometry node can avoid such cracks, for which this method is more recommended:

enter image description here

$\endgroup$

2 Answers 2

2
$\begingroup$

Similarly to Robin Betts' solution, you can 'bake' dynamically by storing data such as Position at any step in the modifier stack:

Geometry Nodes tree:

Consider switching the Point domain to Face Corner when you e.g. split edges and move the split vertices apart; or when you store some other data like normals (but then remember the normals would be stored in object space, not tangent space).

Shading tree:

Modifier stack:

Result:

$\endgroup$
4
  • $\begingroup$ Great! I'm glad you popped this one in. I was thinking game-engine. (Face-Corner for the domain?) $\endgroup$
    – Robin Betts
    Commented Sep 16, 2023 at 10:06
  • $\begingroup$ @RobinBetts for positions vertex domain is enough. For something like normals you would want face corner, but then you would also need to recalculate to a tangent space… Actually wait, for positions point domain is enough only if no splitting + moving apart happens afterwards - I'll add a suggestion to use the face corner domain. $\endgroup$ Commented Sep 16, 2023 at 10:08
  • $\begingroup$ Ahh .. Of course .. point is enough most of the time.. I was running in automatic. :) $\endgroup$
    – Robin Betts
    Commented Sep 16, 2023 at 10:12
  • $\begingroup$ Marvelous! Though I've already utilized the baking method but yours seems smarter. I think I'll try it later. $\endgroup$ Commented Sep 17, 2023 at 11:55
2
$\begingroup$

One option would be to bake the Object-Space of the surface your undeformed, subdivided mesh into a UV Mapped image:

enter image description here

For the resulting image, choose a file-format that can accept negative values, (here, Blender-generated, '32-bit Float') and bake into Non-Color. From the above setup, you would just bake 'Emit'. (You don't need denoising or a high sample-rate)

enter image description here

Once baked, the image can be used as the texture-coordinate for whatever manipulations of 'Object' you would normally have made, and will stick to the surface when the object is deformed:

enter image description here

$\endgroup$
2
  • $\begingroup$ Thanks a lot. I realized about this method several hours later after I post this question, and I've now got what I want through baking. I'm know still looking for a "physical" way to stick the mesh. But anyway, baking is the temporary best solution, although indirectly. $\endgroup$ Commented Sep 17, 2023 at 11:47
  • $\begingroup$ @LibrarristShalinward Sure thing. Markus is good for that. This one may be relevant to folks who need to export. $\endgroup$
    – Robin Betts
    Commented Sep 18, 2023 at 6:36

You must log in to answer this question.

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