Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read influence from a texture or vertex color instead of painting in Unity?
#1
ObiSoftbodySkinner has a "Paint Influence" feature. It works okay for simple meshes, but for more complex meshes it's quite hard to paint the influence precisely in Unity's scene view.

I think instead of painstakingly paint it in Unity, it'd be much much easier for me to paint it as a texture (or vertex color) in a proper 3D DCC then import it to ObiSoftbodySKinner. Especially that Obi 7.0 has a "SkinMap" structure that seems to be for this purpose. But I don't know how. Is it possible?
Reply
#2
(05-04-2024, 05:46 PM)kodra Wrote: ObiSoftbodySkinner has a "Paint Influence" feature. It works okay for simple meshes, but for more complex meshes it's quite hard to paint the influence precisely in Unity's scene view.

I think instead of painstakingly paint it in Unity, it'd be much much easier for me to paint it as a texture (or vertex color) in a proper 3D DCC then import it to ObiSoftbodySKinner. Especially that Obi 7.0 has a "SkinMap" structure that seems to be for this purpose. But I don't know how. Is it possible?

Influence and SkinMap are entirely different things.

Influence is a single float value per vertex that blends between skeletal animation and simulation. It is possible to store and read this to/from a texture, but it is currently not implemented. I can add this for you next week, as it is fairly simple to do.

SkinMap is a list of particle weights: for each vertex, a variable number of <particleID, weight> tuples used to determine which particles have influence over the position of a given vertex. This cannot be read from or written to textures.

Kind regards,
Reply
#3
(05-04-2024, 08:30 PM)josemendez Wrote: Influence and SkinMap are entirely different things.

Influence is a single float value per vertex that blends between skeletal animation and simulation. It is possible to store and read this to/from a texture, but it is currently not implemented. I can add this for you next week, as it is fairly simple to do.

SkinMap is a list of particle weights: for each vertex, a variable number of <particleID, weight> tuples used to determine which particles have influence over the position of a given vertex. This cannot be read from or written to textures.

Kind regards,

Thank for your reply! That would be a good feature to have.
Reply
#4
(06-04-2024, 07:04 AM)kodra Wrote: Thank for your reply! That would be a good feature to have.

Hi!

Attached to this post you'll find a modified ObiSoftbodySkinnerEditor.cs script (for Obi 7 only!) that allows you to import/export per-vertex influence to/from png textures. Right now the export size is fixed at 512x512, with a border padding distance of 64 pixels.

[Image: dqZ9Nkd.png]

Replace the one in your project with it. Let me know if you have any comments!

kind regards,


Attached Files
.cs   ObiSoftbodySkinnerEditor.cs (Size: 15.55 KB / Downloads: 0)
Reply
#5
(08-04-2024, 01:11 PM)josemendez Wrote: Hi!

Attached to this post you'll find a modified ObiSoftbodySkinnerEditor.cs script (for Obi 7 only!) that allows you to import/export per-vertex influence to/from png textures. Right now the export size is fixed at 512x512, with a border padding distance of 64 pixels.

[Image: dqZ9Nkd.png]

Replace the one in your project with it. Let me know if you have any comments!

kind regards,

That was quick! Thank you very much. I'll take a look.
Reply