PDA

View Full Version : Proxy keying



Dr. Dardis
10-02-2003, 04:42 AM
Hi All,

I have been trying to work out a way to set up some kind of proxy keying in LW.

By this I mean when you keyframe one object, a key is also created for another nominated object, without having to select or do anything to it.

does anyone know how to accomplish this? I have a longer explanation at

http://www.cgtalk.com/showthread.php?s=&threadid=92027

I am beginning to think that Lscript might be the answer, but it is not my area of expertise. Faulknermano's Lscript "ChannelSetsMC" has the right idea, but is not quite what I need.

I am looking to set up a relationship once, and then you never have to look at again, his script means that you have to nominate a favourite set, but if you have more than one (ie Left and right arm), you have to keep going back to the plugin interface to Change the set as you animate.....

Does any of that make sense?:confused:

Anyhow, I would appreciate any input

The Doc

fxnut
10-02-2003, 05:12 AM
Doc,
Yep, that should be an easy script to write. Once you've established which channels to link together, you'll need to use the "event()" method in the Channel Object Agent (see page 178 of the LScript Reference Manual PDF - or page 186 if you go by the PDF's page numbering rather than the documents).

The "event()" method lets you pass a function that LScript will call every time that that channel gets modified in some way, so you can put your keyframe copying code in there.

Dr. Dardis
10-02-2003, 09:48 PM
Thanks FXnut,

loved your site as well, very creative. Anyhow, I will start looking into it. I would want to apply it to the motion options panel of an object I think. Can you tell me any hurdles I might come to coming from a (bad) Maxscript background (if you know anything about that)? I am an Lscript virgin:p

Any other members with stuff to add, please speak up!

Thanks again fellows

The Doc.

fxnut
10-03-2003, 07:10 AM
Thanks for the kind words Doc, glad you liked it.

Actually I've done quite a bit of Maxscript and I generally find it a lot easier to use than LScript. LScript can be pretty unforgiving with syntax (have a look at some of the other threads in this forum for more info on that). But I do like it cause it's very good at knocking up extremely useful LW tools in a very short amount of time. You shouldn't find too many hurdles with learning it, apart from getting your hands on all the documentation (I had to rip the LScript 2.5 update docs from Google cache for f**ks sake!).

For the key proxying script, I think you'd be best off writing it as a Master class plugin. There's no need to write it as an Item Animation class cause you want to modify the key frames directly, rather than produce procedural animation. By writing it as a Master class, it'd allow you to easily set up numerous links between all sorts of different objects, and would mean that you wouldn't have to keep on opening the motion panel dialog to adjust each object's plugin settings - it could all be done from the central Master class plugin.

If you have any other questions on this, I'm more than willing to help. Heck, I'd write it myself if I had the time!

Regards

Andy

Remi
10-03-2003, 03:10 PM
I'm no scripter and I think I understand what you want...let me ask this though....wouldn't you need it so you could turn off the proxy when you want. Just in case you don't want to keyframe the two objects at the same time....it would be a great plug if it could be done like that....if I understood you correctly. I would use it quite often...dynamic Proxying:)

Dr. Dardis
10-05-2003, 09:09 PM
Thanks Guys

Remi, That would be good. My initial use for it would not need Dynamic on/off though... I have been trying out faking Pole vectors (swivel angle manips for Max users) in LW, I can do it quite simply with straightfoward rig, but the IK will only solve correctly while I place the hand,eblow controls. I move them about, the heirarchy moves correctly, I set the keys and scrub the Timeline, and the whole thing is wrong. Basically, the IK is being solved last. Booooo, I hate that :( anyway, if I set a key on the offending bone (this case the Rotation channels of the upper arm) at the same time as the elbow control, then it will behave properly an retain the correct pose after keyframing. This is despite the fact that said bone is IK in it's P and H channels, I think in order for my method to work, it just needs the key recorded.

sooo... This little tool would just mean that that bone would always be getting keyed along with the Elbow control, even though I wasn't always selecting it and keying it on purpose. I could get it to work by applying motionbaker on the bone, but that is a very messy solution indeed :)

That said though, I would like to make the link dynamic in the end, because I can see plenty of uses for it, and as I key Pose2pose, it can be of use. But, I am an lscript newbie, so I am trying the simple first :)

Thanks for all the input as well Andy. I appreciate your advice about Master class use, I have been reading up on the Lscript manual all weekend, and I am beginning to understand :) I will email you to let you know how it goes (if that OK by you)

regardless, I will post a link for the script to the forum when it's done. Won't be groundbreaking, but I will post a rig to go with it as well, might be a usefull tool for some.

Thanks again Muchacho's

The Doc.

fxnut
10-11-2003, 06:08 AM
Originally posted by Dr. Dardis
....I will email you to let you know how it goes (if that OK by you)

Sure absolutely. You can contact me via my website.

fxnut
10-17-2003, 09:12 AM
Doc, I've had cause to try to write something at work exactly along the lines you were talking about. But I've hit a major stumbling block as I can't seem to get the event() function callback mechanism to work. Nothing happens at all when I try to get it to work, and it usually ends up crashing Lightwave when I clear the scene.

I even tried the example in the LScript manual, but to no avail (actually, it was written wrong in the manual, but I corrected it). Has anyone managed to get the channel event callback mechanism working?

Don't ya just love LScript when it decides to throw a feature omission in your face after 5 hours of coding. :(

Starting to get quite annoyed with it.

faulknermano
10-20-2003, 08:32 AM
Originally posted by fxnut


Don't ya just love LScript when it decides to throw a feature omission in your face after 5 hours of coding. :(



that's nothing. try 2 months of scripting before slamming into a wall.



dr dardis: what you propose is something that does not depart too radically from channelsetsmc, at least from the standpoint of lscripting. depending on certain cirumstances, it may be possible in the near future to rewrite a version of channelsetsmc that adheres closely to the workflow you have suggested. i personally think it is a good idea.

fxnut
10-20-2003, 02:07 PM
2 months?!! Jees Faulknermano, you must have the patience and dedication of a saint to carry on doing LScripting after that!

BTW, did you use the channel event() function callback in any of your scripts? Did it work before version 2.6?

faulknermano
10-20-2003, 08:10 PM
2 months?!! Jees Faulknermano, you must have the patience and dedication of a saint to carry on doing LScripting after that!

i've gotten more from lscript than lscript has gotten from me. :)


BTW, did you use the channel event() function callback in any of your scripts? Did it work before version 2.6?

no.. in fact i've never checked that out.

fxnut
10-21-2003, 03:18 AM
Originally posted by faulknermano
i've gotten more from lscript than lscript has gotten from me. :)

Hehe! Nice answer :D :D

Dr. Dardis
10-22-2003, 04:11 AM
Hey excellent guys...

Sorry for my abscence from My own thread, I had a job come up that required head down, bum up!

anyhow, I have been plodding away on it (the script), but to little avail (yet ;)). I will keep on trying, if for no other reason than I need to learn lscript for the long run, although what you have both been saying scares me :)

I have had a mate, who is a Mel/python script guru helping me along, but it is confusing him a bit too in spots...

and I haven't even looked at the event() function callback yet, am about too...

still, thankyou both for the continued interest and if you have any developments, post away :)

The Doc.

fxnut
10-22-2003, 09:53 AM
Originally posted by Dr. Dardis
and I haven't even looked at the event() function callback yet, am about to

Keep us posted here with what you find when you try to use the event() function then. I really hope you manage to get it to work.

Dr. Dardis
10-22-2003, 11:43 PM
Will do Andy:)