# j00ey

Members

238

3

1. ## Interpolating orient attrib in CHOPs

I'm having difficulty with flipping normals when copying geometry onto points. I have a scene with a number of randomly generated structures, just points [each has the same number of points] and I have a CHOP setup to interpolate between them - basically a glorified blendshape - and after the interpolation I'm copying geometry on to them. The problem is that if I use the normal to orient the copies, it sometimes flips, as in the attached scene. I thought if I brought that into CHOPs and added a quaternion attrib with the attribute CHOP it might fix that problem but it doesn't seem to make any difference. Does anyone know a good way to approach this? odforce_flipping_geo.hip
2. ## Interpolating orient attrib in CHOPs

Thanks very much Pavel - that looks like something to learn a few things from!
3. ## Interpolating orient attrib in CHOPs

Ok that's interesting, I'm not familiar with the composite CHOP, I'll have a look and see if I can switch to that and see what happens. Thanks Jon, much appreciated
4. ## Interpolating orient attrib in CHOPs

Hi Jon Thanks very much, I really appreciate your help. I do understand the slerping between two states, what I'm stuck with is slerping between A and B and then between B and C. I've made a file that's more or less the same setup as I have at work - it's not exhibiting quite the same flipping as that one as the work file has many more pieces that move back and forth along one vector with their normals pointing along it in opposite directions but it does have the same issue. I'm still something of a CHOPs novice so that part might be a bit inelegant but it does essentially what I'm trying to do except for the flipping. I make the target states in SOPs then interpolate between them in CHOPs and fetch the P and N values from there. So to do the quaternion VEX method I'd have to do it somehow inside a solver I think. I'm probably missing something simple but I'm not sure what... odforce_flipping_geo_orient_sequenced.hipnc
5. ## Interpolating orient attrib in CHOPs

Hi Jon Thanks for replying. That's exactly what I was trying to do yes but I'm struggling to get it to work. I have a point cloud which has a number of target states - other point clouds - which I'm fetching the position / normal and scale from and then I'm sequencing them in CHOPs so I can control the timing and animation between states and so on. So the problem arises when a point does what's happening in the scene file I uploaded - moves from one position to another and the normal flips 180 degrees. I could instead of getting the normal from CHOPs I could get a slerp bias but I don't understand how to get that working in conjunction with the wrangle method you're talking about. The bias would either go up from 0 to 1 and then from 1 to 2 etc or else I'd reset it so it goes from 0 to 1 and then back again. I can imagine getting that to work in a solver somehow but I thought there must be a CHOPs method. I imagine that probably all sounds a bit garbled. I can't put up an actual scene file but if I get chance I'll make a dummy version and upload it. Thanks for reading anyway
6. ## Regular Expressions in group field

I'm having difficulty with some regular expressions. I have some geometry which contains a load of groups called cluster_0, cluster_1, cluster_2 etc. The number of groups will vary and I need to be able to affect them in batches. Essentially every 5th group needs to have one set of transforms applied, so I need to do some sort of modulus in the group field. I tried cluster_[0-999:5] , cluster_[1-999:5] etc but that only gets cluster_0, cluster_1, cluster_2, cluster_3 and cluster_4 Can anyone give me a pointer? Thanks for reading
7. ## Regular Expressions in group field

Thanks both, I will look into those. At first glance the detail intrinsic approach looks good, though I'm sure I'll learn something from the other link too.
8. ## Best NPR ever

No problem. I think we've all been in that situation some time!
9. ## Best NPR ever

Try this, there are a couple of options for the normal orientation in there. **edit I added backface culling quick outline5_VEX01.hiplc
10. ## Houdini 16 Wishlist

Isn't that what space + z does?
11. ## losing decimal precision in string to float conversion

I have another problem now. Not really my day! I have some geometry on which I've stored some height information as string detail attributes, eg '45.40000152587890625 45.450000762939453125 45.479999542236328125 45.529998779296875 45.5699996948242187' Now I want to split each string into an array of strings, convert each of those to a float and store those in arrays. The problem is that when I do so, I end up with eg '45.40 45.45 45.47 45.52 45.56'. It's storing only 2 decimal places and I can't figure out why. You can see in the screengrab the difference. Attached is a test file Thanks for looking odforce_decimal_precision.hiplc
12. ## losing decimal precision in string to float conversion

I see, but I'm only getting 4 digits in my arrays. You can see in the jpg attachment on the original post. It's actually fine for my purposes, I was just curious as to why it happened. Thanks for the info.
13. ## losing decimal precision in string to float conversion

weirdly though if you do @result = 12.3456789; the @result is 12.3457, so the rounding isn't even happening in the atof function. Note also this is 4 decimal places but... if you do as iamyog says @base = 123456789; @div = pow(10, 9); @RESULT = @base / @div; the result is 0.123457, ie 6 decimal places. Both though have 6 non zero digits. In my results from the original posts I was getting a maximum of 4 non zero digits. Very odd
14. ## losing decimal precision in string to float conversion

Ah, I was just about to fire up an old version. Thanks for looking anyway.
15. ## accessing element of array attribute

I'm trying to access specific elements of an array. I know I can do it like this : float heights[] = detail(geoself(), 'row0', 0); v@P.y = heights[i@col]; but I'm sure sometime before I was able to do it something like this : v@P.y= detail(geoself(), 'row0', 0)[i@col]; Am I imagining it or can someone tell me the correct syntax? Thanks very much
16. ## accessing element of array attribute

I see, that makes sense - and it works too! Thanks very much for the explanation..

Can someone demystify the docs for me regarding adding an array attribute with addAttrib? I found an example using addattribute but that's deprecated now and I can't figure out the syntax. I can't do f[]@arrayName; because I need to loop through a number of points and for each point add an empty detail array. This is what the docs say I should use - "int addattrib(int geohandle, string attribtype, string name, float defvalue[]) defvalue provides the default value for the attribute and determines the type of attribute to create. String and array attributes cannot have defaults, so only the type is used in those cases." If anyone knows could you fill in the ***s in this line? I've tried all sorts and nothing works.. Thanks very much addattrib(geoself(), "detail", "test", ***);

Should always think before posting! I tried doing it in an Attrib VOP and found the correct form. For anyone interested it works like this : addattrib(geoself(), "detail", "test", {}); and for strings this seems to work addattrib(geoself(), "detail", "test", {""});
19. ## Temporary variables in VEX Help

Hi again I had a bit of time to look at this a bit more. I found it a bit difficult unpicking your code but I think you're perhaps overcomplicating things a little. I've made a file to do roughly what I think you're trying to do... It probably looks more complex than it is - I've just broken it down into small steps. Most of it doesn't need to happen inside a solver - in fact the only thing that does really is the noiseB_timer that has to be incremented frame by frame - and I think even that you could work out without a solver I think. I've made some notes in there anyway. There are probably more elegant ways to do it but hopefully it'll give you some pointers. Pls_help_edit.hipnc
20. ## Temporary variables in VEX Help

Only just got round to having a look at this just now. If I look in my console, I'm not getting all the y values as zero - this is the last five lines : prev frame value: {10.5,0.0972875,14.7}, ptnum: 836 prev frame value: {11.55,0.144352,14.7}, ptnum: 837 prev frame value: {12.6,-0.651412,14.7}, ptnum: 838 prev frame value: {13.65,-0.626343,14.7}, ptnum: 839 prev frame value: {14.7,-0.0624275,14.7}, ptnum: 840 That looks like it is getting the values corectly doesn't it?
21. ## Temporary variables in VEX Help

The output of a solver SOP on frame X is what comes into the prev_frame on frame X+1. It's difficult to understand exactly what you're trying to do without an example file. If you post one I'll try and have a look.
22. ## Temporary variables in VEX Help

Can you post an example file? It's easier to see what's going wrong that way. As far as I can see though, using @ptnum like that only really makes sense in a point wrangle - but that's going to give you an array per point with only one item in it, which is presumably not what you want. I've made an example scene that hopefully might help. Use the geometry spreadsheet to see what's going on, printing things to the console isn't usually necessary when you're debugging something like this. I'm no VEX expert so someone else might have better ideas... array_odforce.hiplc
23. ## vex Double values in arrays

I'm not in front of a machine right now but could you use removevalue? Inside the second foreach do something like (pseudo code): Int temp_collect[] = collect Int has_value = removevalue(prim_pt, temp_collect) If (has_value == 0) [append(collect, prim_pt)]* *No curly braces on my phone!
24. ## Temporary variables in VEX Help

No sorry, I meant in a solver, and as haggi said, you still need to make it an attribute with the @syntax as well, I just meant that with an array you can store a whole list of values, rather than just the previous frame (or time step).
25. ## Temporary variables in VEX Help

If you need to store an attribute for every frame you could use an array and append the appropriate value to it on each timestep then you can retrieve those values by retrieving the correct element.
×
• Donations