Jump to content

Hazoc

Members
  • Content count

    152
  • Joined

  • Last visited

  • Days Won

    3

Hazoc last won the day on December 12 2014

Hazoc had the most liked content!

Community Reputation

6 Neutral

About Hazoc

  • Rank
    Initiate

Personal Information

  • Name
    I
  • Location
    Helsinki, Finland
  1. Allright! Got a reply from SESI and here's how you can get it working. I guess this could be an obvious way but couple of confusing things simultaneously made it all appear a bit messy. Python still the same: node = hou.pwd() geo = node.geometry() #A bunch of 4 strings d = ("S", "F", "E", "C") #Set as detail attribute "Strings" geo.addAttrib(hou.attribType.Global, "Strings", d, False) geo.setGlobalAttribValue("Strings", d) Vex now: string A[] = detail(0, 'Strings'); for(int i=0; i<len(A);i++) { printf("A = " + "%c\n", A[i]); } And here's the explanation:
  2. Not yet. First I needed to exclude the "stupid user" error I'll send a ticket.
  3. I need to combine this with XML parsing. If nothing works then I just pack everything into one single long string attribute in Python and convert it into an array in VEX. So dirty. print geo.stringListAttribValue("Strings")[0] returns correct values (S, F, E or C) for given indexes 0-3 so it has to be some sort of an array? I really hope the developers can clear this out.
  4. Hmm I see, that works in VEX. But still I'm unable to read an existing string array. I checked the extended operator info and found something interesting. Your array gets typed as a "stringarray" but the one coming from Python operator is just a string. I'm getting confused.
  5. Nice, thanks! I truly am now able to set string arrays in Python. But reading those attributes in VEX is still a mystery. I attached the .hip file. (requires 15.0.305) Python now: node = hou.pwd() geo = node.geometry() #A bunch of 4 strings d = ("S", "F", "E", "C") #Set as detail attribute "Strings" geo.addAttrib(hou.attribType.Global, "Strings", d, False) geo.setGlobalAttribValue("Strings", d) #Works! print "Array list set through Hou: " + str(geo.stringListAttribValue("Strings")) Vex now: //Maybe the cause of all bad string array[] = array(s@Strings); //Prints nothing for any other than [0] element of the array printf("Value in VEX: " + "%c\n", array[0]); //Prints the size of 1 instead of 4 int length = len(array); printf("Length: " + "%g\n", length); //Prints the type "none" string type = detailattribtypeinfo(0, "Strings"); printf("Type: " + "%c\n", type); detailStringListArray.hip
  6. Thanks! Yeah maybe I smuggle the the strings in and the split them into an array. string foo = "S F E C"; string fooArray[] = split(foo); But this page still makes me believe there is an array type for strings: http://www.sidefx.com/docs/houdini15.0/vex/functions/detailattribtype
  7. Hello Have you ever tried to read array based detail attributes in VEX? I have this simple setup where I create a global array attribute of strings using Python. Later I try to read its' string elements with a Attribute Wrangle using VEX. Vex says that the length of the array is 1 which it should not be after I set 4 elements in the Python SOP. it also tells me that the type is "none". Should be "String Array type" ? The Python SOP: node = hou.pwd() geo = node.geometry() #A bunch of 4 strings d = ("S", "F", "E", "C") #Set as detail attribute "Strings" geo.addAttrib(hou.attribType.Global, "Strings", d, False, True) geo.setGlobalAttribValue("Strings", d) And the Attribute Wrangle: //Maybe the cause of all bad string a[] = array(s@Strings); //Prints the size of 1 instead of 4 int len = len(a); printf("%g", len); //Prints the type "none". Should be "String Array type"? string type = detailattribtypeinfo(0, "Strings"); printf("%c", type); What am I doing wrong?
  8. GRANULAR SOLIDS RnD

    Cool. Feel free to share the .hip files as well.
  9. Rendering only volume selfshadows

    Well good morning there houmie! Yeah I fiddled around with the gradient trick. As I'm anyway planning to post-light the clouds and use a loose z-buffer rendered from their iso-surfaces to raymarch some kind of shadows in realtime, the loss of intra-cloud self-shadowing shouldn't be an issue. But if I happened to need this 3 distant lights per every cloud primitive -setup, I guess making a single cloud to a HDA with the three light rig included and masked only for the contents of their own HDA could work. Then just populate these HDAs all-over to create a cloudy sky. BTW here's an example showing lightmasking done from the SOPs level. http://forums.odforce.net/topic/21946-per-primitive-light-or-per-light-material-in-mantra/ Thanks!
  10. Hello I'm playing with Cloud FX tools. I have a case where I'd like to prevent three xyz aligned distant lights used to render worldspace normals for clouds from casting shadows from a volume primitive onto another. The image shows right most cloud blocking the red distant light from the left cloud thus resulting lost X component of the worldspace normal for the feft one. What options there are to control shadows when doing volume rendering? Is there a better way to extract this type of worldspace normal information for each cloud primitive?
  11. Close up CG face

    A mushroom cloud done with pyro tools.
  12. Here's a link and a shared hip file that might give some insight how to do this stuff in houdini: http://mattebb.com/weblog/rendering-clouds-with-the-mie-phase-function/
  13. Sign() function for vector type in VEX

    True! Thanks. I'll show them here. float sign(float x) { return (x>0)-(x<0); }[/CODE] [CODE]vector sign(vector x) { return set(sign(x.x),sign(x.y),sign(x.z)); }[/CODE]
  14. Sign() function for vector type in VEX

    Maybe it's this way. Just return a vector of signed components. vector sign(vector a) { return set(sign(a.x), sign(a.y), sign(a.z)); }[/CODE]
  15. Hi I've been porting a certain GLSL -shader into VEX and need to replicate few functions from GLSL. One of them is the sign(float A); function that returns -1, 0 or 1 depending on the sign of the argument. The GLSL function also accepts vector type argument and that's what I'm trying to replicate. Does anyone know how the sign of a vector is actually defined? Now I just test each components sign but I doupt I'm doing the right thing. I've been googling all day without really finding any hints or useful source code. My function sign(vector a) : float sign(vector a) { if (a.x == 0.0 && a.y == 0.0 && a.z == 0.0) {return 0;} else if (a.x < 0.0 || a.y < 0.0 || a.z < 0.0) {return -1;} return 1; }[/CODE] Any ideas? Thanks
×