Skip to content

Commit

Permalink
Update for Houdini 19.5
Browse files Browse the repository at this point in the history
Release 7.1.6

1. Updated for Houdini 19.5.

2. New expression functions added:

    ispdgeval
    strsplit
    strsplitcount

    Tip: to read about new functions quickly,
    copy the list into an empty Sublime Text document,
    set the HScript syntax, and check the documentation helpcards.

Update install message
  • Loading branch information
teared committed Jul 21, 2022
1 parent cf0f22c commit 70a8908
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 6 deletions.
5 changes: 4 additions & 1 deletion commands/helpcards.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
"isclosed": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/isclosed\">isclosed</a></h1><p class=\"summary\">Returns 1 if a primitive is closed.</p><div class=\"usage\"> <code>isclosed(<code class=\"var\">surface_node</code>, <code class=\"var\">prim_num</code>)</code></div><p>This is the same as <a href=\"https://www.sidefx.com/docs/houdini/expressions/iswrapu\">iswrapu</a>, and\nworks on polygonal, NURBS, and Bezier curves and surfaces.</p><h2>Related</h2><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/iswrapu\">iswrapu</a></div><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/iswrapv\">iswrapv</a></div></body>",
"iscollided": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/iscollided\">iscollided</a></h1><p class=\"summary\">Returns 1 if a specified point has collided with something.</p><div class=\"usage\"> <code>iscollided(<code class=\"var\">surface_node</code>, <code class=\"var\">pointnumber</code>)</code></div><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">iscollided(\"../particle1\", $PT)</code></div></body>",
"ishvariable": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/ishvariable\">ishvariable</a></h1><p class=\"summary\">Returns 1 if a specified Houdini environment variable exists.</p><div class=\"usage\"> <code>ishvariable(<code class=\"var\">variable_name</code>)</code></div><p>Checks only houdini variables to see if <code>variable_name</code> exists.\nSystem variables are not checked.</p><h2>Related</h2><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/isvariable\">isvariable</a></div></body>",
"ispdgeval": "<body><span class=\"padder\"><span class=\"pillow\">19.0</span></span><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/ispdgeval\">ispdgeval</a></h1><p class=\"summary\">Returns 1 if the parameter is being evaluated as part of a PDG cook, else 0</p><div class=\"usage\"> <code>ispdgeval()</code></div><h2>Related</h2><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/pdgattrib\">pdgattrib</a></div><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/pdgattribs\">pdgattribs</a></div></body>",
"isspline": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/isspline\">isspline</a></h1><p class=\"summary\">Returns 1 if a specified primitive is a NURBs or Bezier curve or surface.</p><div class=\"usage\"> <code>isspline(<code class=\"var\">surface_node</code>, <code class=\"var\">prim_num</code>)</code></div></body>",
"isstuck": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/isstuck\">isstuck</a></h1><p class=\"summary\">Returns 1 if a specified point is a stuck particle.</p><div class=\"usage\"> <code>isstuck(<code class=\"var\">surface_node</code>, <code class=\"var\">pointnumber</code>)</code></div><p>Warning: this function can be slow.</p><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">isstuck(\"../particle1\", $PT)</code></div></body>",
"isvariable": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/isvariable\">isvariable</a></h1><p class=\"summary\">Returns 1 if a specified Houdini or system environment variable exists.</p><div class=\"usage\"> <code>isvariable(<code class=\"var\">variable_name</code>)</code></div><h2>Related</h2><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/ishvariable\">ishvariable</a></div></body>",
Expand Down Expand Up @@ -396,11 +397,13 @@
"strlen": "<body><p class=\"summary\">Returns the number of characters in a string.</p><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/strlen\">strlen</a></h1><div class=\"usage\"> <code>strlen()</code></div><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">strlen(\"abcde\")=5</code></div></body>",
"strmatch": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/strmatch\">strmatch</a></h1><p class=\"summary\">Returns 1 if a string matches a pattern, including case.</p><div class=\"usage\"> <code>strmatch(<code class=\"var\">pattern</code>, <code class=\"var\">s</code>)</code></div><p>This function is case-sensitive. For case-insensitive matches,\nuse <a href=\"https://www.sidefx.com/docs/houdini/expressions/strcasematch\">strcasematch</a>.</p><h2>Notes</h2><div class=\"related\">Returns 1 if any patterns in the <code class=\"var\">pattern</code> string matches string <code class=\"var\">s</code>,\n or 0 if no patterns match.</div><div class=\"related\">In order to match, a pattern must match the <code class=\"var\">s</code> string\n <em>from beginning to end</em>. Use wildcards (<code>*</code>) to match substrings,\n e.g.</div><div class=\"codeblock\"><code class=\"codeline\">strmatch(\"bar\", \"foobarbaz\") = 0</code><code class=\"codeline\"> strmatch(\"*bar*\", \"foobarbaz\") = 1</code></div><div class=\"related\"><code class=\"var\">pattern</code> is a space-separated list of one or more patterns.\n <strong>This can cause unintuitive behavior of this function</strong>.\n For example:</div><div class=\"codeblock\"><code class=\"codeline\">strmatch(\"foo bar\", \"foo bar\")</code></div><p>\u2026<strong>will return 0</strong>, because the first argument consists of <em>two</em>\n patterns, <code>foo</code> and <code>bar</code>, and neither of those patterns match\n <code>foo bar</code> (since the pattern must match from beginning to end).</p><p>Similarly,</p><div class=\"codeblock\"><code class=\"codeline\">strmatch(\"foo bar\", \"foo\")</code></div><p>\u2026will return 1, because the string matches the first of the\n two arguments in the pattern (<code>foo</code> and <code>bar</code>).</p><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">strmatch(\"foo*\", \"foobar\") = 1</code></div><div class=\"codeblock\"><code class=\"codeline\">strmatch(\"?bar\", \"fred\") = 0</code></div><div class=\"codeblock\"><code class=\"codeline\">strmatch(\"foo*,bar*\", \"bar\") = 1</code></div><h2>Related</h2><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/strcmp\">strcmp</a></div><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/strcasecmp\">strcasecmp</a></div><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/strcasematch\">strcasematch</a></div></body>",
"strreplace": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/strreplace\">strreplace</a></h1><p class=\"summary\">Replaces substrings with a new string.</p><div class=\"usage\"> <code>strreplace(<code class=\"var\">s</code>, <code class=\"var\">old</code>, <code class=\"var\">new</code>)</code></div><p>Returns a copy of <code class=\"var\">s</code> with any occurances of the\n<code class=\"var\">old</code> string replaces with the <code class=\"var\">new</code> string.</p><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">echo `strreplace(\"/project/project.hip\", \"project\", \"char01\")`</code></div><p>Returns <code>/char01/char01.hip</code>.</p></body>",
"strsplit": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/strsplit\">strsplit</a></h1><p class=\"summary\">Returns one component of a string split by some separators.</p><div class=\"usage\"> <code>strsplit(<code class=\"var\">s</code>, <code class=\"var\">separators</code>, <code class=\"var\">component</code>)</code></div><p>Returns the substring in <code class=\"var\">s</code> at position <code class=\"var\">component</code> when it is broken\ninto substrings using any of the characters in <code class=\"var\">separators</code>. If\n<code class=\"var\">separators</code> is an empty string, then <code class=\"var\">s</code> is split on any whitespace\ncharacter.</p><p>If <code class=\"var\">component</code> is negative, it is counted backwards from the last substring,\nso <code>-1</code> will return the last substring. If <code class=\"var\">component</code> is out of bounds,\nan empty string is returned.</p><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">echo `strsplit(\"foo//bar//child/\", \"/\", -2)`</code></div><p>Returns <code>bar</code>.</p><div class=\"codeblock\"><code class=\"codeline\">echo `strsplit(\":a:b c;d;e\", \":;\", 100)`</code></div><p>Returns <code></code>.</p></body>",
"strsplitcount": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/strsplitcount\">strsplitcount</a></h1><p class=\"summary\">Returns the number of components in a string split by some separators.</p><div class=\"usage\"> <code>strsplitcount(<code class=\"var\">s</code>, <code class=\"var\">separators</code>)</code></div><p>Returns the number of components in <code class=\"var\">s</code> when it is broken into substrings\nusing any of the characters in <code class=\"var\">separators</code>. If <code class=\"var\">separators</code> is an empty</p><p>string, then <code class=\"var\">s</code> is split on any whitespace character.</p><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">echo `strsplitcount(\"foo//bar//child/\", \"/\")`</code></div><p>Returns <code>3</code>.</p><div class=\"codeblock\"><code class=\"codeline\">echo `strsplitcount(\":a:b c;d;e\", \":;\")`</code></div><p>Returns <code>4</code>.</p></body>",
"sturb": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/sturb\">sturb</a></h1><p class=\"summary\">Generates spatially coherent 3D noise based on sparse convolution.</p><div class=\"usage\"> <code>sturb(<code class=\"var\">X</code>, <code class=\"var\">Y</code>, <code class=\"var\">Z</code>, <code class=\"var\">depth</code>)</code></div><p>Spatially coherent noise gives random numbers which are close\nto each other when the X, Y, Z inputs are close to each other.</p><p><code class=\"var\">depth</code> is the amount of fractalization of the noise.</p><p>This is very similar to <a href=\"https://www.sidefx.com/docs/houdini/expressions/turb\">turb</a>, except instead of finding noise values\non a fixed lattice and interpolating, this function finds noise\nvalues on points scattered in space and interpolated according\nto the Voronoi decomposition.</p><h2>Related</h2><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/turb\">turb</a></div><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/noise\">noise</a></div><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/snoise\">snoise</a></div></body>",
"substr": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/substr\">substr</a></h1><p class=\"summary\">Returns a substring of a string.</p><div class=\"usage\"> <code>substr(<code class=\"var\">s</code>, <code class=\"var\">start</code>, <code class=\"var\">length</code>)</code></div><p>Returns the characters of <code class=\"var\">s</code> between the <code class=\"var\">start</code>\nposition and the <code class=\"var\">start</code> + <code class=\"var\">length</code> position.</p><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">echo `substr(\"STRING\", 3, 1)`</code></div><p>Returns <code>I</code>.</p><div class=\"codeblock\"><code class=\"codeline\">echo `substr(\"STRING\", 0, 3)`</code></div><p>Returns <code>STR</code>.</p><div class=\"codeblock\"><code class=\"codeline\">echo `substr(\"STRING\", 3, 2)`</code></div><p>Returns <code>IN</code>.</p></body>",
"surflen": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/surflen\">surflen</a></h1><p class=\"summary\">Returns the length of the 3D curve between two points on a surface.</p><div class=\"usage\"> `surflen(<code class=\"var\">surface_node</code>, <code class=\"var\">prim_num</code>, <code class=\"var\">ustart</code>, <code class=\"var\">vstart</code>, <code class=\"var\">ustop</code>,</div><p><code class=\"var\">vstop</code>)`</p><p>Given a surface and two parametric points in its domain (\n<code>[ustart,vstart]</code> and <code>[ustop,vstop]</code> ), surflen computes the length of the\n3D curve that stretches between the two points. This curve is the 3D\nimage of the line in the surface domain, whose end-points are\n<code>[ustart,vstart]</code> and <code>[ustop,vstop]</code>. If either u or v is kept constant,\nthe 3D curve coincides with an isoparm.</p><p>All four uv numbers are unit values, defined in the <code>[0,1]</code> interval.</p><h2>Note</h2><p>the primitive must be either a NURBS surface or a Bezier surface. A\n polygonal mesh can be simulated by a bi-linear Bezier surface (u and\n v order 2).</p><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">surflen(\"/obj/geo1/grid1\", 12, 0, 1, 0.2, 0.8)</code></div><p>Computes the length of the curve on surface #12, defined\n parametrically by the surface domain points <code>[0,1]</code> and <code>[0.2, 0.8]</code>.</p><h2>Related</h2><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/arclen\">arclen</a></div><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/normal\">normal</a></div><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/curvature\">curvature</a></div><div class=\"related\"><a href=\"https://www.sidefx.com/docs/houdini/expressions/unituv\">unituv</a></div></body>",
"system": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/system\">system</a></h1><p class=\"summary\">Runs a system command line and returns the output.</p><p>This will transform all linefeeds and carriage returns into spaces.\nTo get the raw output, use systemRAW.</p><div class=\"usage\"> <code>system(<code class=\"var\">command_string</code>)</code></div><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">system(\"finger\")</code></div></body>",
"systemES": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/systemES\">systemES</a></h1><p class=\"summary\">Runs a system command line and returns the exit status.</p><div class=\"usage\"> <code>systemES(<code class=\"var\">command_string</code>)</code></div><p>This function returns the <em>exit code</em> of the command. To get\nthe <em>output</em> of the command instead, use <a href=\"https://www.sidefx.com/docs/houdini/expressions/system\">system</a>.</p><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">systemES(\"test -r $HOME/houdini/123.cmd\") = 0</code></div></body>",
"systemES": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/systemES\">systemES</a></h1><p class=\"summary\">Runs a system command line and returns the exit status.</p><div class=\"usage\"> <code>systemES(<code class=\"var\">command_string</code>)</code></div><p>This function returns the <em>exit code</em> of the command. To get\nthe <em>output</em> of the command instead, use <a href=\"https://www.sidefx.com/docs/houdini/expressions/system\">system</a>.</p><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">systemES(\"test -r $HOME/houdiniX.Y/123.cmd\") = 0</code></div></body>",
"systemRAW": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/systemRAW\">systemRAW</a></h1><p class=\"summary\">Runs a system command line and returns the output with no processing.</p><p>Unlike the system command, this does not transform linefeeds or\ncarriage returns into spaces.</p><div class=\"usage\"> <code>systemRAW(<code class=\"var\">command_string</code>)</code></div><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">systemRAW(\"cat myfile.txt\")</code></div></body>",
"tan": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/tan\">tan</a></h1><p class=\"summary\">Returns the tangent of the argument.</p><div class=\"usage\"> <code>tan(<code class=\"var\">degrees</code>)</code></div><h2>Examples</h2><div class=\"codeblock\"><code class=\"codeline\">tan (60)=1.73205</code></div></body>",
"tanh": "<body><h1><a href=\"https://www.sidefx.com/docs/houdini/expressions/tanh\">tanh</a></h1><p class=\"summary\">Returns the hyperbolic tangent of the argument.</p><div class=\"usage\"> <code>tanh(<code class=\"var\">number</code>)</code></div></body>",
Expand Down
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"7.1.2": "messages/7.1.2.txt",
"7.1.3": "messages/7.1.3.txt",
"7.1.4": "messages/7.1.4.txt",
"7.1.5": "messages/7.1.5.txt"
"7.1.5": "messages/7.1.5.txt",
"7.1.6": "messages/7.1.6.txt"
}
22 changes: 22 additions & 0 deletions messages/7.1.6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Houdini add-on for Sublime Text:
https://github.com/teared/HScript


Release 7.1.6


1. Updated for Houdini 19.5.

2. New expression functions added:

ispdgeval
strsplit
strsplitcount

Tip: to read about new functions quickly,
copy the list into an empty Sublime Text document,
set the HScript syntax, and check the documentation helpcards.


Open issues for bug reports, requests, suggestions, etc:
https://github.com/teared/HScript/issues
2 changes: 1 addition & 1 deletion messages/install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ Usage

For the rest, check Sublime Text Documentation, it has many small features
that make textual editing easy and powerful.
https://www.sublimetext.com/docs/3/
https://www.sublimetext.com/docs/
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Shortcut: `Ctrl+Alt+D`.
For the rest, check [Sublime Text Documentation], it has many small features
that make textual editing easy and powerful.

[Sublime Text Documentation]: https://www.sublimetext.com/docs/3/
[Sublime Text Documentation]: https://www.sublimetext.com/docs/


## License
Expand Down
12 changes: 12 additions & 0 deletions snippets/expressions.sublime-completions
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,10 @@
"trigger": "ishvariable(variable_name)",
"contents": "ishvariable(${1:variable_name})"
},
{
"trigger": "ispdgeval()",
"contents": "ispdgeval()"
},
{
"trigger": "isspline(surface_node, prim_num)",
"contents": "isspline(${1:surface_node}, ${2:prim_num})"
Expand Down Expand Up @@ -1557,6 +1561,14 @@
"trigger": "strreplace(s, old, new)",
"contents": "strreplace(${1:s}, ${2:old}, ${3:new})"
},
{
"trigger": "strsplit(s, separators, component)",
"contents": "strsplit(${1:s}, ${2:separators}, ${3:component})"
},
{
"trigger": "strsplitcount(s, separators)",
"contents": "strsplitcount(${1:s}, ${2:separators})"
},
{
"trigger": "sturb(X, Y, Z, depth)",
"contents": "sturb(${1:X}, ${2:Y}, ${3:Z}, ${4:depth})"
Expand Down
Loading

0 comments on commit 70a8908

Please sign in to comment.