Arthur Spooner Posted April 7, 2016 Share Posted April 7, 2016 How do you specify an input for the npoints function ? Quote Link to comment Share on other sites More sharing options...
anim Posted April 7, 2016 Share Posted April 7, 2016 (edited) number of points of first input geo int npt = npoints(0); or int npt = npoints(geoself()); number of points of a geometry in the file /temp/geometry.bgeo int npt = npoints("/temp/geometry.bgeo"); number of points of a geometry of the sop operator at path /obj/box1/box1 int npt = npoints("op:/obj/box1/box1"); Edited April 7, 2016 by anim 1 Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted April 7, 2016 Author Share Posted April 7, 2016 Hrm, nPoints will give the number of points based on what is connected, in my case to the pointWrangler node ? Quote Link to comment Share on other sites More sharing options...
anim Posted April 7, 2016 Share Posted April 7, 2016 to recap npoints() gives you number of points of geometry connected to first input of your wrangle node npoints(1) gives you number of points of geometry connected to second input npoints(2) third input etc. npoints("/temp/geometry.bgeo") gives you number of points of geometry from file regardless of whether any inputs are connected to wrangle or not npoints("op:/obj/box1/box1") gives you number of points of geometry of specified operator regardless of whether any inputs are connected to wrangle or not 1 Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted April 8, 2016 Author Share Posted April 8, 2016 In other words. I have a torus in the scene, the torus is connected to the first input of the pointWrangler node, I enter the VEXpression; int nOfp = npoints(0); In GeoSpreadSheet (points) for the pointWrangler node I will be seeing all the points for the torus ? Quote Link to comment Share on other sites More sharing options...
anim Posted April 8, 2016 Share Posted April 8, 2016 In other words. I have a torus in the scene, the torus is connected to the first input of the pointWrangler node, I enter the VEXpression; int nOfp = npoints(0); In GeoSpreadSheet (points) for the pointWrangler node I will be seeing all the points for the torus ? int nOfp = npoints(0); will just store number of points of the torus into a temporary variable nOfp, which you can use within the wrangle, but is not stored anywhere on the output geometry if you havever do: i@nOfp = npoints(0); it will create attribute on the output geometry called nOfp, which will contain number of points of your input geometry (torus) if you do it in Point Wrangle (which is Attribute Wrangle run over Points) then you will see in Geometry Spreadsheet (points) attribute called nOfp and for each point it will have value that equals to number of points of the input geometry (torus) 1 Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted April 8, 2016 Author Share Posted April 8, 2016 How do you use a temporary variable within wrangler ? Quote Link to comment Share on other sites More sharing options...
anim Posted April 8, 2016 Share Posted April 8, 2016 like this int nOfp = npoints(0); if (nOfp > 0) { i@haspoints = 1; } first line stores number of points to temporary variable nOfp then you can use that variable just by typing its name so if (nOfp > 0) will check if that variable is bigger than 0, so if number of points of first input is > 0, if it is, it will set integer attribute haspoints to 1 1 Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted April 8, 2016 Author Share Posted April 8, 2016 I'm looking in the vex function there is no hasPoints, unless it's an integer variable you created ? How can I extrude some faces with VEX, what are the commands use to say, take some polygons and extrude them proceduraly ? Quote Link to comment Share on other sites More sharing options...
holycause Posted April 9, 2016 Share Posted April 9, 2016 it s not a variable but an attribute he creates. whatever name has "@" is an attribute Quote Link to comment Share on other sites More sharing options...
anim Posted April 9, 2016 Share Posted April 9, 2016 ... How can I extrude some faces with VEX, what are the commands use to say, take some polygons and extrude them proceduraly ? that's a bit advanced topic, simple answer would be you'd have make your own polyextrude() function, using addpoint() addprimitive(), ... etc. functions to build all the extruded faces and maybe set their attributes I'd stick with PolyExtrude SOP for now, it's still allows for procedural control, what are you trying to do? Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted April 9, 2016 Author Share Posted April 9, 2016 that's a bit advanced topic, simple answer would be you'd have make your own polyextrude() function, using addpoint() addprimitive(), ... etc. functions to build all the extruded faces and maybe set their attributes I'd stick with PolyExtrude SOP for now, it's still allows for procedural control, what are you trying to do? Instead of manually extruding faces on a sphere, or torus. I want to do them procedurally. All faces have vertices count. How can I, as a starting point, extrude particular faces on a torus, or sphere via SOP nodes ? simple answer would be you'd have make your own polyextrude() function, using addpoint() addprimitive() Hrm, how would I start out; nothing extravagant it s not a variable but an attribute he creates. whatever name has "@" is an attribute int nOfp, creates a temporary variable, is there such thing as a permanent variable or are attributes the equivalent ? Quote Link to comment Share on other sites More sharing options...
anim Posted April 9, 2016 Share Posted April 9, 2016 Instead of manually extruding faces on a sphere, or torus. I want to do them procedurally. All faces have vertices count. How can I, as a starting point, extrude particular faces on a torus, or sphere via SOP nodes ?look at example file ... int nOfp, creates a temporary variable, is there such thing as a permanent variable or are attributes the equivalent ? well, "temporary" variable was just an expression in contrast to attributes which actually store the data in the geometry but in other words, int nOfp... defines proper VEX variable, which is valid within the scope that is defined, whether it is within a function, loop or operator definition, but it certainly isn't valid outside of the wrangle or CVEX operator, hence "temporary" so yes, if you want your data to live longer, store it in the geometry as attribute procedural_polyextrude_example.hip 1 Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted April 9, 2016 Author Share Posted April 9, 2016 (edited) but in other words, int nOfp... defines proper VEX variable, which is valid within the scope that is defined, whether it is within a function, loop or operator definition, but it certainly isn't valid outside of the wrangle or CVEX operator, hence "temporary" What is outside of the wrangler of CVEX operator ? The example scene file; I understand you created an integer attribute called group_extrudegrp but I couldn't find @numvtx, is this another attribute ? Then you created another attribute f@dist and assigned the command fit01, shouldn't it just be called "fit" ? Those attributes (numvtx, numpt) are within the VOP node, must I always add a VOP node just for certain attributes ? Edited April 10, 2016 by Arthur Spooner Quote Link to comment Share on other sites More sharing options...
anim Posted April 10, 2016 Share Posted April 10, 2016 (edited) What is outside of the wrangler of CVEX operator ?...for now you can think of it as outside of the Wrangle node that you are typing the code into so if you define the variable in the code of a Wrangle node, you can access it only within the same code and not in the code of other Wrangle nodes The example scene file; I understand you created an integer attribute called group_extrudegrp but I couldn't find @numvtx, is this another attribute ? Then you created another attribute f@dist and assigned the command fit01, shouldn't it just be called "fit" ? Those attributes (numvtx, numpt) are within the VOP node, must I always add a VOP node just for certain attributes ? @numvtx, @numpt, @numprim, @vtxnum, @ptnum, @primnum and many others are automatically bound to the first input geometry information, without the need for them to be attributes so in wrangle you use for example @ptnum, in the same situations as in Point VOP you use ptnum output from Global Parameters, none of them require an attribute i@group_extrudegrp defines membership to a group called extrudegrp not an attribute you can read about all that here: http://www.sidefx.com/docs/houdini15.0/vex/snippets fit01() is a simplified function to fit() it assumes the input range to be 0-1 to learn more about what functions are available and what they do: http://www.sidefx.com/docs/houdini15.0/vex/functions/ Edited April 10, 2016 by anim Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted April 10, 2016 Author Share Posted April 10, 2016 (edited) I'm slowly beginning to understand Edited April 10, 2016 by Arthur Spooner Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted April 10, 2016 Author Share Posted April 10, 2016 How do you access the Houdini shell, Windows > Shell brings up the windows command prompt. I probably forgot the method Quote Link to comment Share on other sites More sharing options...
anim Posted April 10, 2016 Share Posted April 10, 2016 (edited) not sure what you mean, it's either Windows/Shell or from outside of houdini you can run it either from start menu, in Side Effects Software/Houdini X.Y.Z/Utilities/Command Line Tools or from disk in your Houdini folder/bin/hcmd.exe Edited April 10, 2016 by anim Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted April 10, 2016 Author Share Posted April 10, 2016 not sure what you mean, it's either Windows/Shell or from outside of houdini you can run it either from start menu, in Side Effects Software/Houdini X.Y.Z/Utilities/Command Line Tools or from disk in your Houdini folder/bin/hcmd.exe I thought it was textport. It's hcmd. Where can I find a list of commands to use in hcmd ? Quote Link to comment Share on other sites More sharing options...
anim Posted April 10, 2016 Share Posted April 10, 2016 what are you trying to do? shell launched by hcmd or Windows/Shell is command line shell initialized with houdini environment variables so you can access all houdini stand-alone utilities http://www.sidefx.com/docs/houdini15.0/ref/utils if you however wanted texport and therefore hscript commands, then refer to this: http://www.sidefx.com/docs/houdini15.0/commands Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.