Biohazard9012 Posted June 16, 2015 Share Posted June 16, 2015 Hey guys, I'm trying to find a way to create a tool to allow the user to dynamically create or delete parallel lines through the parameter interface, while allowing them to control the points through a Ramp Control, which I have successfully done. The problem I'm running into is in using a Copy node to create multiple lines, and then being able to still manipulate each line's points individually through it. I tried using a ForEach node, but when I try to copy-stamp from an above level Copy node, it always returns the default value of the stamp function, which has lead me to believe you can't do that. So I'm back to trying to figure out how to use a Copy node and manipulating each group that outputs from it.It's easier to explain by posting the .hip file than taking photos. And it is a very large scene, just fyi. Using the "Add Curves" parameters creates/deletes copies.Thanks H14 User-Controllable Copied Lines.hipnc Quote Link to comment Share on other sites More sharing options...
ChristopherC Posted June 17, 2015 Share Posted June 17, 2015 I don't think that the `Copy` node is the right approach in this case. You could instead iterate over the multi parameter and then define the corresponding curve within each iteration. I've modified your scene to do just that. Note that the way it's set up works well if you use linear interpolation within your ramps, but if you'd like to use another type of interpolation, then you would have to sample your ramps. User-Controllable Copied Lines-Edit1.hipnc Quote Link to comment Share on other sites More sharing options...
Biohazard9012 Posted June 17, 2015 Author Share Posted June 17, 2015 I don't think that the `Copy` node is the right approach in this case. You could instead iterate over the multi parameter and then define the corresponding curve within each iteration. I've modified your scene to do just that. Note that the way it's set up works well if you use linear interpolation within your ramps, but if you'd like to use another type of interpolation, then you would have to sample your ramps. Hey Christopher, I appreciate the help and was just able to take a look at the file. Do you think you could help explain what you did so I can understand the VEX you used better? Quote Link to comment Share on other sites More sharing options...
ChristopherC Posted June 17, 2015 Share Posted June 17, 2015 Sure, here's a breakdown: - I kept the multiparm that you've made, which is nice to define a variable number of curves with their corresponding parameters. - the `ForEach` node iterates over the number of curves defined in the multiparm. - within each iteration of the `ForEach` node, a new curve is defined. The VEX code might look scary but is actually very simple—most of the lines of code are there to retrieve the values from the multiparm, the job is done only in the 2 last lines. The variables `pos` and `value` are defined in the range [0, 1], as per the ramp, so we need to scale them according to the length and min/max values. `(pos - 0.5) * length` is a factorization of `length * pos - length * 0.5`, that is to make your curve match the `length` parameter while being centered, and `fit(value, 0, 1, min, max)` should be obvious enough for you since you tried to do something similar. Keep in mind that the `Point Wrangle` node runs the code once per input point, that is the number of points defined in `line1`, and thus matching the number of points from the profile curve ramp, which makes it possible to make an association between the point number (@ptnum) and the ramp point index. Quote Link to comment Share on other sites More sharing options...
Biohazard9012 Posted June 18, 2015 Author Share Posted June 18, 2015 Sure, here's a breakdown: - I kept the multiparm that you've made, which is nice to define a variable number of curves with their corresponding parameters. - the `ForEach` node iterates over the number of curves defined in the multiparm. - within each iteration of the `ForEach` node, a new curve is defined. The VEX code might look scary but is actually very simple—most of the lines of code are there to retrieve the values from the multiparm, the job is done only in the 2 last lines. The variables `pos` and `value` are defined in the range [0, 1], as per the ramp, so we need to scale them according to the length and min/max values. `(pos - 0.5) * length` is a factorization of `length * pos - length * 0.5`, that is to make your curve match the `length` parameter while being centered, and `fit(value, 0, 1, min, max)` should be obvious enough for you since you tried to do something similar. Keep in mind that the `Point Wrangle` node runs the code once per input point, that is the number of points defined in `line1`, and thus matching the number of points from the profile curve ramp, which makes it possible to make an association between the point number (@ptnum) and the ramp point index. Alright I was able to understand the VEX pretty well, I have a basic knowledge of C++ which helps, I was just a bit confused on to how you applied it. Going through this method I've been having trouble figuring out how to translate each copy of the line over, because every time I try to translate it it moves the entire object over together and not individually. Quote Link to comment Share on other sites More sharing options...
ChristopherC Posted June 19, 2015 Share Posted June 19, 2015 I guess you now want to translate each curve in the Z axis? If it has to be done manually for each curve, then add a new parameter in your multiparm, otherwise just use the current curve index and multiply it by the distance you want between each curve. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.