Jump to content

Command Name ?


Arthur Spooner

Recommended Posts

$YMAX is topmost Y coordinate of input geometry. Same as bbox(opinputpath(".", 0), D_YMAX) but shorter and cleaner.
bbox("../box1/", D_YMAX) is topmost Y of box1 node. The whole thing can be written as:

bbox(opinputpath(".", 0), D_YMAX) + bbox("../box1/", D_YMAX)

Note that $YMAX will work only on transform node, it's a local variable. Expression function will work anywhere. Also note that $YMAX and D_YMAX are totally different things, first is an actual point Y value, the latter one of aforenamed eight "integers", used to determine result you need to get from a function.

Edited by f1480187
Link to comment
Share on other sites

Also note that $YMAX and D_YMAX are totally different things, first is an actual point Y value, the latter one of aforenamed eight "integers", used to determine result you need to get from a function

 

 

Sorry I didn't understand the latter of your explanation ?

 

$YMAX takes into consideration the top most of box1 when it's combined with anything ?

Link to comment
Share on other sites

If you have no idea what variables and functions are, try to follow a starter's tutorial (sections 3 to 5) on Python's website. Houdini's Python Shell (Alt+Shift+p) is a typical Python interpreter, no need to install anything. If you talking about exact in-code implementation, probably only devs can answer this.

Edited by f1480187
Link to comment
Share on other sites

a good read through the docs would really help here, and in the textport (Windows > HScript Textport) you can do:

/ -> exhelp -k bbox

will return

 

bbox     centroid 
 
"help -k somthing" or "exhelp -k something"= when you use the -k flag the command will return all the commands or functions that have the string after the -k in them
 
then you can do 
/ -> exhelp bbox
 
and you'll get 
float bbox (string surface_node, float type)
        Returns bounding box information for a surface node.
        
        USAGE
        
            bbox(<surface_node>, <type>)
        
            The <type> can be one of D_XMIN, D_YMIN, D_ZMIN, D_XMAX, D_YMAX,
            D_ZMAX, D_XSIZE, D_YSIZE, or D_ZSIZE for the corresponding values of
            the bounding box.
        
        RELATED
        
        
         *  centroid
 
D_XMIN etc refer to the dimentions of that component
for a 1 unit box sitting on the ground
D_YMIN = 0
D_YMAX = 1
D_XMIN = -0.5 (if the box is at the origin)
D_XMAX = 0.5

etc

 

the local variable $YMAX would in the above case refer to the maximum value in the Y dimension = 1

 

 

Houdini used to call a Transform node "xform"

now we actually call the node "transform"

but they are the same node

Link to comment
Share on other sites

1. You can click on the parameter's label to see exact field's values. However, will not work for anything using local vars currently, showing zeros. Ctrl+Shift+LMB on parameter will forcefully evaluate it to the true value. Try this for different parts of expression, e.g. for $YMAX or for bbox("../box1/", D_YMAX) alone, or even for D_YMAX.

 

2. bbox function returns a float, not a string with path. The path is what you provide with the first argument - a string looking like a path. Two dots means parent network of this node, so, it is a relative path similar to something absolute like /obj/geo1/box1. Then bbox function use that path and return a number to you. There are 8 possible floats can be returned, and second bbox's argument is used to determine it.

Edited by f1480187
Link to comment
Share on other sites

Try this for different parts of expression, e.g. for $YMAX or for bbox("../box1/", D_YMAX) alone, or even for D_YMAX.

 

 

Sorry, what do I try that is different, I have that expression in place ?  :)

 

What you are saying is; $YMAX is the interger and the path is a float ? How does bbox turn a path a return a float number ?

Link to comment
Share on other sites

1. $YMAX and D_YMAX may look similar in some way, but they are not the same things and the values are different (if there is no coincidence).

 

2. $YMAX and bbox(path_to_input, D_YMAX) may look different. But, actually, they are same resulting values.

 

$YMAX is topmost Y coordinate of input geometry. Same as bbox(opinputpath(".", 0), D_YMAX)

See the docs about the function returning path.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...