# [Bf-committers] Another try for "Weight from Bone Glow"

Brecht Van Lommel brechtvanlommel at pandora.be
Mon Nov 9 02:23:34 CET 2015

```I tried to do a quick implementation of this but it's not working very well:
https://developer.blender.org/P284

The diffusion is #ifdef'd out, it's just using the undiffused weights.
There's some things unclear to me in the paper:

Does H stay the same as the previous method? The paper only mentions
modifying p, but it seems odd that you would use only the closest bone for
H and then multiple bones for p. That doesn't seem to work and I don't
expect it to.

With the smooth weights you can have bones influencing very far away
vertices. How do you solve that, some clamping when the weight is small or
there are too many bones influencing the same vertex? With the binary
nearest bone weights this was not a problem.

By the way, the Tux 3d model with armature from the paper is here:
http://www.katorlegaz.com/3d_models/miscellaneous/0167/index.php

On Sun, Nov 1, 2015 at 12:45 PM, Xavier Thomas <xavier.thomas.1980 at gmail.com>
wrote:

> Here is my attempt at traducing the equation to pseudoce:
>
> #DEFINE STEP_NUMBER 1000
>
> for each bone:
> bl = bone.length
> bpos = bone.root_position
> section_length = bl / STEP_NUMBER
> bone_direction =
> unitari_vector_pointing_in_the_same_direction_as_the_bone
>
> for each vertex:
> illum = 0
>
> for i=0 to STEP_NUMBER:
> vpos = vertex.position
> vn = vertex.normal
> bone_section_pos = bpos + (i * section_length) * bone_direction
> v2b = vpos - bone_section_pos
>
> if line from vpos to bone_section_pos do not cross any face:
> illum = illum + (max(dot_product(v2b, vn), 0) /
> power(length(v2b), 2)) * length(cross_product(v2b, bone_direction)) *
> section_length
>
> illum = bone_length * illum
>
> normalise_weight()
>
>
> 2015-11-01 9:25 GMT-02:00 Xavier Thomas <xavier.thomas.1980 at gmail.com>:
>
>> Do not mind the firts post, send automatically while writing
>>
>> 2015-11-01 9:24 GMT-02:00 Xavier Thomas <xavier.thomas.1980 at gmail.com>:
>>
>>> #DEFINE STEP_NUMBER 1000
>>>
>>> for each bone:
>>> bl = bone length
>>> bpos =
>>>
>>> for each vertex:
>>> illum = 0
>>>
>>> for i=0 to STEP_NUMBER:
>>> bone_section_pos =
>>> illum +=
>>>
>>> illum = bone_length * illum
>>>
>>> 2015-10-31 12:36 GMT-02:00 Daniel Salazar - patazstudio.com <
>>> zanqdo at gmail.com>:
>>>
>>>> Yes please someone! The bone heat approach feels lacking this days.
>>>>
>>>> Daniel Salazar
>>>> patazstudio.com
>>>>
>>>>
>>>> On Sat, Oct 31, 2015 at 8:15 AM, Gaia Clary
>>>> <gaia.clary at machinimatrix.org> wrote:
>>>> > hi.
>>>> > Once in a while i visit this document about "Weight from Bone Glow":
>>>> >
>>>> > http://www2.eng.cam.ac.uk/~rjw57/pdf/r_wareham_bone_glow_amdo_08.pdf
>>>> >
>>>> > I slowly make progress with understanding the mathematics here. I
also
>>>> > think that i have a "visual understanding" of how this works.
However i
>>>> > still struggle with translating equation (5) into a program. Maybe
>>>> > someone can find the time to translate this equation into some pseudo
>>>> > code or so ?
>>>> >
>>>> > Then i maybe can translate this into an "Weight from Glow" Operator
>>>> that
>>>> > work besides the existing "weight from Bone Heat" Operator. Of course
>>>> if
>>>> > someone can do this in a snap, then i would not be sad if you just go
>>>> > ahead and make a patch :)
>>>> >
>>>> > thanks for any feedback and help on this.
>>>> > cheers,
>>>> > Gaia
>>>> > _______________________________________________
>>>> > Bf-committers mailing list
>>>> > Bf-committers at blender.org
>>>> > http://lists.blender.org/mailman/listinfo/bf-committers
>>>> _______________________________________________
>>>> Bf-committers mailing list
>>>> Bf-committers at blender.org
>>>> http://lists.blender.org/mailman/listinfo/bf-committers
>>>>
>>>
>>>
>>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
```