Hey folks,
so I ran into a little challenge. I want to build a tool that uses a simple box inside a subnet and generates some geo on the faces of that box.
To conveniently change the size of the box you have usually these handles where you simply drag the size of your box to your needs, but when I wrap that all into a subnet I lose that little red pyramid handles. There is the option in the type properties menu under "Node" to specify the guide geo, but it shows just the outline and not the handles.
So what I basically want is to have the "node selection" on the box inside of the subnet to give me the handles and the "display flag" on the output to give me the result. Is there an option to get that without python? However I am aware of the option to just take the box outside the subnet, but I was wondering if there is a better solution to that, since the box will remain always a box.
Thanks a lot
Found 11 posts.
Search results Show results as topic list.
Technical Discussion » HDA// Type Properties// Node Handles
- Irinel
- 12 posts
- Offline
Technical Discussion » SCRIPTING: Scripting text size won't change permanently
- Irinel
- 12 posts
- Offline
Sorry for the dumb question, but when I am changing the scripting text (zoom) size, it will always change it back to default. Is there any option to get that change permanently? Saving the current desktop doesn't help either.
Thanks a lot
Thanks a lot
Technical Discussion » Combinational sum in a given array
- Irinel
- 12 posts
- Offline
Thanks everyone for their help. If anyone is interested, I was finally able to wrap something up in vex though. In case it's useful for you, this is how it works (it is not perfect at all, but seems to get the job done):
The code requires that the target could be covered up by the items in the array. In this case it begins with the biggest item (due to sorting), tries to fit that in and if it does, it adds it to the combination, updates the target and moves on until the last bit of the target is reached.
float target = chi("target"); int array[] = {177, 167, 157, 147, 137, 127, 117, 107, 97, 87, 77, 67, 57, 47, 37, 27, 17, 7, 4, 3, 2, 1}; i[]@combination; foreach(int item; array) { if(target==0) { break; } if(item/target==1) { append(@combination, item); break; } if(item/target<1) { append(@combination, item); target = target-item; } }
Technical Discussion » Combinational sum in a given array
- Irinel
- 12 posts
- Offline
So, unfortunataly the permutations in python will only give me all unique rearrangements of my elements. It's also factorial. So when I am going to have, lets say 21 elements in my array, and I need the shortest combination to get a target sum, this will give me an unbearable amount of data, of which non of it might hold the right sum. In fact the sum will stay the same in each permutation, cause its "just" a rearrangement.
Maybe the "combinations_with_replacement" might be a better solution for that case and just working with a count as array length instead of a static one. That will give me at least every possible set, including using the same element more than once.
Will dig deeper in the "Backtracking/ Meet in the middle" approach as well, since it seems to provide much more control. Would be cool, if I can pull off a vex solution for that, but my monkey brain has its limitations I guess...
Maybe the "combinations_with_replacement" might be a better solution for that case and just working with a count as array length instead of a static one. That will give me at least every possible set, including using the same element more than once.
Will dig deeper in the "Backtracking/ Meet in the middle" approach as well, since it seems to provide much more control. Would be cool, if I can pull off a vex solution for that, but my monkey brain has its limitations I guess...
Technical Discussion » Combinational sum in a given array
- Irinel
- 12 posts
- Offline
@tamte this article explains it quite good. Unfortunately my skill level is not even near the quality needed to understand how I could implement that in python or vex in Houdini. I guess I need to dive a bit deeper. Thank you very much .
Technical Discussion » Combinational sum in a given array
- Irinel
- 12 posts
- Offline
@animatrix_ thank you very much, that helps a lot and is pretty easy. But I have now the problem that I cant get that into an attribute.
point.setAttribValue("combination", i)
would not work here. Can you point out, what I am missing? Maybe a different syntax for writing arrays as attributes?
point.setAttribValue("combination", i)
would not work here. Can you point out, what I am missing? Maybe a different syntax for writing arrays as attributes?
Technical Discussion » Combinational sum in a given array
- Irinel
- 12 posts
- Offline
Hey folks,
I am trying to solve a combinational sum issue in vex. So I have a given value of k, lets say 16 and specific items in an array, lets say {17,7,4,2,1}. I want Houdini to give me at least the first combination (ideal would be the shortest one) of items that results in k as an array.
My not so charming start:
How can I tell Houdini, if the result is not equal to k, try another combination. But also limit the comb array to max 3 items (I dont want a combination like {1+1+1+1+1+1+1...}. And if nothing is ever found, then it is allowed to expand the items count as long as it needs to find the first combination.
Sorry for the dumb question, I am not really good at vex, but want to get better. Thanks everyone .
I am trying to solve a combinational sum issue in vex. So I have a given value of k, lets say 16 and specific items in an array, lets say {17,7,4,2,1}. I want Houdini to give me at least the first combination (ideal would be the shortest one) of items that results in k as an array.
My not so charming start:
int iter = chi("iter"); int k = 16; int result; int array[] = {17,7, 4, 2, 1}; int comb[]; for(int n=0; n<iter ; n++) { append(comb, array[n]); result = sum(comb); if(result==k) { return; } }
Sorry for the dumb question, I am not really good at vex, but want to get better. Thanks everyone .
Technical Discussion » Dynamically changing Expressions
- Irinel
- 12 posts
- Offline
Technical Discussion » Dynamically changing Expressions
- Irinel
- 12 posts
- Offline
Thanks @tamte. I've tried the eval() but unfortunately it's not working. I will give Python a try.
Technical Discussion » Dynamically changing Expressions
- Irinel
- 12 posts
- Offline
Hello dear community members, I am running into a topic and I can't wrap my head around. I am trying to build an channel expression dynamically, that is changing via user input. My idea is to bind specific elements of the expression into string attributes, that builds the complete expression (string attribute) depending on the input.
For instance the functions are separately, the locations, and every other element in it. Everything is coming together and should be pasted in a float channel (because the actual expression is referencing float data). But it does not seem to work, probably because of the attribute class being a string. But is there a way to tell Houdini like "evaluate the expression and convert it into its actual value"?
I am not sure, if this is how things can work inside Houdini, or maybe there is another way of doing such things? Putting an "atof" in front of the string expression does not working either.
Thanky you very much
For instance the functions are separately, the locations, and every other element in it. Everything is coming together and should be pasted in a float channel (because the actual expression is referencing float data). But it does not seem to work, probably because of the attribute class being a string. But is there a way to tell Houdini like "evaluate the expression and convert it into its actual value"?
I am not sure, if this is how things can work inside Houdini, or maybe there is another way of doing such things? Putting an "atof" in front of the string expression does not working either.
Thanky you very much
Technical Discussion » What's with the new fuse/snap SOPs?
- Irinel
- 12 posts
- Offline
Hey fellas, since this seems to be the right thread I actually have a question regarding the new fuse SOP. Whats happening with the “unique” function? Was very usefull. Is there anywhere else a new tab for that, or how I can get unique and seperated line segments? Thanks alot in advanced
Cheers
UPDATE:
Okay, I think with “convert line” and a “facet” node I can get the same result. But anyways, was cool to do that task in one node. So If that option is still in the new “fuse” node I would appreciate that a lot if anybody could point me to it.
Thanks
Cheers
UPDATE:
Okay, I think with “convert line” and a “facet” node I can get the same result. But anyways, was cool to do that task in one node. So If that option is still in the new “fuse” node I would appreciate that a lot if anybody could point me to it.
Thanks
Edited by Irinel - May 16, 2019 05:07:56
-
- Quick Links