Vex SOP

   2195   2   1
User Avatar
Member
4 posts
Joined: 2月 2013
Offline
(I am new to Houdini.Please bear with my lack of technical knowledge of Houdini)

How does the velocity attribute work in vex?

I mean for testing it, i created a new SOP type in vex.
In the vex code i wrote the following

sop
sop1()
{
v={1,1,1};
}

After compiling it succesfully,i saved the otl file.
Then i dropped this sop in the network view and connected a line to its input and activated the sop.


The line is still at rest.
Nothing happens.What did i assign the velocity to? Where is the action?
User Avatar
スタッフ
2540 posts
Joined: 7月 2005
Offline
Given that vector “v” is a global variable, you can set it as you have and it will add a vector “v” attribute to your geometry. You can verify this by MMB on the SOP tile icon or open up the Geometry Spreadsheet Details View and inspect the point attributes. It is simply a direction vector and in of itself does not apply movement to any geometry.

I am assuming that you wish the line to “move” based on this v direction? You need to invoke a simulation in order to do that. To motivate a line, you could just slap down a good old Spring SOP and play with that. The v will be used as the initial velocity. See attached example file.

The other simulation tool to motivate a curve would be the wire solver in DOPs. This would also use the velocity attribute on the curve as the initial velocity.

Attachments:
myvelocity_with_spring_sop.hip (57.8 KB)

There's at least one school like the old school!
User Avatar
Member
4 posts
Joined: 2月 2013
Offline
Thanx
  • Quick Links