# Sean-R

Members

84

1

1. ## Simulation inside a loop

You don't need to use a foreach. Look into wedging: http://www.sidefx.com/docs/houdini/nodes/out/wedge.html
2. ## list of vertices

To put the vertices in an array attribute: i[]@prim_vertices = primvertices(0, @primnum); You have to declare @prim _vertices as an array. You don't need the first line of your code, that would declare a variable. Unless that's what you want of course
3. ## Read files through a loop

The file merge SOP should do the job: http://www.sidefx.com/docs/houdini/nodes/sop/filemerge.html
4. ## Attributes inside condition

That should work, @NewVec should be visible in the geometry spreadsheet. To get it to write as a vector attribute you will need to put a v before the @.
5. ## PackedObject scaling with time in DOP

The Entagma guys have a nice solution for this:
6. ## Set Point Pivot Rotate Primitive along Point Pivot

The code in a wrangle is applied to each prim/point/whatever at the same time. In your code your say that only primitives with a primitive number of 0 and 4 can be white which isn't possible as it can only have one @primnum assigned, try replacing "&&" with "||". You will also need to initialise the @Cd attribute before the if statement, this should work: @Cd = 0; if(@primnum == 0 || @primnum == 4){ @Cd = 1; } If that's all that you are doing in the ForLoop, then I don't think you need it
7. ## Set Point Pivot Rotate Primitive along Point Pivot

Hey! So I think I get what you mean. I used the @vrtList that you created to get the first and second vertices of each prim, blended the positions to get the midpoint and then created a point at that halfway position. I've attached an updated version of your scene with the following code: i[]@vrtList = primvertices(0,@primnum); int vp1 = vertexpoint(0, @vrtList[0]); int vp2 = vertexpoint(0, @vrtList[1]); vector midpoint = lerp(point(0, "P", vp1), point(0, "P", vp2), 0.5); addpoint(0, midpoint); If you're using this as a pivot for the primitive you don't need to create a point, just bind the lerp expression to an attribute to reference in the primitive SOP. To see the vertex numbers in the viewport, hit D to bring up the Display settings and select Numbers from the Vertex checkbox list. I'm not sure why you need the Foreach network, especially set to Count. What are you trying to achieve? halbetweenpoint_b_v2.hipnc
8. ## Set Point Pivot Rotate Primitive along Point Pivot

You shouldn't need to create a point, this code will create a pivot attribute in the place that you want it: //Get all points in a primitive and put into an array int foo[] = primpoints(0, @primnum); //Get the average position of the first and second point in the foo array v@pvt = lerp(point(0, "P", foo[0]), point(0, "P", foo[1]), 0.5); In a Primitive Sop you can call the @pvt attribute using the prim expression. The expression in the pivot would look like this: prim(0, @primnum, "pvt", 0) You will need to change the last value to match with each parameter. So x = 0, y = 1 and z = 2. This probably wont rotate the primitives how you want though, check out this section of Matt Estela's website: http://www.tokeru.com/cgwiki/index.php?title=HoudiniVex#Rotate_prims_around_an_edge I can't check your file at the moment as I'm at work but I can look at it tonight
9. ## repeat length animation

You could use the particles age and life attributes and write them into a scale attribute in a wrangle like so: // Normalize the age by dividing it with the life attribute, this will give a value between zero and one float nage = @age/@life; //Because nage is a float variable it will be copied three times in the vector scale attribute v@scale = nage; Then plug this into a copy sop with your line geo at the maximum length you want.
10. ## Remove Primitive by Sphere

Yes! I've fixed the code
11. ## Remove Primitive by Sphere

This should work: // Get distance of primitive to point position of second input, Sphere is plugged in to second input // float dist = distance(@P, point(1, "P", 0)); // Get radius of sphere, I made a relative reference to the spheres scale in the radius parameter that is created // float rad = chf("radius"); // If the primitive is inside the sphere, delete// if(dist<=rad){ removeprim(0, @primnum, 1); }
12. ## Slow down particles ?

Do you mean the playback is too fast? There's a clock icon on the timeline bar which needs to be enabled to play back in realtime. Otherwise, if you need to slow the sim down you can use a timewarp node,
13. ## Natural Randomness Ratio and Scale Ramp

FIrst of create a random number between 0-1, you can use the @ptnum or @id (if you have one) attribute, you can then reference this random number in a ramp expression. The code would look like this: float rand = rand(@ptnum); v@scale = chramp("Scale", rand); You can then hit the spare parameter toggle next to the vex expression and adjust the ramp curve to how you want it. Bear in mind this will distribute the scale of the debris to between 0-1 so if you want them to be a different scale to this you would need to fit the scale value after the ramp expression.
14. ## LiDAR effect Using Light with Scatter points ( Are tips allowed here? )

Check out this video by Matt Ebb. He has something similar to what you're after halfway through (but it's definitely worth watching the whole thing)
15. ## Is it possible to use sim data to drive camera position?

Is it a Packed Primitive? You could use a point expression on the camera transforms at object level
16. ## centered Point per Primitive

This code should work in a Primitive Wrangle: // Adds a point at the position of each prim addpoint(0, @P); // Remove primitive and all points connected to it removeprim(0, @primnum, 1);
17. ## Controlling Scatter Density by Attractor Point

You can control the density of scattered points by an attribute, the scatter SOP defaults to a "density" attribute but you can use whatever you like. For the distribution that you have in your top image you could make a black to white gradient on a grid then replace "density" with "Cd" in the Density Attribute parameter.
18. ## Access numpt at input 2 of wrangle

Hmm, not sure. Maybe because it's a different type of attribute and opinput can only access what's visible in the Geometry Spreadsheet?
19. ## Access numpt at input 2 of wrangle

You can use the npoints vex expression, so: npoints(1)
20. ## basic questions- question 1

There are a bunch of visualizer buttons on the right hand side of the viewport. One of them displays the primitive number.
21. ## basic questions- question 1

Hey! There are (at least) two ways: 1. You can type in the primitive numbers into the Group parameter at the top of the transform node. 2. Once you've made your selection you can hit "E", "R" or "T" to create and Edit node. The hotkeys are for Scale, Rotation and Translate respectively. Hope this helps
22. ## transfer Cd to vdb from particles

I can't look at your file, but you can plug the original geometry (with colour) into the second input of the convertvdb node then check "Transfer Surface Attributes". Hope this helps!
23. ## Ray node scale input

It should work if you write @Cd into the Scale parameter.
24. ## Spotlight instancing on deforming geo

Yup, The instance SOP at the /obj level should do the trick!
25. ## Basic PBR question (my first question)

Have you checked out the houdini help? http://www.sidefx.com/docs/houdini/shade/textures.html The principled shader has parameters to attach texture maps.
×
• Donations