Korny Klown2
But it also couldn't be more complicated then
HScript: $OS
Python: set a keyframe + hou.expandString('$OS')
What is so difficult about
Python: os() (and of course autodetect the expression)
I don't understand why it is perfectly possible that a parameter automatically detects an HScript expression but doesn't autodetect a Python expression.
I hear you. Python in parameters is a long standing issue, I'm usually not conscious of it, because I hardly use Python here. But there is a little confusion in your post, so I'll try to explain. See bellow.
BTW you can use
pwd() as a stand for
$OS… which comes from hou.pwd() returning current operator in Python. Like ch(), parm(), etc these common methods are imported into parameter's namespace. See
Help [sidefx.com]for more details on that. Houdini couldn't use
os() perhaps because
os is one of the most commonly used
module [docs.python.org]in Python if not for other reasons.
BTW2 single Alt+LMB for setting keyframe/toggling Python expression isn't that bad after all
What makes this even more confusing that some Python function get automatically detected and some not.
I just typed frame() into the sizex parameter and it workes perfectly fine, I don't even have to manually set a kexframe at first so why do I have to manually set a key and then type hou.expandString('$OS') to get the same functionality as $OS. The question is, why is there a perfect working equivalant to $F (frame()) but no equivalent to $OS (os()). I mean the technologie is there….
Because you put
frame() into numeric parameter, where things are simple: anything which is not a number is an expression.
Contrary to this you use
$OS in string parameter, so Houdini can't know if a string you have just typed has to be treated literally or as an expression to evaluate.
$OS isn't expression per se, if it was, you would have to use back-tick to evaluate it like: `expression()`.
$ at the front of $OS says: I'm a local/global variable, not a string. Type
\$OS to turn it into a string and see how Houdini doesn't know what to do with that.
The problem is that back-ticks don't work with Python, that's why set keyframe is used instead as I suppose.
SYmek
ForeachSOP allows you to execute an action on each part of a geometry based on some criteria. In that case, it simply deletes all primitives with the attribute value other than currently proceeded. In plain English: for every distinct attribute value do something - but only with the part of a geometry, that holds that value.
So the geometry does indeed gets stored with the values?
Sorry I didn't get that?
SYmek
This is exactly the reason why primnum was created: to allow selecting subdivided geometry based on it's pre-subdivided primitives numbers. SubdivideSOP intelligently assigns to new polygons its parent's attributes values.
How do I know that this node is so intelligent? This behaviour is not documented in the help, that leaves me guessing what a node is capable to do.
If you apply a varying color to a mesh and start changing topology by inserting new primitives (polygons), they usually get color from neighboring polys, right? In any software there is… This is the same behavior. Houdini is very consistent in that manner. It inherits or interpolates any attribute present on a geometry. At least it never deletes anything.