![]() There are many more patterns you can make and online help like makes it super easy to test and debug. This is just scratching the surface of what you can do with regular expressions, its a great way of seaching for values in a sting when you are not 100% sure the string pattern is all was the same. String groups = detailintrinsic(0, "primitivegroups") convert numbered groups to a numbered attribute The code for that run over primitives with a list of primitive groups looks like this. With step two sorted step 3 will be easy, all we need to do is use a foreach loop to go through the group array and find the group numbers for primitives that belong to that group and write that to an attribute. The lack of an underscore in string two doesn’t even matter with this method so that is taken cares of as well. To find that the pattern is \d which means find strings of numbers between 3 or 6 which compensated for one of my groups having less padding than the others. If the above code makes sense lets look at searching for 4 numbers in a row. The pattern \d finds all the digits in a string while \D finds all the non digit characters. To demonstrate I will how it works lets apply a re_find() to the first group string “asset_foo_0001_bar”. These are usually use by string searching algorithms like in this case in VEX in Houdini. ![]() Regex is a sequence of characters that define a search patterns. If you have never seen these before or have and wondered what they are for, well they are what is called regular expressions or regex. VEX has a couple of functions to handle string manipulation and the really interesting ones for this problem are the re functions, there are a couple re_find(), re_match() and a few other ones. The bad naming above with different padding and some numbers not having underscores was deliberate as that is what I was dealing with. The groups are named something like:Ĭombining all the foo and bar groups is easy using a group combine SOP.īut what takes a bit more thinking is extracting the numbers so you have an attribute that reads like this: Use existing groups when selecting points. So that’s step one, pretty easy right? The is were it get a little more tricky. Houdini - cgwiki - Tokeru Houdini VEX Groups VoxelPixel WebIntroduction. In vex you can use the Detail Intrinsic function to write all the primitive groups to a string array, you can do the same point edge and vertex groups. string groups = detailintrinsic(0, "primitivegroups") So that is the back story and here is my solution. Luckily I could access the groups while the geometry was still packed primitives so the solution was to convert the groups to a single numbered attribute and get rid of the groups before unpacking or converting to full Houdini geometry. I really wanted to keep the incoming part numbers because so parted where linked to other parts with different names and not all part where connected with connectivity so I quick Connectivity SOP trick wouldn’t do the job. In this cache filling 64GB and the cracking Houdini after filling the swap as well. Group houdini vex Houdini: 10 Useful VEX Snippets for Group Expression How to. If you tried it before you will know that unpacking heavy geometry with a lot of groups is any easy way to fill up your ram. ![]() Its came in from Maya with thousands of primitive groups for different numbered parts of the geometry. See the VEX chapter for general information on the VEX language.Today at work I was loading some really heavy geometry into Houdini that needed FX added to it. See VEX snippets for basic information on the syntax available in the snippet parameter. The VEX snippet parameter lets you enter a snippet of VEX code to run on the input geometry. Unlike the Attrib Create SOP, this does not use local variables.įurther, all backtick expressions and $F variables will be evaluated at frame 1, This evaluation will be done at the current time. The path is relative to this node ( ch("parm") will evaluate the parameter parm on this node). You can use the VEX function ch to evaluate parameters. Press MMB on the node to see any error output from the snippet. If you need to write a more complicated multi-line function, use the Attribute Wrangle with generated VEX snippet can be viewed by updating the generated code tab. Each expression is wrapped with an assignment to the given group and a semicolon. Unlike Wrangle nodes, you do not have to write a complete VEX statement, only a VEX expression. It can access information from other geometry using attributes and VEX functions. (depending on the Class parameter) in the input geometry.Įach expression will be assigned to the specified group. ![]() This node runs the expression on every point/primitive/vertex
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |