Spring SOP

   6978   8   0
User Avatar
Member
30 posts
Joined: July 2005
Offline
Hi there,

I'd like to learn that if there is a way to use weight maps with a spring sop ? So that I can assign values to points gradually.

Thanks.
Life is too short, to be a 3d Animator.
User Avatar
Member
7714 posts
Joined: July 2005
Online
Try this:
1. Sphere SOP:
Primitive Type = Polygon
2. Append Spring SOP:
Nodes tab > Add Mass Attribute = On
This is just a dummy sop to add the mass attribute.
3. Append Paint SOP:
Turn On Override Color. Change Cd to mass
BG = 0.1 0.1 0.1
Brush rab > Radius = 0.3
4. With your mouse in the Viewer, hit the Enter key
5. Decrease the mass in the points at the top by middle click dragging on them until they're blue. We just want a difference between the points at the bottom and the top.
6. Append another Spring SOP to the Paint SOP:
Forces tab > External Force: 0 -9.8 0
Nodes tab > Add Mass Attribute = On
7. Hit play. See how the top points lag from the bottom points of the sphere.
8. Go back to frame 1. Bypass the paint sop. Hit play again. Notice how that lag no longer occurs.

You can also do the same with the Drag attribute as well (use the name drag instead of mass when painting and turn on Add Drag attribute). You can substitute the paint sop with an AttribCreate set to the attribute name and then use the tex() expression function to reference a picture to use as your map if you wish. If you had uv coordinates, then you could use $MAPU and $MAPV as the U and V values into the tex() expression.
User Avatar
Member
7714 posts
Joined: July 2005
Online
Just rereading your question, I'm not sure exactly what you want now.

Another thing to try is to just append a Blend SOP after your regular Spring and then add the original (non-spring) geometry as the second input. Now you can blend between them…
User Avatar
Member
30 posts
Joined: July 2005
Offline
Thank you very much for your kind reply, edward.

I'm a newbie using (studying) the apprentice version and I'm very curious about if Houdini has all the lacking features of my stone age software. Altough this may not be at the top priority while there are so much to learn, but that's a very specific feature I'm missing of in Lightwave3D.

You're right that I asked the question in a very straight forward manner, but if into more detail; I was planning to use it for a cloth simulation and some soft body stuff in medical animations. It would be nice if I can define the values of springness with the help of a weight map while animating some bacteria like things with tentacles or tails..

I'm trying your receipt right now, and will turn back with the results. Thanks again for your interest.

Later,
Diya.
Life is too short, to be a 3d Animator.
User Avatar
Member
30 posts
Joined: July 2005
Offline
Hi there Edward,

I tried your method, and it worked very well, at least I saw the possibility of my thought. I changed the BG color to 0.5 0.5 0.5 and painted the upper most points with that value while leaving the middle areas painted at 0.1 0.1 0.1 and lower areas unpainted and saw the difference on effect.

I'd like to ask a couple of questions if you'd care to answer. I'm not very sure of why I applied the first spring sop. Why is it necessary if I applied the second spring sop after the paint sop. You told that it was just a dummy sop to add the mass attribute. But I do not get the logic behind it. Also as far as I searched and investigated the pdfs, I couldn't find the topic that covers the area where I typed “mass” instead of “cd” (and “drag” at the second example) . How should I know or where to learned it? Is that a misdocumantation about the Apprentice version?

Thanks in advance,
Diya.
Life is too short, to be a 3d Animator.
User Avatar
Member
7714 posts
Joined: July 2005
Online
I just realized where a default set of point attributes can be found. The dummy spring sop was just what I used because I forgotten about the Point SOP. Substitute your dummy spring sop with a Point SOP. As you add each attribute, middle-click on the node in the network editor to see the name of the created attribute. For example, if you add color and then middle-click, you will note that it added the attribute Cd (which I suspect stands for Colour, Diffuse for historical reasons). So if you note on the Particle page of the Point SOP, you can add the Tension attribute. Right-click on the word Tension, choose “Delete Channel”. Now manually enter in a value for the tension of the points. If you right-click on the point sop and choose “Spreadsheet”, you can see the actual created values.

Having said all that, the tension attribute doesn't seem to be recognized by the Spring SOP. This was the old method of doing things. You would need to go to POPs to use the tension attribute. Append a POP Network SOP to your Point SOP. Dive down into it by clicking on it and hitting the i or enter key. Put down a Softbody POP. Under Geometry Source, choose “First Context Geometry”.

There probably is a lack of clear documentation on the idea of geometry attributes in Houdini. Their idea is pretty much like a “weight map” except that it's more general. An attribute in Houdini jargon refers to a piece of information usually associated with geometry. (I'll ignore the word in other contexts for now.) In Houdini, you can have attributes for each vertex (this term has a very specific meaning in Houdini which differs from points), point, primitive, or for an entire object (called detail). This is called the Attribute Class. If you middle-click on the dummy spring sop and the one before it, you will note that in the dummy spring sop, it has created a Point attribute named “mass”. Note that you should ensure that all your attributes are always named uniquely. Attributes also have an Attribute Type. They can be Float, Integer, Vector (special form of 3 floats), or String. Attributes also have a size. For example, you could have a float attribute that was 4 floats.

So for our particular example, one could have also noted the type of attribute that was created by the dummy spring sop, and substituted it with an AttribCreate SOP to directly create the right attribute. Try it and then set these parameters on it:
Name = mass
Class = point
Type = Float
Size = 1
Default = 1 1 1
Value = 1 1 1
User Avatar
Member
30 posts
Joined: July 2005
Offline
Thanks edward, that was very informing. Thank you for sparing your time. I tried the method with AttribCreate sop and it worked very well, I understand it more clearly now. But when I tried Point sop method I'm a bit confused, because my sphere got lost! Already I carefully checked the steps it didn't work for me. By the way you mentioned it as the older way to do things.

I did not get the diffrence between vertex and points in Houdini. Which way they differs from each other.

The fact is that, Houdini is very, very deep and altough it has a nice logical way to do things, I feel lost most of the time, even when modelling. As I dived into VOPs and SHOPs, I felt really idiot May be that's because the documentation is not very step by step manner and it is more like a reference manual. I'm carefully watching and applying the video tuts about shading but they leave me with more and more questions. It's a bit confusing doing things node based rather than a layered method. It quickly becomes ‘node mazed’! I think it is very difficult to learn when there's nobody around you to ask if you left to hands of manuals. Thanks to this forum, it is encouraging to continue digging.

Thanks again for your kind replies,

Diya.
Life is too short, to be a 3d Animator.
User Avatar
Member
7714 posts
Joined: July 2005
Online
I think I forgot to mention that you have to go back to frame 1 for POPs to recook. That's probably why your sphere disappeared. After putting down the SoftBody POP, go back to frame 1 and it should reappear.

I had meant that the Spring/Particle SOPs as being older methods.

The difference between a point and a vertex is that points are always unique whereas vertices are references to points within a primitive. Let's say you have two quads that share the same edge. That means that there are 6 points, two of which are shared between the two quads. However, there are 8 vertices (4 vertices per quad). Another way to think of it is that a point has as many vertices as the number of primitives using it.

The practical difference mainly arises when dealing with uv textures. uv's in Houdini are simply float attributes of size 3. However, they can be point uv's or vertex uv's. If it's a point uv, then each point can only correspond to 1 location in your uv image. However, if it's a vertex uv, then each point can correspond to many locations in your uv image (as many as the number of primitives using it).
User Avatar
Member
30 posts
Joined: July 2005
Offline
That's clear now, thanks. Now I see it's a good way to define UV's to share same points or unique ones.

Back to first example of using weights with spring op, I developed it little further exprementing with curves. I drew an 8 point bezier curve, swept a 4 point poly with that curve, append AttribCreate - Paint - Spring sops after the curve. So painting the curve with weights worked as well with cool results. (Hard working grasshopper )

Happy new year to all,

Cheers.
Diya
Life is too short, to be a 3d Animator.
  • Quick Links