Scale, MatchSize, Transform to fit dimension.

   7457   3   0
User Avatar
Member
5 posts
Joined: Feb. 2010
Offline
I am sure this is is painfully simple, but I just can't figure out a reasonable way to do this in houdini. I've even tried hacking around in parameters but I can't find what I am looking for even though it looks like I am staring right at it.


What I have:

Geometry that I have brought in from another app.
It is sized in a particular way call it Ox, Oy, Oz. The aspect is correct, but the entire object needs to be uniformly scaled to match a certain height Ay without destroying the aspect of the x, y, z relationship.

The height of the incoming object is assumed to be random(ish), but we know what we want it to be. So I need to normalize it to some known value like 1 so that I can scale it to the proper size.

In houdini I can easily create a reference box with a known size, but if I use MatchSizeSOP I cant seem to find a way to only pass the “y” data, so if I feed it a 1x,1x1 box my model is horribly distorted. The various aspects of the imported object are assumed unknown, but correct before import.

I “could” use transformSOP or edit or whatever, but I can't seem to find a parameter to extract the Ox, Oy, Oz data from the geometry, instead I only seem to be able to get the point cloud data, for each fo the thousands of vertexes. So useless. I can use the BOunding Box SOP but still I can't exxtract a proper “height” “width” “depth” from it…. if I right click on it, i can see these numbers. but after hours of reading Houdini's tech support I can't find how to access that infor thru expression.



So in simple…. how is this done?

It has to be easy.
User Avatar
Member
875 posts
Joined: Oct. 2008
Offline
Like this?

Attachments:
scaley.hipnc (66.2 KB)

--
Jobless
User Avatar
Member
5 posts
Joined: Feb. 2010
Offline
I think this will work…

Im not 100% sure how it works, but that is why I am learning right?


Thanks
User Avatar
Member
1926 posts
Joined: Nov. 2006
Offline
Took me a while to find it, here is a version of the MatchSize otl that I modified a long time ago. By default it does the exact same as the one in Houdini but I added a bunch of extra controls to it.

By default it matches to all axes, which will distort your shape. I've adding a menu that lets your match to a particular axis while maintaining the shape. You can also just choose Min/Max axis to ensure you match to the smallest, or the largest sized axis of your source geometry.

You can also override the size of your input object to get different looks.

Finally, because I was experimenting with scaling geo up, performing operations, then needing it go to back down again, I've added an option to have a Create/Invert attribute. If you are matching an object you can set Create Attributes and it will store a transform of what it did. If you then do some stuff and append another asset afterwards, this time setting Invert Transform you will reposition the object back to what it originally was.

Now I haven't touched or looked at this thing in a long time but I'm pretty sure it should work properly since it was important in what I was doing long ago.

Attachments:
sop_matchsize.otl (9.0 KB)

Graham Thompson, Technical Artist @ Rockstar Games
  • Quick Links