Notifications
Clear all

[Closed] URGENT: set mix curve on falloff map

ok so from the reference:

this sux the big one so I was hoping there was some way to ‘animate’ the curve by script so that i can manipulate and add points. I dont mind if there’s a hacky solution, just need it done. Please and thanks

7 Replies

near’s I know… nope – pre-build a few maps, load those whenever you need them, is your best bet.

theoretically you could add keys and animate them using UIAccessor stuff, but that’s beyond hacky (e.g.sending mouse clicks to the curve window; not sure that even responds to the clicks).

ugh… that’s rubbish news! how long has falloff been in max and they still haven’t implemented access to the curve!
As far as the UIAccessor goes, i’ve never had much success with it in the past, maybe i’m using it wrong. If you’ve got a quick minute would you mind mocking up something for me?

EDIT: just had a quick look at the UIAccessor in the reference and i can’t see anything about mouse clicks. can I also ask where to find this information?

1 Reply
(@artofsoulburn)
Joined: 11 months ago

Posts: 0

No curves are editable in max’s material editor, which also means you can’t modify any of the output curves or color map curves in the output of any maps. A big limitation, hopefully that will get fixed one of these days.

  • Neil

sendMessage API combined with the appropriate messages. E.g.


 fn click hwnd coords:[0,0] = (
   if (coords == unsupplied) then ( coords = [0,0] )
   coords = (bit.shift coords.y 16) + coords.x
   windows.sendMessage hwnd (WM_LBUTTONDOWN = 0x0201) 0 coords
   windows.sendMessage hwnd (WM_LBUTTONUP = 0x0202) 0 coords
   OK
 )
 

You feed it the handle of the curve window (or one of the buttons if you want to ‘click’ a button; see ‘UIaccessor.pressButton hwnd’ for a more appropriate button-presser), then specify the [x,y] coordinates within that window where you want to click.

Unfortunately, it’s still much easier said than done.

You’d have to…

  1. find the material editor window
  2. find the curve control within it
  3. press the ‘add point’ button to enter that mode (see uiAccessor.pressButton for a more appropriate button-presser)
  4. send the click to the appropriate coordinates (you have to click on/near the line … I just checked, and this does at least add the point)
  5. somehow animate this
    Unfortunately, max gets crashy after step 4, so I doubt this is a feasible solution even if it wasn’t superhacky.

I’d still recommend just spending half an hour making several falloff maps with different curve point counts (or even just one with a whole bunch of them, move the ones you don’t need over to the same coordinate as the first / last point, perhaps), animate them, save the map to a material library or scene file, and load the map from there whenever you need it, ready to manipulate.

It’s… annoying, yes

ok i’ve just checked out the pre-defined falloff maps route and i can move the points if i’ve pre-animated them by hand but i can’t adjust the bezier handles! it’s like pulling teeth from a crocodile right after you’ve injected him with sharks adrenaline…

ok i have an acceptable solution for my purposes. I took richard’s earlier advice and pre-made a falloff map with 64 points that have all been added manually and animated so that the points are accessible. Then i just merge it in and copy it around as much as i need to as well as moving the points to the appropriate interpolated positions along the curve.

It’s more hacky than anyone would want but it’s better than nothing. I’m sure you could put more points in if you want but for me, the graph was looking pretty packed and 64 was enough.

For anyone that’s interested, i’m taking advantage of setProperty in a loop for setting the values of the curve points since the points are all accessed by saying <mixcurve>.point_1 <mixcurve>.point_2 etc. So it’s just:

for i = 1 to <numPoints> do
 setProperty <mixcurve> ("point_" + i as string) <your value>

Gravey,

This is almost exactly the method I use (though I rarely need 64 points). Every new release of max I hope beyond hope that they fix this as most of my materials are scripted and need some sort of mix curve manipulation.

Maybe some day…