Hi. I guess this is a very beginner like question.
I have an object which is moving around - with just animated translate in object level. What I want is to calculate point velocities using Trail SOP, but obviously - in SOP level, there is no movement so velocities stay 0.
What is the correct workflow to do such thing?
object level animation to sops
9272 6 3- rendereverything
- Member
- 47 posts
- Joined: March 2014
- Offline
- eetu
- Member
- 606 posts
- Joined: May 2007
- Offline
- rendereverything
- Member
- 47 posts
- Joined: March 2014
- Offline
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
Yeah this happens when you are trying stuff out in Houdini. In reality if you have an animated object, it's more than likely going to be presented in a different manner. If it is a character it's either brought in as a cache (alembic, geo sequence, etc) and then it's trivial with the Trail SOP.
If it's a rigged Houdini character, you have the Deform SOP which again is good fodder for the Trail SOP.
If this is a real tool to give to artists, you are going to hang a Null Constraint to your skin and again you control the destiny here so you can fetch the Null transforms in an object and constrain your geometry that way and again Trail SOP will work.
The dual object merge reference is easy to swallow if you imagine that you are working on the cached result of the transform where you are going to do subsequent VFX work to.
So all is good here.
Having said all of this, there is the tip of the hat with the Fluid Source SOP and it's intrinsic support for Object level transforms all within the same object and no Object Merge SOP. This tool was designed to take “this” animated object as a fluid source and construct the velocities in several ways including the Object level transforms. Quite handy and useful to know.
—-
But if you are a curious TD and are interested in what is happening under the hood, read on. If not bail here and get your work done. Oh and have a look at the example file and asset posted to this post as an alternative to the Object Merge. For fun.
—-
The Fluid Source SOP fetches the Object level transforms and push that in to the velocity field without using the second object merge trail approach.
It uses the Volume Velocity SOP asset which takes a vel.* volume triplet and with a reference to the object populates those three velocity volumes with the object level transform as velocity.
Then you “could” use an Attribute From Volume SOP to transfer the volume velocities back to the geometry, as utterly ugly as that is, it works.
But you can also lift exactly what the Volume Velocity SOP is doing and construct your own digital asset that actually computes the velocity from the Object level transform on point geometry. Actually compute the full scene transform as that is exactly what the Volume Velocity SOP is doing.
So I whipped up an asset that does just that and in the attached example file I called it “point_velocity_from_object_transform”…
See the example file for all three options including the asset to compute velocity from object transform.
If it's a rigged Houdini character, you have the Deform SOP which again is good fodder for the Trail SOP.
If this is a real tool to give to artists, you are going to hang a Null Constraint to your skin and again you control the destiny here so you can fetch the Null transforms in an object and constrain your geometry that way and again Trail SOP will work.
The dual object merge reference is easy to swallow if you imagine that you are working on the cached result of the transform where you are going to do subsequent VFX work to.
So all is good here.
Having said all of this, there is the tip of the hat with the Fluid Source SOP and it's intrinsic support for Object level transforms all within the same object and no Object Merge SOP. This tool was designed to take “this” animated object as a fluid source and construct the velocities in several ways including the Object level transforms. Quite handy and useful to know.
—-
But if you are a curious TD and are interested in what is happening under the hood, read on. If not bail here and get your work done. Oh and have a look at the example file and asset posted to this post as an alternative to the Object Merge. For fun.
—-
The Fluid Source SOP fetches the Object level transforms and push that in to the velocity field without using the second object merge trail approach.
It uses the Volume Velocity SOP asset which takes a vel.* volume triplet and with a reference to the object populates those three velocity volumes with the object level transform as velocity.
Then you “could” use an Attribute From Volume SOP to transfer the volume velocities back to the geometry, as utterly ugly as that is, it works.
But you can also lift exactly what the Volume Velocity SOP is doing and construct your own digital asset that actually computes the velocity from the Object level transform on point geometry. Actually compute the full scene transform as that is exactly what the Volume Velocity SOP is doing.
So I whipped up an asset that does just that and in the attached example file I called it “point_velocity_from_object_transform”…
See the example file for all three options including the asset to compute velocity from object transform.
There's at least one school like the old school!
- tamte
- Member
- 8589 posts
- Joined: July 2007
- Online
or just add Point or Attrib Wrangle to your geo with this code
float timestep = 1.0/$FPS;
matrix prevxform = optransform(“..”, @Time-timestep);
matrix xform = optransform(“..”);
vector pos = @P*prevxform*invert(xform);
@v = (@P-pos)/timestep;
it will take object transform for current and previous frame and compute velocity for points from it
float timestep = 1.0/$FPS;
matrix prevxform = optransform(“..”, @Time-timestep);
matrix xform = optransform(“..”);
vector pos = @P*prevxform*invert(xform);
@v = (@P-pos)/timestep;
it will take object transform for current and previous frame and compute velocity for points from it
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- rendereverything
- Member
- 47 posts
- Joined: March 2014
- Offline
- Naomi Dommisse
- Member
- 1 posts
- Joined: July 2014
- Offline
tamte
or just add Point or Attrib Wrangle to your geo with this code
float timestep = 1.0/$FPS;
matrix prevxform = optransform(“..”, @Time-timestep);
matrix xform = optransform(“..”);
vector pos = @P*prevxform*invert(xform);
@v = (@P-pos)/timestep;
it will take object transform for current and previous frame and compute velocity for points from it
THNX!!!
-
- Quick Links