Jump to content

ianwww

Members
  • Content count

    10
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won

    1

ianwww last won the day on April 27

ianwww had the most liked content!

Community Reputation

2 Neutral

About ianwww

  • Rank
    Peon

Personal Information

  • Name
    ianwww
  • Location
    Tasmania
  1. I have a solver (inside a genetic algorithm) that makes changes to a grid image at each step based on an analysis of the previous step's image. At the end of the solver a final image is outputted. I'd like to be able to see the changing images at each solver step. At the moment I can only see the final image because the solver completes all its steps inside a single frame, ie. it steps at a fractional frame rate, whereas the viewport update occurs frame by frame. I've been wondering if I could use something like time shift, time warp or retime but I can't work out how. I've also wondered if I could somehow force a viewport update at a fractional frame rate from inside the solver. Any ideas about how I could display image changes inside a solver or is it not possible?
  2. I've found a solution. My two part fix required 1) increasing the number of rows and columns in the intersecting grid, and 2) transferring the color attribute from the polygon to the intersecting grid. Initially, my intersecting grid was only 2 rows by 2 columns (ie. 4 corner points). In the polysphere example, this gave me the problem pattern (attachment 1). By making the grid, say, 5 rows by 5 columns and then also doing an attribute transfer of the sphere's Cd to the intersecting grid I get the even color that I wanted (attachment 2). (Just doing the attribute transfer onto the 2 x 2 grid wasn't enough. The grid needed to be at least 3 x 3 for the fix to have effect.) Thanks for your interest and advice!
  3. Thanks for the suggestion but I don't think that's the cause. I had already specified my grid as a surface (and the polygon as a solid). I've attached a simpler version of the same issue - this time intersecting a single polysphere with a grid. It seems that the striations come from the varying point density around the slice (first image). If I make the point distribution uniform (with an edge equalize SOP), the striations become more uniform (second image) but they're still there. So, the color of the slice is set by the color of the points (Cd point attribute) around its edge and I think Houdini interpolates color between points as a gradient. I may be missing something really obvious but I can't work out how to overcome this.
  4. I've scattered randomly sized and colored metaballs onto a grid (some of which merge), converted them to polygons and then boolean intersected them with the grid, to get colored slices as attached. The slices have color striations (attached). Does anyone know what's causing the striations and how to avoid or get rid of them so that I have flat colors?
  5. Change radius of sphere primitive in vex

    Brilliant - that did it! Thanks Konstantin. I would never have worked that out by myself...!
  6. I've created a sphere primitive in vex, using: centre_pt = addpoint(0, pos); sphere_prim = addprim(0, 'sphere', centre_pt); I want to be able to vary its size in the viewport but can't work out how to do it. When a sphere prim is added using a SOP, the sphere's size can be changed using scale (the Uniform scale slider). I thought that this vex would therefore do the same thing: setprimattrib(0, 'scale', sphere_prim, chf('sphere_size'), 'set'); but changing chf('sphere_size') has no effect on the sphere's size. (I've also tried replacing 'scale' with 'radius', and also with 'radx', 'rady' and 'radz'.) I've found this link cgwiki which explains how to do it for a prim that has multiple points but a sphere prim only has its single central point. How can I change a sphere prim's size in vex?
  7. Can @group_NAMEOFGROUP be a variable?

    Thanks for the suggestion but - and I may be misunderstanding something - in your example wouldn't if(@group_grp) and if(result) be asking the same thing? Both were manually set to 1 at the same time when condition was met, so result is just a mirror variable isn't it? Also, I'd still need to hard code the name of @group_grp in advance of knowing what the name should be. Sorry if I've misunderstood!
  8. In a point wrangle I create a new group, say mynewgroup, and set membership of it based on some criterion. Later in the wrangle I want to test for membership of that new group. I can't use inpointgroup because that looks backward to the previous node, where the newly created group doesn't exist. So, instead I use if(@group_mynewgroup) { WHATEVER } to test for a point's membership of the new group mynewgroup. To use @group_ syntax I need to hard code the mynewgroup into it. What if the name of the new group depends on the outcome of some code inside the wrangle so that I need to create the new group name on the fly? I'd like to be able to use something like string newgroup = concat('group_', 'mynewgroup'); if(@newgroup) { WHATEVER } I know this particular code doesn't do it but is there something along these lines that I could use?
  9. inpointgroup and npointsgroup aren't working for me (Indie 18.0.416). I have a grid with an attribute from map image. I manually select different areas of the grid and add those selections to various named groups. I then add a scatter node to generate scatter points over the grid. The scatter points appear to inherit the group memberships from the underlying areas of the grid - prior to the scatter node, the info popup shows the various group names as prim groups and in/after the scatter node the group names appear as point groups. I then run some code in a detail attribute wrangle to loop through a particular group's scatter points (those of a cypress tree in the image, group 'Cypress') to identify points lying along the boundary of that group (ie. the boundary of the cypress tree). I then add those boundary points to a group named 'Cypress_edge', using setpointgroup(0, 'Cypress_edge', pointNum, 1, 'set'); I can see in the geometry spreadsheet that this has worked - there are now points having membership in both the original group 'Cypress' (88,850 points) and the 'Cypress_edge' group (8,120 points). However, when I then check-test the boundary points for membership of the 'Cypress_edge' group using inpointgroup(0, edgegroupname, pointNum) they don't show membership (inpointgroup returns zero for every point). Also, if I ask how many points are in the 'Cypress_edge' group, using npointsgroup(0, edgegroupname) the answer is zero, even though there are 8,120 points in the geometry spreadsheet's 'Cypress_edge' column that have a value of 1. inpointgroup and npointsgroup work for the point groups that existed prior to the VEX wrangle but not for the 'Cypress_edge' group that was created inside the wrangle. I'd appreciate any advice about what I might be doing wrong! [SOLVED] I've finally realized that inpointgroup and npointsgroup are looking backwards at the preceding node (ie. through input 0), and there are no edge points yet in that previous node. So, while setpointgroup(0, 'Cypress_edge', pointNum, 1, 'set'); creates the group 'Cypress_edge' (on its first call) and sets its member points' include values to 1, I also need to set @group_Cypress_edge = true; to tell the local wrangle that the point is a member, and I also need to use if(@group_Cypress_edge) to test for membership locally. I'm not sure how to get the number of points in Cypress_edge using this method though, other than looping through all the points and doing a count. I also have some further questions about this method but I'll leave those for a separate post.
×