Uncategorized

Select objects with this material

Like the “Assign Material to Selection” function, all Softimage/Maya Guys know the “Select objects with his martial” button. I know this is already an option under the material palette. But who uses this? So here is the code to get the same functionality in Houdini. Just copy/paste the code into this file: C:\Users\USER\Documents\houdini17.0\OPmenu.xml And you are done. On the next houdini restart it should pop up on the right mouse button menu.

 

<?xml version="1.0" encoding="UTF-8"?>
<menuDocument>
    <menu>
        <scriptItem id="TM_Util_SelectObjectsWithThisMaterial">
            <label>TM Tools: Select Objects with this Material</label>
<scriptCode><![CDATA[
import hou
oselectedNodes = hou.selectedNodes()
oShaderTypes = ["redshift::Material", "principledshader::2.0", "redshift_vopnet", "material" ]

for mats in oselectedNodes:
    oShaderCheck = 0
    oShaderType = str(mats.type().name())
    for item in oShaderTypes:
        if oShaderType in item:
                oShaderCheck = 1
    #print mats.name()
    if oShaderCheck == 1:
        oNodes = mats.dependents()
        mats.setSelected(0)
        for oNode in oNodes:
            if str(oNode.type().name()) == "geo":
                #print oNode.path()
                oNode.setSelected(1)

]]></scriptCode>
        </scriptItem>


  	</menu>
</menuDocument>

Retiming Stuff (the old way)

Hey, last week I had the case that I had to do some liquid retiming within Houdini 16.5. Meaning, that there is no proper retime SOP as in Houdini 17. So I did it the classical way with findattrib. If you are in Houdini 16.x this is definitively a way to check out. I have attached an image of my tree. It works really nice, also with changing pointcounts. The only thing that I had to care about was to save an id attribute within my flip simulation. 

SOP: Transform Pieces

This is probably now one of my all time favourite nodes in Houdini: “Tansform Pieces”! For the next project I’m doing some research on how to move poly islands effectively. I started doing my own stuff, but than I came across the Transform Pieces node, that does the whole job for me! Great!

Soft Contact Deformer

Hey!

In commercial work every artist had the case to place/ distribute/ scatter water droplets on to other objects. During the last days an artist came to me who had placed may spheres by hand and was annoyed of the shaping process after the placement.

So I made an easy usable setup in houdini, that enables the artist to do some basic contact shaping.

Here is my graph. First we need a Droplet Sphere and a Target object. The first needed step is a “Point in Volume” Point VOP. I do it in this way because a Group SOP is much much sower. So let’s dive in and this is what we’ll get.

As you see above, with the pcopen I do a closest location query and extract the closest P and N variable. Cool, with some math we get just 0 and 1 values. We’ll use this information later in the tree. With this done we can use an attribute promote to calculate the sum of point that are inside the target volume.

Then we use an attribute create to get the point percentage that is inside the volume. (This retuns values between 0-1)

In this VOP happens all the geometry manipulation. Stating at the right, we find a two way switch where we use the PointInVolume attribute to do either a shrink wrap or to do a simple push along the normals. As you go through the graph you will notice the detail import detail (percInVolume) that is a multiply for the push. With this method we make sure, that the normal push after a single point is in the target volume. I’m sure that it is possible to combine the two point vops, but I’ve still not found a way to do the attribute promotion on vop level. The rest is just an smoothing and subdiv sop. Nothing fancy.

Andreas

 

Law of reflection in ICE

A few days we were thinking of, how we could do a proper reflection of of a vector that hits a surface. So we looked up Wikipedia and found the proper explanation and a formula for this case.

As Wikipedia says:

“…the direction of incoming light (the incident ray), and the direction of outgoing light reflected (the reflected ray) make the same angle with respect to the surface normal, thus the angle of incidence equals the angle of reflection, and that the incident, normal, and reflected directions are coplanar.”

Good. How can we port this to ICE?

Read More

Warning: Use of undefined constant XML - assumed 'XML' (this will throw an Error in a future version of PHP) in /homepages/23/d506891733/htdocs/app506892377/wp-content/plugins/wp-syntaxhighlighter/wp-syntaxhighlighter.php on line 1048