![]() You can also extend quite a bit with python nodes which even allow you to use snippets of inline cpp code (see inlinecpp module) numpy us also available with hou For average of all points, you can also add a vector detail attribute and set each axis to this expression: Centroid(“./youroperator”, D_X) Centroid(“./youroperator”, D_Y) Centroid(“./youroperator”, D_Z) For things like sum, attribVOP is the way to go (since you can simd that). ![]() ![]() Its a very important advantage as it allows for processing of massive data (ie scan data) in a fraction of time Fir doing operations on all points against each other (ie statistics), I feel in most cases regular operators (sops, pops, etc ) are better. Since the number still was a string type at this moment, I had to convert it to a float number with “atof” VEX function, and save it into an attribute called that’s it.Yes, but it is that way foe an important reason, the vex/vop contexts run in a highly multithreaded single instruction multiple data (simd) archittexture, which is why is so fast. So I only had the number left, which I saved into a string attribute called “value”. Once I found it, I used “slice” function to throw away the “roofSize” substring, and kept the rest. That’s where “match” VEX function came in handy. With this, I was able to loop over these tokens until I found the one containing “roofSize” substring. That gave me a “roofSize” array attribute which contained all the separated strings (tokens): So after initializing the “size” attribute, that i need to write the final value into, I split the into individual strings, using “split” VEX function and “_” character as a separator. String value = slice(roofSize, 8, len(roofSize)) Here is how i went about it, using arrays: float size Tricky part was to extract the number following “roofSize” substring, which was used to drive the roof size (as name implies). The actual attribute coming from Maya looked similar to this: “_base_hip_narrow_roofSize2_001Shape”. I needed to extract tokens from it and use it to drive stuff in my Houdini network. ![]() I’ve ran into this on my latest project – I had an alembic geometry coming from Maya (that served as a base building blocks for a procedural modelling tool), with shape name indicating some properties. Using arrays to extract values from a string What this is doing is attribute grow over a mesh controlled by “dist” parameter: Put found points into an array called pts. Let’s see how you go about it.įirst of all, a brief quick jump into arrays if you’ve never used them.Īrray is defined similarly to any other attribute, distinguished by square brackets.Įxamples of how to create an array in an attribwrangle SOP: int array =, "set") //set Cd to greenįor each member of group1, look for close points up to distance threshold specified by “dist” parameter. This allows an entire list to be referenced by a single variable (array). Arrays can be really useful if you want to store and manipulate list of items (usually items of the same type).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |