Simple Multi Blend

   2839   6   1
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Some small simple solution to blend arbitary floats and vector atrributes
based on https://www.sidefx.com/docs/houdini/vex/functions/spline.html [www.sidefx.com]

Play the anim to see the effect.
Should be easy to extend to blend detail attributes, too.
If you need integer blends, maybe cast the int to float, and use the float
part in the point wrangle inside the OTL.

As most or every morph/blend tool, for best results you should have
same point/vertex/primitive order and count.

Attached is a simple example file.

Hope you like it and it has some use for you :-)

If you have some time left, maybe you can give me some
tips for refactoring code for better performance.
Edited by matthias_k - Feb. 22, 2020 18:14:11

Attachments:
multiparam_blend_example.hip (253.3 KB)
m_kappenberg_spline_morph.hda (12.1 KB)
multiparam_blend_example.jpg (701.5 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
4512 posts
Joined: Feb. 2012
Offline
Hi,

I haven't checked the code but one thing I would suggest is to have a per point/vertex/prim attribute multiplier to do vary blending amount by element.

I have done something similar in VOPs to blend float, vector, vector2, vector4, matrix3, matrix and float array, using the attrib type info, or overriding this explicitly, so the blending algorithm handles normals differently than positions vs quaternions, etc, and an exhaustive list of options for colors where the default blending uses the LCh color model, which is not available in Houdini, but gives the nicest results for colors specifically.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Many thanks for the hints and tips :-)

I'll try my best to make it more useful.
At the moment it's only a sketch/experiment.

If I've understood you correct, you mean more options to blend inside the “between” blends?
Multiply. let's say
Blend/Target 3 == 1
Blend/Target 4 == 0.5
Blend/Target 5 == 1

which will have as a result use “4” only as some flavour between 3 and 5?
English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
4512 posts
Joined: Feb. 2012
Offline
Yes indeed, so that you can do variable per element blending, which makes this kind of tool even more useful IMO
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
475 posts
Joined: July 2005
Offline
Nice tool!

I have tried something similar (but only for point position). I've used different spline interpolation cspline(catrom) and bspline (which gives smoother results). A ramp can be used to control local smoothness, if you blend between the values from cspline and bspline.
This is just an idea, but if you want to look at it here is a file.
Edited by Aizatulin - Feb. 23, 2020 04:40:18

Attachments:
blend_multiple_onlyP.hipnc (88.3 KB)

User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Hi Aizatulin,

many thanks for your example :-)
Seems to me that it is much faster than my one.

I'll try to optimise my code.
Edited by matthias_k - Feb. 23, 2020 06:09:27
English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
475 posts
Joined: July 2005
Offline


yes but you are running over all attributes.

In my example I am only using the point positions. And if I compare my results to the “sequence blend node” it is much slower (10x). Even the merge node eats alot of time. I think it is nearly impossible to get that fast using VEX.
But it would be nice if there is way (or maybe someone can show us).

But implementing features, which are not possible with sequence blend, will justify the performance deficit.
  • Quick Links