PDA

View Full Version : Building a custom Morph Mixer



AbstractTech3D
10-08-2012, 05:42 AM
Hello

Another Lscript newbie question:

Am trying to build a custom morph mixer. The end purpose being to create a morph mixer that causes the morph to traverse a circular (rather than linear) path, from a pivot defined by a reference object.

So I've been trying to get my head around documentation regarding reading morph vmaps. However I've also read somewhere that this info is not readily exposed in lscript. Can anyone clarify for me, please?

(To be honest at this stage I'm still coming to grips with how to read the lscript manual).

Thanks!

xchrisx
10-08-2012, 01:47 PM
Not trying to discourage you, but it sounds like you will have to access a lot of point data to get any type of reference object distance for example. Attempting to do that in Lscript would be probably too slow to even make it worth while as lscript is insanely slow iterating through all of that data. I believe what you are trying to accomplish could probably already be done with nodes without any scripting involved so that may be a better and faster route. But that being said, I personally have not attempted what you are trying to do via lscript but thought I would save you a potential headache down the line.

UnCommonGrafx
10-08-2012, 03:34 PM
Yeah, Saved Nodes are a better approach in today's world.

Sensei
10-08-2012, 03:45 PM
Morph mixer needs to be displacement handler plugin or node handler. Both native C/C++, LWSDK using codes.

Scripts always work like this:
- run (by clicking, pressing button with assigned functionality)
- they do what they are supposed to do.
- they quit working.

Displacing is example of functionality that has to be executed until user choose to finish it, by disabling, removing it. Parallel to base application. User moves time slider, and plugin is updating instantly. Scripts never work that way.

Sensei
10-08-2012, 03:48 PM
What you want to do, is very easy to do. You want basically node which has three vector inputs, and there is calculated curve between them as control points.
Then plug base morph to first vector, middle morph to second vector, and final morph to third vector.
And some "opacity" from 0.0 to 1.0 (0.5 = middle vector).

AbstractTech3D
10-08-2012, 05:33 PM
Thanks guys.

Blochi
10-20-2012, 09:40 AM
Hey Sensei,

Not sure why you say that, because LScripts can run perfectly fine as Displacement server. Just made a displacement script last week. They show up in the list of Displacement plugins, and have separate predefined functions that are executed when the scene is loaded, the server is created, the frame is set to a new time, and when the scene is closed. It's woven into Layout's architecture just fine...

Blochi
10-28-2012, 09:59 PM
@AbstractTech3D:

You should not aim at replacing morph mixer, but rather remote control morph mixer with your script.
The reason is, that an important precondition for a curved morph animation remains the fact that you need an in-between morph to define the curvature. In that regard Sensei is right. But the thing is: you should not use your script to move vertices around, but instead work out the proper cross-fading of the morph values and let Morph Mixer do the work for you. With this approach it only boils down to manipulating the animation curves of Morph Mixer, and that is perfectly doable at interactive speeds in LWScript.

Cheers,
Blochi