PDA

View Full Version : Math operations on Weight Maps: inverting, scaling, etc? /For use in LWM



jeric_synergy
09-01-2015, 06:11 PM
How would one alter a Weight Map algorithmically?

The operation I actually WANT could be considered an 'inversion', except that that word doesn't include dealing with negative weights.

By 'inversion' I mean would FLIP or EXCHANGE wmap values such that:

a point value of ZERO becomes 100%/1.0, and
a point value of 100%/1.0 becomes ZERO.
50% stays the same, and
25% becomes 75%, and vice versa.
and so on...

(it would be convenient if operations generated NEW wmaps, so the old one is preserved.)

Because of the existence of negative values I'd imagine a plugin/script coder would want to include options for dealing with ranges of Zero<>100, and -100<>100, and indeed, -100<>Zero. 'Inversion' then would have a different meaning, essentially X(-1). However, this is not generally as useful as the inversion above.

This would be for use in LWM mainly-- the Layout nodal editors already have sufficient remapping capabilities to do this easily. But for using Weight Map Falloff in LWM the ability to reverse the effect of the falloff would be useful.

I found an old LS listed in the Assets ( https://www.lightwave3d.com/assets/plugins/entry/weight-value-modifier/ ) but it didn't appear to have the above capability.

JoePoe
09-01-2015, 06:53 PM
Invert Weightmaps (https://www.lightwave3d.com/assets/plugins/entry/invert-weightmaps/)
Flip over %50 or %0.

... sorry, gotta copy the map first :D.

jeric_synergy
09-02-2015, 12:59 AM
Doesn't seem to work in 2015.3, except possibly with your (cryptic) "copy map first" note: I tried copying the w.map, nothing displayed in the list the first time, 2nd time some bizarre characters appeared, both times got an error "Line 62, memory exhausted! Cannot continue!"

Script seems a bit of a drama queen. ;)

May need some updating for 2015.3. Most of Dodgy's stuff is very useful, but this is quite elderly, may be suffering bitrot.
129569

+++++
EDIT: I tried again, following Erikalst's procedure in the video, and LWM crashed.

Sensei
09-02-2015, 06:20 AM
How would one alter a Weight Map algorithmically?

Transform, modify, merge weight maps video tutorial:
https://www.youtube.com/watch?v=OWq3F35VyAU

JoePoe
09-02-2015, 06:25 PM
Yes.... very cryptic 8~. If only I could put my finger on it.....



(it would be convenient if operations generated NEW wmaps, so the old one is preserved.)


The laughey face was because copying first is not that much of a headache.

Too bad it's bonkers in 2015....It does date back to 7.5

jeric_synergy
09-02-2015, 06:33 PM
The laughey face was because copying first is not that much of a headache.
Wrong attitude: multiple "not that much of a bother"s add up to annoying applications. Every opportunity to eliminate unnecessary actions should be encouraged.

Too bad it's bonkers in 2015....It does date back to 7.5
So that's confirmed?

It's uncompiled (THANK YOU, Dodgy!), so mere mortals have a chance of fixing it.

JoePoe
09-02-2015, 07:29 PM
Oy. At the time I was offering something that did 95% of what you asked for (unforeseen 2015 complication notwithstanding).

.... and no, not confirmed.

jeric_synergy
09-02-2015, 07:42 PM
Fortunately, works like a charm in 11.6.3. I wonder what changed in LScript.

spherical
09-02-2015, 10:39 PM
Wrong attitude: multiple "not that much of a bother"s add up to annoying applications.

To quote an earlier flippant reply in another thread: TO YOU! :D Evidently, some of us feel that an immediately available expedient is way better than the two birds in a bush of actually making a change in the base code some years down the road. So, one person's "wrong attitude" is another person's solution; not that I'm saying you can't have an opinion...

jeric_synergy
09-03-2015, 08:11 AM
Oy. At the time I was offering something that did 95% of what you asked for (unforeseen 2015 complication notwithstanding).

.... and no, not confirmed.
Sorry, that came out a harsher than intended. More like "We Must Remain Vigilant and Oppose All Clicks". Sorry.

Since the script is uncompiled (hallelujah) I'm going to take a swat at getting it to work in 2015. --I'll fail, but I'll give it a go.

JoePoe
09-03-2015, 10:45 AM
:cool: