ianwww

Members

9

1

1. Can I display changes to an image inside a solver?

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. Why does a boolean intersection of a grid with metaballs give slices with color striations?

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. Why does a boolean intersection of a grid with metaballs give slices with color striations?

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?
4. Why does a boolean intersection of a grid with metaballs give slices with color striations?

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.
5. Change radius of sphere primitive in vex

Brilliant - that did it! Thanks Konstantin. I would never have worked that out by myself...!
6. Change radius of sphere primitive in vex

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?

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?
8. 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!