PDA

View Full Version : morph to weight

omichon
07-09-2007, 05:22 AM
I am looking for a way to convert a morph map to a weight map :
Basically, the weight map value would be defined by the normalized vector's length of the morph map value.
Any idea ?
Thanks for any suggestion.

dpont
07-09-2007, 06:14 AM
For me, a normalized length of a vector is always equal to unity (1),
so may be you would a scaled vector by a distance reference instead.
Depends what you want to do with this weight map.
If you need weight map for bone, this conversion should be done
in Modeler (Lscript), but if it is for shading, you could calculate
the distance of the Morph Map delta from the Morph node,
a kind of stress node setup.

Denis.

omichon
07-09-2007, 06:47 AM
For me, a normalized length of a vector is always equal to unity (1),
so may be you would a scaled vector by a distance reference instead.Denis.
Doh ! Sorry Denis, my math is as accurate as my english :grumpy:
Thanks for the correction ;)

Depends what you want to do with this weight map.
If you need weight map for bone, this conversion should be done
in Modeler (Lscript), but if it is for shading, you could calculate
the distance of the Morph Map delta from the Morph node,
a kind of stress node setup.
Denis.
The stress node is the idea, I guess.
Basically, I have a displacement on a mesh and I would like a weight map of the displacement amplitude to use it as a mask for the shading.
I tried to export the transformed geometry, then convert it to a morph but it seems to be a dead end since I can't convert the morph to a Wmap.
Hope you will have a solution for me...once again :)

dpont
07-09-2007, 06:55 AM
This is a start to setup what I said:
47986

Constant Vector is <0.0.0>.

Denis.

omichon
07-09-2007, 07:03 AM
Great ! I will try that. Thanks a lot, Denis. You are a great helper like usual :thumbsup:

dpont
07-09-2007, 07:43 AM
Just for fun, another Stress node setup but for any (animated) displacement,
shortly a Spot position is transformed to world with object position
and rotation (the sample has been a bit moved & rotated),
then we calculate the distance from this point to the World Spot
which does include the displacement of the geometry:
47989

Denis.

omichon
07-09-2007, 08:04 AM
These are really great examples of vector manipulation nodes, Denis.
It's really easier for me to figure out what to do with those nodes, now.
The first one seems to be OK in my current situation. I just had to put some high value in the morph amount...
Anyway, I think that the ability to generate Wmaps from nodes would be great (for modeling pupose or anything else). It seems to be just impossible at the moment, right ?

dpont
07-09-2007, 08:15 AM
Directly not, but there are always a worthly way to hack
Lightwave to export something in an Lwo format or
in ASCII weight map file, even during rendering,
but I thing that a node setup is a better solution.
In my last example the color or mask is animated with
the displacement (i.e multi endormorphs with Morph Mixer or
any other displacement) instead of a Weight map which is static.

Denis.

omichon
07-09-2007, 08:28 AM
I thing that a node setup is a better solution.
In my last example the color or mask is animated with
the displacement (i.e multi endormorphs with Morph Mixer or
any other displacement) instead of a Weight map which is static.

Denis.

Agree, but since there are some areas in Lightwave (or 3rd party) where nodes are not available...
Anyway you just have opened a closed door for me :thumbsup:
I am sure I will find a lot of application for this kind of stuff :)

dpont
07-09-2007, 10:11 AM
The Modeler Lscript solution:
47994

Denis.

omichon
07-09-2007, 10:29 AM
Woohoo ! Thank you so much for this, Denis !
:thumbsup:

dpont
07-09-2007, 10:39 AM
In this one, no Scale Factor, the Weight value is normalized,
max distance of delta morph -> weight = 1.
(a bit slower, there are 2 point loops)
47995

Denis.

omichon
07-09-2007, 10:45 AM
No big deal, I just had to apply a NormalizeMap after converting the map.
Thanks again :)