Jump to content

Search the Community

Showing results for tags 'vex'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Lounge/General chat
    • Education
    • Jobs
    • Marketplace
  • Houdini
    • General Houdini Questions
    • Effects
    • Modeling
    • Animation & Rigging
    • Lighting & Rendering
    • Compositing
    • Games
    • Tools (HDA's etc.)
  • Coders Corner
    • HDK : Houdini Development Kit
    • Scripting
    • Shaders
  • Art and Challenges
    • Finished Work
    • Work in Progress
    • VFX Challenge
    • Effects Challenge Archive
  • Systems and Other Applications
    • Other 3d Packages
    • Operating Systems
    • Hardware
    • Pipeline
  • od|force
    • Feedback, Suggestions, Bugs

Found 604 results

  1. Hi, I know point clouds can be used to blend/average attributes within the radius of each point. Is there a way to do the same where it only does this if: 1. A point is connected to the same surface as the current point. and 2. A point is within X units distance on the surface from the current point. Not point to point straight line distance, but the shortest surface distance between 2 points on the surface. I am not sure if there is a proper name for this. Not the best pic but something that looks like this: As you can see the length of the shortest path that lie on the surface. The surface can be polygons or NURBS. This can't be faked with neighbour functions as edges are too coarse. Can this be done using point clouds? If not, VEX? If not, then any other solutions in Houdini? It's gonna be a per point operation though just like VEX/VOPs. Thanks
  2. multi-context VEX shader

    hi, how to write single multi-context VEX shader (displacement and surface) without VOPs (created by File menu > New Operator Type)?
  3. I'm a bit confused as to which VEX functions these two nodes have access to? Is this noted in the documentation anywhere? For example I can create geometry in an attribWrangle node using addPoint(), addPrim() and addVertex(), however these functions don't seem to work in the pointWrangle. And I can create groups using the addgroup() function in a pointWrangle node but this is not recognised in the attribWrangle node....
  4. Is it possible remove the attribute use wrangle sop. I can't find any attrib delete or remove function in VEX. Thanks!
  5. Hi there. I need some help with Vex. I've set up a Python Sop with the code below but this is very slow. So my next challenge is to re-create it in vex (or fix the Python code if it can run much faster). Vex is unknown territory, and my vex code fail already with the attempt to create an array with unique cluster values ('clusters' in the Python code). When I foreach() on the array to look up the existing values within the while loop, VEX execution seems to go into an infinite loop if I have a printf() statement anywhere in the code. I've put the vex code in a Attribute Wrangle Sop with Run Over set to Detail (to be able to count over points). My working Python code: node = hou.pwd() geo = node.geometry() # Add code to modify contents of geo. # Use drop down menu to select examples. geo.addAttrib(hou.attribType.Point, "activate_by_cluster", 0) #geo.addAttrib(hou.attribType.Point, "Cd", (0.0, 0.0, 0.0)) # Set threshold for number of points in a cluster before becoming active min_points = 40 clusters = [] for p in geo.iterPoints(): cluster = p.attribValue("cluster"); if cluster not in clusters: clusters.append(cluster) for cl in clusters: active_cluster = False threshold = 0 for p in geo.iterPoints(): if p.attribValue("cluster") == cl and p.attribValue("activate_box") == 1: threshold += 1 if threshold >= min_points: active_cluster = True break if active_cluster == True: for p in geo.iterPoints(): if p.attribValue("cluster") == cl: p.setAttribValue("activate_by_cluster", 1) This is the vex code I got so far: //Global settings int min_points = 400; //Global variables int clusters[] = {0}; //Get the existing clusters from the points int pt_num = 0; while(pt_num < @numpt){ int _cluster = point(geoself(), "cluster", pt_num); foreach(int i; clusters){ if(_cluster != i){ push(clusters, _cluster); } } pt_num++; } //printf("%d", clusters); foreach(int i; clusters){ int active_cluster = 0; int threshold = 0; while(threshold < @numpt){ int _cluster = point(geoself(), "cluster", pt_num); int _activate_box = point(geoself(), "activate_box", pt_num); if(_cluster == i){ if(_activate_box == 1){ threshold++; } } } if(threshold >= min_points){ active_cluster = 1; break; } if (active_cluster == 1){ pt_num = 0; while(pt_num < @numpt){ int _cluster = point(geoself(), "cluster", pt_num); if(_cluster == i){ //setpointattrib(geoself(),"activate_by_chunk", pt_num, 1, "set"); } } } } I've just tried to do the same in vex as I did in Python. Needless to say, it does not work as it is although I get no error messages. In case the intention is unclear: I am looping over the current points looking for the cluster attribute (coming from Cluster Points sop). I then go through the points in each cluster looking for the "activate_box" attribute. If this is 1 and a minimum of points with these conditions is found, set all points in the cluster to have the "activate_by_chunk" attribute to 1. This is used downstream. Please let me know if you have any ideas! Ole
  6. A string of characters

    Hi, Guys. I was stuck by a simple VEX question. How can i get a string attribute, such as "s + @ptnum". s@name = "s + @ptnum" ; not working at all. I was lack of VEX expression experience. : D Thanks!
  7. I stuck with a simple VEX question. I have to get the npoins of a geometry use attribute wrangle. int npoints(int input_number) really do well. but i was confused with the second expression. int npoints(string filename) Returns the number of points for all primitives in the geometry file. How to use it. Thanks.
  8. Everyone. I get a simply problem. We can implement and operation with && , || mean or in expression. What sign can i take in vex. Such as: if (@P.x > 1 && @P.y >1 ) Forgive my dumb question. Thanks It just works well with && It is my mistake.
  9. I'm hoping this is a very basic question and i'm missing something.. I'm playing around with writing some vex code to achieve self collision in a basic particle system and I was wondering what the best way is to iterate over all (other) points, i.e. if a connection (or check) has been made between point 0 and 1 it should then be re-made for point 1 and 0. Obviously this would simple in python or mel for example but vex is harder since its multithreaded? I've only just started looking at vex so i'm only half sure this is correct so far? I have a work around but is not efficient (I may be iterating over thousands of points) so maybe a python sop would actually be better?? Thanks, Mike
  10. Link: CGWorkshop-- VEX in Houdini The course starts August 4th and runs for 8 weeks. I'm going to start out covering the basics of VEX, then we'll move on to some really fun projects. It's going be a good mix of visual effects related coding and really fun generative art. Check out the outline on the course website and if you have questions, ask away. I love teaching with Houdini as my blackboard, so I hope that comes across in the lessons. I want this course to kick ass; the world is full of boring programming classes and we don't need another! Happy Houdini'n -Shawn PS: XSI gals and guys, wanna learn VEX? I think I know a way... PS:PS: "Houdini'n" - is that a word yet. Can I say that?
  11. Is it possible to programmatically modify a color ramp via python (add / remove / edit keys,values, basis etc)? All I've found is this http://www.sidefx.com/docs/houdini13.0/hom/hou/Ramp which only explains how to read these values, not write to them. The reason I'd like to do this is: I have VEX code which colors my particles based on a number of color ramps. That all works fine. However editing the color ramps can be cumbersome, and I already have color palettes created in photoshop which I'd like to use. I thought my options are: 1. Hand edit the color ramps to reflect the color palettes. Very boring and tedious. 2. Hand enter the RGB values into VEX. Even more boring and retarded. 3. Write a tool which loads the palettes in whatever format, and modifies a color ramp to reflect the palette. The VEX code just references this color ramp. This code would only execute once obviously, I load my palette and bang, the color ramp is up to date. I loved this idea, because I could scatter a bunch of these nodes around, each one a different palette, and the VEX code just references a different node for a different palette. However I can't find how to modify the color ramp so I'm stuck. My plan B is to output the RGB values to number box arrays, and have VEX reference that, which might be faster anyway, but I lose the in between values and the ability to visually tweak the palette in context. Any ideas?
  12. I'm trying to learn houdini, and one thing which I'm getting really stuck at is the syntax and (apparent) inconsistency of expressions / snippets of code - or at least there's so many little idiosyncrasies that it's driving me nuts. I've looked around as much as I can in various documentations, but couldn't find a single piece of text which describes an overview of all of these things, instead the info is scattered all over the place, probably because some of these are legacy and dates back decades while others are quite new. As far as I understand: $ is for global variables (in HSCRIPT ? and python too? are there substitutes for VEX?) @ is for attributes in VEX (is it possible to access attributes in HSCRIPT?) ch is for referencing a channel (i.e. a parameter of something from the GUI?) (is this HSCRIPT? or PYTHON?) I'm still not sure what op or ` (backtick) are for or when to use them. What I'm after is a very short (hopefully not more than a few sentences per item) summary of what each of these things are, and in what context we are supposed to use them. Also, what is the context of what we enter into textfields? E.g. when I write sin($T) into the position of an object. Is this HSCRIPT? or Python? Or is that a Houdini Expression which is a whole other context separate to HSCRIPT? cheers,
  13. Hello everyone. I'm truing to replicate composting operation Over which I believe A+B(1-a). Instead I and up multiplying each layer by opposite alpha. It is work fine with constant colors, but it doesn't work with a texture. It turn texture (A) in opposite color. What wrong with that and what I missed? composite_test_01.hip
  14. VEX supports array function?

    Hi, this is my first post here. I've been trying to call a vector array function in VEX, but it either returned "Internal Compiler Error" or "Syntax error, unexpected identifier, expecting ';'". I also checked Array help file and the example as below didn't work at all: To specify a literal array, use curly braces, with the array members separated by commas: vector[] rgb_array() { return { {1, , }, {, 1, }, {, , 1} }; } Here is the simple code I tried to compile, but it returned an error message "Syntax error, unexpected identifier, expecting ';'." vector an_array[] = {{1,1,1}, {2,2,2}}; vector a[]; vector[] testFunction(vector[] a){ return a; } a=testFunction[an_array]; Does anyone know if VEX supports array function? Thank you very much!
  15. Hey Guys! I've been experimenting with the refract node in vopsop context as well as the refract() function in vex. I'm curious if anyone has been able to break that node down to it's raw form? I would essentially like to know how it actually evaluates it's inputs. Can anyone shed some light on that? I would like to know the math behind it. The refract function takes three inputs, a direction vector, a normalized normal and an index of refraction. thanks!
  16. Hi! I have a little problem of getting the world space translation of the Sun light object in the vex light shader. What I'm doing looks like this: transform("space:light", "space:world", {0,0,0}) This statement should return me the vector I'm looking for. And it returned the correct value at these wonderful happy days of Houdini 12.5. Now in Houdini 13 it also works well but not for Sun light objects. With a Sun light it returns the world translation of the camera. When checking the transformation matrix in H13 with: getspace(getlightname(), "space:world") we can see that the matrix is correct except the translation part. One can say that the Sun light is a kind of a Distant light that represents just a direction not the position. And virtually it's true. The light itself represents the direction. But the object still exists in the IFD with it's fully correct transformation matrix. By the way I can get this transformation for the actual Distant light. It doesn't work only for Sun light only in Houdini 13. Do you guys have any suggestions about how to solve this problem? Do you think it is possible to get this world position of the Sun light in the light shader? The scene in the attachment shows the problem. Take a look to the terminal output. lightspace.hip
  17. Writing VEX normal map - What's wrong?

    Hey, I'm getting a syntax error. "...:16:24: Error 1088: Syntax error, unexpected identifier, expecting ´}´." The error is on the line where I create the matrix and it gives me this error when I try to grab a component of a vector and put it in the matrix. What I want is in the comment. If I replace "Vt.x" with 1 it compiles perfectly. Here's the code: #pragma hint map image #pragma label map "Normal Map" #pragma label amp "Amplitude" surface normalMapTest(float amp = 0.1; string map = "";){ vector Nn = normalize(N); vector tex, newN; // normal map if (map != ""){ tex = texture(map)*2 - {1,1,1}; vector Vs = normalize((dPds * Dv(t)) - (dPdt * Du(t))); vector Vt = normalize(cross(Nn, Vs)); Vs = normalize(cross(Vt, Nn)); matrix m = { {Vt.x,0,0}, {0,1,0}, {0,0,1} }; //{{Vt.x, Vt.y, Vt.z}, {Vs.x, Vs.y, Vs.z}, {Nn.x, Nn.y, Nn.z}}; newN = normalize(tex * m); } else { newN = Nn; } F = diffuse(newN); } Oh and if you see any other errors, please tell me. I wanted to do this as an exercise in VEX Shader Writing. Cheers, Jonathan
  18. Hello. I need you advice about AttribWrangle I have the simple code: setpointattrib(geoself(),"P",0,{10,10,10},"set"); So now I would like to get the attribute value from the current modified geometry. How to do that? Note again: We are in "Run over: detail" I couldn't find any methods to get current attribute value trough geoself() identifier. Please, help
  19. I had what is hopefully a quick question about dsos being used by vfl files. I have a compiled dso, and in my vfl I am calling one of the functions that my dso declares. When using vcc to compile my vfl, it states that my function is undefined. From within a houdini shell I can run: $HFS/bin/vcc -X cvex And I can see my the functions declared in my dso. Exactly what do I need to do to get my external vfl files compiled, using my dso? Thanks.
  20. Hi there! Guys, need some help, can't find anything valuable on this in HDK docs..... 1) How can i get access to render properties from my hdk vex function? Similar to what renderstate vex function does. 2) How to get access to geometry from hdk vex function? It should be a way to get const GU_Detail, similar to VRAY_Procedural::queryGeometry(). Thx!
  21. Modification of struct crashes mantra

    Hi! I'm trying to organize some of my vex shaders. And trying to use struct for that. But this kind of code crashes my mantra: struct RayInfo { float clr; } surface structVar(){ RayInfo ray = { 0.0 }; if( ptransform("space:world", P )[2] < 0.0 ) ray.clr = 1.0; Cf = ray.clr; }[/CODE] So, it seems to crash only if try my modify struct non-uniformly. Is it even legal to do like this, or structs are supposed to be constant? Just in case, the compiled .otl version is in the attachment. struct.otl
  22. VEX syntax definition for SublimeText

    Needs some polish, especially in regards to multi-line macros. Additionally, it'd be nice if vex had a header extension that didn't clash with c/c++. I'm manually specifying .h files as vex headers as needed, though the definition picks up vfl's automatically. https://gist.github...._tmlanguage-xml What it looks like with the Monokai Theme: Have Houdini related SublimeText enhancements to share? Snippets or build systems? Lets collaborate! -shawn
  23. Hey All: Ever since the advent of VOP SOPs, I haven't used the Point SOP as often. As a matter of fact, I encourage my team to replace the Point SOP wherever possible in their setups as an optimization step. Now, with the Wrangle SOP, it's even easier to whip up some simple VEX code to do almost anything the Point SOP does. Do other users find that the Point SOP is slowly becoming the sweet ol' grandpa of point data manipulation? Is there anything the Point SOP can do that can't be done in VOPs/VEX?
  24. I am trying to create AI behaviour in the sop solver. I am able to update behaviours by using the prev frame data without any trouble. The problem is for one particular behaviour I need to save the position of certain points across a frame range, and use this data to drive the other points in the simulation. The solutions I could think of were: I tried using a pop network outside of the sop solver to birth new particles and access these points back in the sop solver. But the solver errors out if i connect the data from the pop network into the solver tree. I guess this is because i am making new points outside of the solver. I also tried to create new points using python and the `add` sop. this is terribly slow and almost brings the whole thing to a stop. The most obvious solution seemed to be to create a list attribute in python and save the data into it. But if i do this in the sop solver then the data gets overwritten per frame. Is there some way to create an attribute that could store an array or list of position data across frames. From the documentation i understand that only floats, int and vectors can be used as attributes. I could just append the new position data to this list per frame and access it later in the tree. Thanks ---------------------------------------------------------------------------- www.vimeo.com/tusk3d
  25. Greetings How to edit code of environment light? I guess gi_light shader is core of env light [from shelf menu], am I right? Still, environment light has more options than gi_light and seems to behave more accurate. I wanted to see if there's easy way to get angular or cubic projection of environment map. Right now in environment light [and gi_light] there's only sphere projection which is by default. I know there's isixpack utility, but I am not looking for such methods . I was looking for answer for about month, so: geometry light: too noisy, too slow constant shader: too noisy, 0 control about source samples Any tips&tricks?
×