PDA

View Full Version : Sliders



maxim capra
06-02-2010, 09:40 AM
here's a script i was working on the last days, because i needed an interface for a facial rig and lightwave doesn't offer this kind of customizable interface stuff. the commercial alternatives where too specialized for my taste.

it's simply a master plugin with an UI for sliders and area sliders. the script produces envelopes for each slider then you can use those envelopes to drive anything else in lightwave, even combine things. this way you can build a more sophisticated morph system and you can even drive morph maps inside node displacement.

the envelopes are stored within the scene, nothing should get lost.

you can change the amount of sliders by changing the right global variables. you can also change the names quite simple in the script.

have fun with it, it's open source.

it's the very first version and i'm sure it's full of bugs and not very good programing style. so if you improve it, please let me know!! if you like it, please let me know, too. if you use it as a basis for something bigger, please give credits,

thanks,
Philipp

p.s. my experience so far with it, is, that the drawn sliders are much faster and more simple to code, than the other sliders. so maybe i will replace the 1D sliders with graphical ones, but for now, it works for me...

safetyman
06-02-2010, 10:22 AM
Very cool! Thanks. I'll check it out.

evenflcw
06-02-2010, 11:35 AM
Looks like a pretty good start. The joystick however don't allow very fast dragging as in mousemove you require the cursor to be within the handle. This test should really (only) be done in mouse down, where you would set something like activeControl that you could then further manipulate in mousemove.

Script readability and encapsulation could indeed be better. Imho it could use some functions to isolate/separate concerns instead of piling everything into the callbacks and some constants for use in the arrays instead of arbitrary numbers.

I might be thinking too big and go beyond the initial scope of this venture. At first I thought using channels to interface with LW was clever way of using what you already got. But, the use of new channels is imho abit "hit and miss" currently, as in the end users will want to link these control channels to channels on a rig. Using native LW they can only set up a one-way communication. Ie the rig channel can follow the control but the control cannot read the rig channel. So the control cannot show the current value of the rig channel. Then again, you might be thinking of joysticks more akin to how Maestros hotspots work. But then the controls should reset themselves after every edit.

The use of new channels also presents another issue. The animation will be stored in the control channel rather than the rig channel. Ideally all animation should be stored on the rig! The control is but an interface and the rig should be able to move on it's own.

I see two solutions to this, either bridge the gap (in LW this will be a hacked solution; I might have some experimental code form a while back) or link directly to the channels you want to control.

Those are my 2 cents.

I love the script either way and how fast you seem to have put it together. Also see you found a lil'known but powerful feature.

Thanks.

maxim capra
06-02-2010, 12:04 PM
The joystick however don't allow very fast dragging

yes, you're right. this is annoying, i will change this.


Script readability and encapsulation could indeed be better

if i plan to go further with this script i will take this into account :) i really needed a working interface, fast and working. it's currently working for me and so i didn't optimise the whole thing. i'm a bit rusty in programing, too, and it's my first lscript time ... lscript ... uhhhh ... i'm shivering :)


I might be thinking to big and go beyond the initial scope of this venture. At first I thought using channels to interface with LW was clever way of using what you already got. But, the use of new channels is imho abit "hit and miss" currently, as in the end users will want to link these control channels to channels on a rig. Using native LW they can only set up a one-way communication. Ie the rig channel can follow the control but the control cannot read the rig channel. The use of new channels also presents another issue. The animation will be stored in the control channel rather than the rig channel. Naturally all animation should be stored on the rig! The control is but an interface and the rig must be able to move on it's own.

now, this is the interesting part. i thought about this. the reason, why i did this, i can use expressions and COMBINE stuff. move more than one channel with one slider, for example. i wouldn't be able to do that, when i give the user a dropdown list and he can directly link to a channel. i wasn't able to come up with a easy solution for that, it quickly becomes too complicated. it would be possible, yes, but at the prize of a high development time for this. and i do not have this time, it just has to work ...

what do you mean by "bridge the gap"?



Also see you found a lil'known but powerful feature.

how yould someone NOT see this :) i'm not really a lightwave user, but everytime i have to do something in lightwave i'm so :cursin: that i can't build my own controls. it's always an window popping, mouse clicking massacre :) but maybe, that's just my way of working ....


i'd definitly like to improve this little script, it could evolve into something really useful for the users, but right now it's just a workhorse for me. if someone works on it, i would really appreciate it, if he does it open source. just for the community...

evenflcw
06-02-2010, 02:06 PM
it quickly becomes too complicated. it would be possible, yes, but at the prize of a high development time for this. and i do not have this time, it just has to work

what do you mean by "bridge the gap"?

I understand perfectly.

By bridging the gap I mean creating the two-way link between the two envelopes.



that i can't build my own controls. it's always an window popping, mouse clicking massacre :) but maybe, that's just my way of working ....
I hear ya! And I'll ease your mind and say that it's not just your way of working. It's simply the reality of lscript. Custom controls will need a bit here and a bit there. It's unfortunate that ctlinfo does not have it's own mouse callbacks or that ctlviewport has scrollbars even when you don't need them (DOH!). The functionality is there, just not in the right place or mix! And then there's the issue of not being able to call ctl* functions from user defined functions to make using custom controls as easy as native controls (assuming custom controls use ctlinfo or similar as handle).

H_Molla
06-02-2010, 06:38 PM
thanks...

maxim capra
06-07-2010, 08:54 AM
didn't find an edit button for my initial post, so i'm updating it this way. i used my script on a current project and added some stuff and did some bugfixing and cleanup. have fun with it :)

Kevbarnes
06-10-2010, 04:28 PM
Hi maxim capra

thanks for putting this together - I've just started to use it.

Q: is there a way of changing the lables on the sliders/joysticks
without delving into the script.

thanks Kev

maxim capra
06-11-2010, 08:51 AM
no, not at the moment. there are a lot of things to do on this script, but i'm rather busy at the moment with a big project, i wrote this sliders for :)

yes, a ui for changing labels, adding and deleting sliders and moving them around is definitly the next step. and saving everything into the lws file. now it only works with a copy of the script for every project you're working on ...

maybe you want to update, i've included the latest version, 0.4. just some small changes...

maybe you also wondered about the aTCB buttons. what it does, is smoothing out the TCB curves to prevent overshoot. I've included a script i use pretty often, which does the same thing for selected items. just put it on a button or key, it has no UI, it's just smoothing the animation curves for the selected objects...

Edit:
oh yes, and in case you didn't find out about this: RMB and MMB plus drag contrains the movements in the area sliders to X and Y. Double click resets the slider to 0.

Kevbarnes
06-11-2010, 11:20 AM
yes, a ui for changing labels, adding and deleting sliders and moving them around is definitly the next step. and saving everything into the lws file. now it only works with a copy of the script for every project you're working on ..

Thanks maxim capra for the update I'll check it out.

Actully once I looked inside the script it wasn't as scary as I thought - you have commented every thing clearly.
I was worried I would break it if I changed anything.

like you say as long as I make a copy for the the specific scene file, I can make any changes I need in the script - cool.

I like the fact that I can have the sliders out of the scene window

thanks regards Kevin