![]() ![]() this is one way of reading attributes, this is only valid, when // point count is exactly the same in both inputs, then attribute from // point from second input with the same is retrieved // can also be replaced with since its signature can be guessed as it is // commonly used attribute, however I prefer explicit declaration :) // - vector, - integer, - float, - matrix3, - vector4 // - matrix4, - matrix2, - vector2, - string, //P1 = //P2 = // inputs numbering starts at 0, therefore 1 refers to the second input // this approach is useful for querying attributes from different points (other from the currently processed one) // node input numbering starts from 0 (first input), 1 (second input). you can also reference parameters from external nodes // if there is an expression (Python/hscript) in the parameter, // it will be evaluated float up = chf( "./params_1/move_up") you can also use optioinal argument for time which will enable you to evaluate // the channel at different frame // // once you type ch*() in your code, you can press a button on the right, to // generate a UI parameter for it automatically, you can do the same by hand as well float y = chf( "y_position") * multi-line comments can be typed using this syntax */ // in vex you can evaluate values from parameters on this node // by calling ch*() function, with * representing a signature, check the docs // for the full list, some of them: chv() - vector, chu() - vector2, chs() - string // chramp() - ramp, chp() - vector4, chi() - int, chf() - float, ch4() - matrix, ch3() - matrix3. DOPs / Geometry Wrangle - accessing fields.DOPs / Gas Field Wrangle - accessing DOPs and SOPs data.Where necessary I include related functions from myLib.h or attach screenshots. ![]() I am not including here all of the code since sometimes it might not make a lot of sense outside of Houdini. Alternatively you can use this page for quick looking at the topics covered and most of the code that I include here as well. ![]() It is the best to check all the nodes with open Geometry Spreadsheet and Console Output windows to see values of attributes and output text. It contains examples.hipnc and vex/include/myLib.h files which are full of various examples with explanations in comments. You can clone, or directly download this repository. In this case you can use the point() function because PossibleTile attrib is already existent the in previous node that you are trying to access.A collection of code snippets and examples showing syntax and capabilities of VEX language inside SideFX Houdini You should instead use the point() function, instead of vertex(), because PossibleTile is a point attrib. You are trying to read a non existent “PossibleTile” vertex attrib. Anyway, you do the same thing in the “Collapse” node. It's like you are asking for the attribute TEST in the upstream node, which of course it doesn't exist, as you create the “test” attribute only later in the wrangle. ![]() Why so? When you use “0” as first argument of the point(), prim(), detail() functions you are just using a placeholder for the path of the immediate upstream node. BUT be aware: if you change it to detail(0,“Test”,0) it won't work as well because you are trying to access a non-existent detail attribute now, hehe. You should ask for a detail attrib instead. But you are in the Detail Wrangle, the “test” attribute that you create is a detail attribute. I mean, you are trying to read a non-existent vertex attribute “Test”. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |