PDA

View Full Version : Envelope to Displacement?



Chris Jones
04-09-2017, 09:48 PM
Does anyone know of a way to displace a mesh using an envelope, so that the mesh takes on the shape of the envelope? Motion Path Extrude won't do in this instance as the displacement needs to be moveable (nor will baking it to a height map since the resultant image would be far too long).

Thanks!

(c:

Sensei
04-10-2017, 01:03 AM
Envelope is scalar. One scalar for one time, at keyframe. But you need XYZ for every vertex for every frame of animation.

Using envelope as Alpha in mixer, you can mix one vertex position (A) with current vertex position (B),
and final vector use for displacing.

The only question is: where to get vector A. It could be generated by procedural texture, procedural node, or read from morph node.

You could add Const > Scalar/Vector node, envelope it,
then use TrueArt's Node Library > Tools > Split Vector (if using vector),
Download pack from http://www.trueart.eu
And then Split Vector XYZ position (or use scalar directly) use as input in Displacement. Literally plug it directly.
Whenever you will move key in Graph Editor, displaced object will be updated (better have Studio LIVE button enabled)

Chris Jones
04-10-2017, 05:40 AM
Hi Sensei,

Thanks for the suggestion! Sadly though it appears I lack the mental aptitude to translate this into something workable... retrieving/mixing vertex positions and vectors does seem to be the crux of it though as the best I can manage is to get the envelope to move the mesh as a whole. I should mention that I only need to use an envelope on one channel (e.g. Y), and therefore displace in only one direction, if that makes things any simpler.

(c:

Sensei
04-10-2017, 07:10 AM
Thanks for the suggestion! Sadly though it appears I lack the mental aptitude to translate this into something workable... retrieving/mixing vertex positions and vectors does seem to be the crux of it though as the best I can manage is to get the envelope to move the mesh as a whole. I should mention that I only need to use an envelope on one channel (e.g. Y), and therefore displace in only one direction, if that makes things any simpler.


But from what you wrote above, you want to move entire mesh in one direction simultaneously..


If you have envelope scalar, it's one constant value for entire frame.

If you have world spot position of some vertex (Spot Info > World Spot for instance) and add above constant value to Y, it'll obviously move up and down entire mesh..

Isn't it what you wanted?


If you want to move just a few vertexes from entire mesh, not all of them,
make weight map with 0.0 and 100%.
And use weight map node to read whether vertex should be moved (100%) or not (0%).
such weight map use in Mixer node, or Math > Scalar > Multiply.. or Math> Vector > Multiply.. or Math > Vector > Scale..

Vector or scalar multiplied by 0, will give 0,0,0 vector or 0 scalar.
Vector or scalar multiplied by 1 (it's internal weight map 100%), will give original value.


Displacement Node Editor, evaluates just one vertex at a time.
It's repeated over and over again, as many vertex is in mesh.
But context is changing (Input node and Spot Info node inputs are changing)




Open Node Editor,
add Make Vector node,
plug it to Input in Displacement node.
Nothing happens, because it's default 0,0,0.
Click E on the right of Y in Make Vector, and envelope it.
Make some keys. Start moving frame slider. Mesh will be moving up and down.

Add weight map node, pick weight map from drop-down.
Add Math > Vector > Scale. Plug it to Input in Displacement node.
Plug output from Make Vector to Scale node vector. Plug weight map output to Scale input in Scale node.
Start moving frame slider. Only few vertexes are now moving up and down, not entire mesh.

RebelHill
04-10-2017, 07:52 AM
Sensei's talking about enveloping a displacement... you're wanting to displace a mesh to look like an envelope (such as a flat plane displaced to look like the Y channel as seen in graph editor)...

Nope, no can do... at least not directly. Closest option youve got is to use a curve node, try to copy (by hand) your channel curve in there, and use that as the displacement.

Hmm... actually, thinking more on it, you *might* be able to get a hijak outta something like TA's Extended item info node, which takes a time input... You could perhaps take a mesh cor-ordinate (such as the X) into time, and then take the Ypos output... Its possible that'd give you the Ypos of item at each time point with time taking on the mapping of your displaced mesh X (or wahtever) co-ord.

MonroePoteet
04-10-2017, 08:49 AM
Where does the envelope you want to use for displacement come from? Is it an external data file with data points you want to graph? An audio source? A motion path from some other object? Envelopes tend to be frame-based, i.e. they change a value over time rather than over some other parameter (e.g. X distance for a Y displacement). Knowing what the source of the data you want to use for displacement may evoke some other ideas.

mTp

Chris Jones
04-10-2017, 08:55 PM
Sensei's talking about enveloping a displacement... you're wanting to displace a mesh to look like an envelope (such as a flat plane displaced to look like the Y channel as seen in graph editor)....

Yeah that's it.


Hmm... actually, thinking more on it, you *might* be able to get a hijak outta something like TA's Extended item info node, which takes a time input... You could perhaps take a mesh cor-ordinate (such as the X) into time, and then take the Ypos output... Its possible that'd give you the Ypos of item at each time point with time taking on the mapping of your displaced mesh X (or wahtever) co-ord.

Sounds promising, although it's the putting of it into practice that eludes me...


Where does the envelope you want to use for displacement come from?

Audio source.

(c:

Sensei
04-11-2017, 12:33 AM
Audio source, but from what source?
It's possible to write GE envelope to path/motion file, or bunch of nulls positions, and then load it back in Modeler. Then extrude to have 3D mesh.
And then use for displacing some flat mesh, animating with time transition between couple such audio envelopes.

I made CSV Reader node:
https://www.youtube.com/watch?v=EjD5_dusXSg

If you can write data to CSV file from some source (it could be even LW source, just make Lscript reading it, and writing CSV file),
you could also import them back in some Node Editor.
On video, I showed how to use it in Surface Node Editor as color,
but you can use it also in Displacement Node Editor. Or Motion Node Editor.

Chris Jones
04-12-2017, 08:40 PM
Any source really, using the Audio Channel Modifier.

I've now found that baking the curve results in an envelope that's so low res as to be unusable, so I think that probably closes off any avenues involving reading/writing envelope data (or extruding the path). WaveFormFitter will give me a mesh waveform, but even a very short snippet of audio generates an unwieldy amount of geometry, hence why I'm looking to move the waveform through a much more lightweight object as a displacement.

Thanks for the suggestions,

(c: