Found 79 posts.
Search results Show results as topic list.
Technical Discussion » Split in groups by by sum of weights
- MathieuLeclaire
- 79 posts
- Offline
I ended up writing a script that loops through the prims by decreasing value of weights. For each prim with the biggest weight, I find the group that has the less cumulative weights and add it to it. This works really well.
Technical Discussion » Split in groups by by sum of weights
- MathieuLeclaire
- 79 posts
- Offline
I thought I could use UV layout and create a grid per prim that has uv.y = 1 / nb groups and ux.x = nb_groups * weight / total weight… then however UV layout places the pieces, the uv.y / nb_groups = the group id as long as there are no rotations in the UV island which I choose in the Island Rotation Step, but uv layout still does occasionally rotate a tile 90 degrees anyway, so that ain't giving me the results I'm after.
Still looking for better approaches…
Still looking for better approaches…
Technical Discussion » Split in groups by by sum of weights
- MathieuLeclaire
- 79 posts
- Offline
I'm sure there must be an easy way to pull this off. Maybe my brain is just overworked and I can't seem to wrap my head around this one right now, but I'm guessing someone will have a great suggestion on how to accomplish this:
I have a list of primitives that has a ‘weight’ attribute per prim. I want to split them up into x number of groups, where the sum of weight in each groups are as close as possible to the same value. So let's say I have 100 prims and the sum of all their weights are 1000 units and I want to split them into 20 groups/boxes, then I want the sum of each weight attribute from each group/box to be as close as possible to 50 units. When I say groups/box, all I really need is a new attribute that has an integer value giving me the groups/box it belongs to.
What do you guys think? How should I get these prims sorted in Houdini? Any suggestions?
Thanks!
I have a list of primitives that has a ‘weight’ attribute per prim. I want to split them up into x number of groups, where the sum of weight in each groups are as close as possible to the same value. So let's say I have 100 prims and the sum of all their weights are 1000 units and I want to split them into 20 groups/boxes, then I want the sum of each weight attribute from each group/box to be as close as possible to 50 units. When I say groups/box, all I really need is a new attribute that has an integer value giving me the groups/box it belongs to.
What do you guys think? How should I get these prims sorted in Houdini? Any suggestions?
Thanks!
Technical Discussion » HDA with time dependent and non-time dependent outputs
- MathieuLeclaire
- 79 posts
- Offline
What happens inside the HDA that is non-time dependent doesn't get re-evaluated every frame. It stays cached after first evaluation as expected. The problem is whatever I plug the HDA non-time dependent output to that gets re-evaluated every frame. That's where my issue is. That's the part that baffles me.
The only workaround I found was plugging a timeshift between that HDA output and the next SOP to force it to a non-time dependent evaluation.
As for your question, yes, we do have a time dependent input that's being used in the non-time dependent output evaluation branch, but there is a timeshift before being used in that branch, so that should force it to be non-time dependant. And again, when inspecting the performance monitor, we can see none of that branch is being re-evaluated every frame. Whatever happens inside that HDA works as expected. It's really whatever we plug that output to that's not working as expected.
The only workaround I found was plugging a timeshift between that HDA output and the next SOP to force it to a non-time dependent evaluation.
As for your question, yes, we do have a time dependent input that's being used in the non-time dependent output evaluation branch, but there is a timeshift before being used in that branch, so that should force it to be non-time dependant. And again, when inspecting the performance monitor, we can see none of that branch is being re-evaluated every frame. Whatever happens inside that HDA works as expected. It's really whatever we plug that output to that's not working as expected.
Technical Discussion » HDA with time dependent and non-time dependent outputs
- MathieuLeclaire
- 79 posts
- Offline
Technical Discussion » HDA with time dependent and non-time dependent outputs
- MathieuLeclaire
- 79 posts
- Offline
BTW, I know I can plug a timeshift after that output to freeze it in time, but it feels a bit dirty and I wonder if there is another way to avoid using this workaround.
Technical Discussion » HDA with time dependent and non-time dependent outputs
- MathieuLeclaire
- 79 posts
- Offline
So I have this HDA that has 2 outputs. The first output is changing values per frame, while the second is not. In this HDA, we calculate and cache a geometry that we then deform per frame and I output both the static geometry and the animated one.
Now because one output is animated, whatever I plug after the static output gets reevaluated every frame as it is tagged as animated, even though it really is not. Is there a way to tell Houdini that this specific HDA output is non time dependent so that whatever I plug after it doesn't get re-evaluated every frame?
Now because one output is animated, whatever I plug after the static output gets reevaluated every frame as it is tagged as animated, even though it really is not. Is there a way to tell Houdini that this specific HDA output is non time dependent so that whatever I plug after it doesn't get re-evaluated every frame?
Technical Discussion » Track which attributes are being called?
- MathieuLeclaire
- 79 posts
- Offline
So I have this very complex HDA with thousands of nodes inside that has been iterated upon by a few TDs and updated multiple times in the last few months. This HDA creates and manipulates around a hundred attributes. Because we changed a lot of the functionality over time, there are many attributes that aren't being used anymore. I want to clean up the HDA so we can remove attributes that aren't being used anymore, but it's hell trying to track all of them down.
Houdini has a ton of good tools to help track dependencies on nodes and parameters. By analyzing the info on each node, we can see which attributes are being modified… but is there a way to track the dependency of an attribute? Like figuring out on how many nodes it is being evaluated and used? I don't know if Houdini offers such tracking tool !? That sure would help ease the task of tracking down which attributes are still useful and which ones we can get rid of.
Houdini has a ton of good tools to help track dependencies on nodes and parameters. By analyzing the info on each node, we can see which attributes are being modified… but is there a way to track the dependency of an attribute? Like figuring out on how many nodes it is being evaluated and used? I don't know if Houdini offers such tracking tool !? That sure would help ease the task of tracking down which attributes are still useful and which ones we can get rid of.
Edited by MathieuLeclaire - April 30, 2020 10:02:54
Technical Discussion » Custom HDA group selection
- MathieuLeclaire
- 79 posts
- Offline
This is good information to get me on the right track. I will look into all this. Thanks for sharing.
Technical Discussion » Custom HDA group selection
- MathieuLeclaire
- 79 posts
- Offline
Hello,
I would like to create a custom selection tool for my HDA. My HDA takes in a bunch of curves and does some manipulations on them. I exposed a group parameter so users can select which curves are to be affected by this HDA.
The problem is the curves are all pretty close to one another and crisscrossing… they are hard to select.
The tool is designed so the incoming curves have a curveGroupId attribute to facilitate the selection. I know you can use any attribute to do your selection by pressing 9, but ideally, I would prefer to create a “select curve” button that calls a Python script to do these 3 things:
1 - Activate that selection mode by default (i.e. using the curveGroupId attribute for selection). Is there a script function that lets you activate and set the selection mode?
2 - To make the selection easier, I would like to temporarily convert the curves to polywires so the user can more easily select the right curve(s) he wants to edit. I'm guessing inside my HDA, I can wire up a polywire sop and plug it to a null that I name display_selection and I can force that node to display while the user is doing his curve selection !? How can my script force this display while I'm in selection mode?
3 - This one is a bit more tricky, but since a lot of curves are overlapping, even if I convert them to polywires, it can be very tricky to select a specific curve that's hidden behind a couple more curves. I'm wondering if we could implement some kind of functionality that raycast all curves/polywires on your mouse pointer and allows the user to use the mouse wheel or a keyboard shortcut to circle through the possible selections?
I know the 3rd one is a little more tricky to implement. If you only have answers for the first 2 points, then please share as just these two functionalities will do a world of difference for my HDA. But if you do happen to know how to do the 3rd functionality, that would be amazing if you can share any information on how to get that working as well. I'm guessing I have to implement my own selection viewer state to do something like that. I'm reading up on that right now, but while I'm wrapping my head around all this, any pointers would be appreciated.
Thanks.
I would like to create a custom selection tool for my HDA. My HDA takes in a bunch of curves and does some manipulations on them. I exposed a group parameter so users can select which curves are to be affected by this HDA.
The problem is the curves are all pretty close to one another and crisscrossing… they are hard to select.
The tool is designed so the incoming curves have a curveGroupId attribute to facilitate the selection. I know you can use any attribute to do your selection by pressing 9, but ideally, I would prefer to create a “select curve” button that calls a Python script to do these 3 things:
1 - Activate that selection mode by default (i.e. using the curveGroupId attribute for selection). Is there a script function that lets you activate and set the selection mode?
2 - To make the selection easier, I would like to temporarily convert the curves to polywires so the user can more easily select the right curve(s) he wants to edit. I'm guessing inside my HDA, I can wire up a polywire sop and plug it to a null that I name display_selection and I can force that node to display while the user is doing his curve selection !? How can my script force this display while I'm in selection mode?
3 - This one is a bit more tricky, but since a lot of curves are overlapping, even if I convert them to polywires, it can be very tricky to select a specific curve that's hidden behind a couple more curves. I'm wondering if we could implement some kind of functionality that raycast all curves/polywires on your mouse pointer and allows the user to use the mouse wheel or a keyboard shortcut to circle through the possible selections?
I know the 3rd one is a little more tricky to implement. If you only have answers for the first 2 points, then please share as just these two functionalities will do a world of difference for my HDA. But if you do happen to know how to do the 3rd functionality, that would be amazing if you can share any information on how to get that working as well. I'm guessing I have to implement my own selection viewer state to do something like that. I'm reading up on that right now, but while I'm wrapping my head around all this, any pointers would be appreciated.
Thanks.
Technical Discussion » Wires from hairgen
- MathieuLeclaire
- 79 posts
- Offline
Use a measure sop to perimeter to store the lengths, plug it into an attribute promote to promote it from primitives to points and then use the attribute in the wire radius and multiply it by whatever factor you wish (example: @perimeter*0.1).
Edited by MathieuLeclaire - April 3, 2020 11:21:22
Technical Discussion » Sculpt curve deformations in HDA
- MathieuLeclaire
- 79 posts
- Offline
I'm also getting some problems promoting the parameters of an attribute paint sop. I want to use it to scale the thickness (pscale) of the curves. I don't get any error message with this one, but when I paint from the HDA level, it just paint on the XY plane and never hits any of my curves points. If I jump inside the HDA and select the attribpaint sop and paint from there, it works as expected and I can easily increase or decrease the point values.
So I'm stuck with the same problem. How do I expose the same paint functionality directly on an HDA to match the functionalities I have when I do it directly on an attribute paint sop and a guide groom sop?
So I'm stuck with the same problem. How do I expose the same paint functionality directly on an HDA to match the functionalities I have when I do it directly on an attribute paint sop and a guide groom sop?
Edited by MathieuLeclaire - March 31, 2020 21:43:38
Technical Discussion » Sculpt curve deformations in HDA
- MathieuLeclaire
- 79 posts
- Offline
I want to create an HDA to deform curves very similar to the guide groom sop.
I want the curves to deform based on the user strokes, the only difference is I want the root and tips to lock in place with no constraint on the length. I figured I would simply use the guide groom sop and add an attribute wrangle after it to copy back the positions of the tips and wrap this up into an HDA. I figured that, like when using a stroke or a draw curve sop, to expose the viewer state, all I needed was to promote the guide groom sop parameters to my HDA and add stroke to my node default state, but it isn't working. It gives me this error as soon as I start drawing in the viewport:
Any idea how to fix this? Or any alternative to creating a similar custom grooming tool?
I've looked into the guide groom to figure out how it worked, but it's such a complex node. I guess I could do a duplicate of that operator into a new HDA and append an attribute wrangle directly inside that new version of the node to add the desired behavior… it just feels like a huge hack and I figure there must be an easier way to get that type of tool up and running !?
I want the curves to deform based on the user strokes, the only difference is I want the root and tips to lock in place with no constraint on the length. I figured I would simply use the guide groom sop and add an attribute wrangle after it to copy back the positions of the tips and wrap this up into an HDA. I figured that, like when using a stroke or a draw curve sop, to expose the viewer state, all I needed was to promote the guide groom sop parameters to my HDA and add stroke to my node default state, but it isn't working. It gives me this error as soon as I start drawing in the viewport:
Invalid source /obj/geo1/subnet1/guidegroom1/extract_ramp_data/python1
Error: Python error: Traceback (most recent call last):
File “”, line 12, in
File “D:/PROGRA~1/SIDEEF~1/HOUDIN~1.348/houdini/python2.7libs\hou.py”, line 13107, in attribValue
return _hou.Prim_attribValue(*args)
ValueError: invalid null reference in method ‘Prim_attribValue’, argument 2 of type ‘HOM_Attrib &’
.
Any idea how to fix this? Or any alternative to creating a similar custom grooming tool?
I've looked into the guide groom to figure out how it worked, but it's such a complex node. I guess I could do a duplicate of that operator into a new HDA and append an attribute wrangle directly inside that new version of the node to add the desired behavior… it just feels like a huge hack and I figure there must be an easier way to get that type of tool up and running !?
Technical Discussion » Find where a parameter is being called/evaluated ?
- MathieuLeclaire
- 79 posts
- Offline
Yeah… it doesn't find any dependencies so I'm guessing he pulls the data through a wrangle or a python node. I guess I'll have to do it the long way and go through every one I find.
Technical Discussion » Find where a parameter is being called/evaluated ?
- MathieuLeclaire
- 79 posts
- Offline
Is there a way to find where inside an HDA or a Subnetwork a specific parameter is being called/evaluated?
I'm playing in someone else's HDA and I don't have access to the author anymore, so I'm trying to wrap my head around certain behaviors he implemented so I can tweak a few things. The problem is, his HDA is very complicated. It contains lots of VEX, lots of Python, a ton of nodes and subnets with a ton of expressions all over the place.
The truth is, I don't need to fully understand every subtleties that's happening inside. There is a toggle in his parameters that changes the behavior of his tool, and I want to adjust it a bit. So I'm trying to find where inside his HDA that parameter is being referenced so I can go directly to the area of interest to me… I just don't know how to trace my way through his set-up to find where he evaluates this parameter. Is it called in an Attribute Wrangle? Is it called inside a Python node? Maybe it's evaluated on an expression on another node's parameter?
I'm just wondering if Houdini has any tool to help us trace a specific parameters' dependencies?
I'm playing in someone else's HDA and I don't have access to the author anymore, so I'm trying to wrap my head around certain behaviors he implemented so I can tweak a few things. The problem is, his HDA is very complicated. It contains lots of VEX, lots of Python, a ton of nodes and subnets with a ton of expressions all over the place.
The truth is, I don't need to fully understand every subtleties that's happening inside. There is a toggle in his parameters that changes the behavior of his tool, and I want to adjust it a bit. So I'm trying to find where inside his HDA that parameter is being referenced so I can go directly to the area of interest to me… I just don't know how to trace my way through his set-up to find where he evaluates this parameter. Is it called in an Attribute Wrangle? Is it called inside a Python node? Maybe it's evaluated on an expression on another node's parameter?
I'm just wondering if Houdini has any tool to help us trace a specific parameters' dependencies?
Technical Discussion » for each doing both merge and fetch update?
- MathieuLeclaire
- 79 posts
- Offline
That's a fantastic example. It does exactly what I want, and shows me a few cool tricks I didn't know. Thanks for that.
Technical Discussion » for each doing both merge and fetch update?
- MathieuLeclaire
- 79 posts
- Offline
I guess I could tag the curves and the mesh, merge them together, loop through the tags with a fetch feedback, split the mesh and the current curve based on the metadata, generate my new curves, change my topology and merge everything back together to prepare for the next loop. That's the only way I see this working. Any better suggestions?
Technical Discussion » for each doing both merge and fetch update?
- MathieuLeclaire
- 79 posts
- Offline
I'm not sure how to deal with a particular situation. I'm building an HDA with 2 inputs, a list of curve, and a mesh. I need to generate 2 outputs, a new list of curve and an updated mesh.
Here's where I'm stuck. I'm trying to use a foreach loop to loop through each input curve. Each curve generates a new set of curves that are merged on each iteration, but I also want these curves to update the mesh on each iteration.
So the first curve generates new curves using the original input mesh, then these new curves updates the mesh topology and then we go to the next curve, it generates new curves using that updated mesh topology, then these new curves updates the mesh topology again, and so forth until we looped through all the curves and then I want to return the new curves and the last updated mesh.
The foreach nodes gives us a choice of Merge Each Iteration or Feedback Each Iteration where I'm trying to do both. Also the foreach loop outputs just one object, where I need it to output two (the new curves and the updated mesh).
Any recommendations on how I can set this up?
Here's where I'm stuck. I'm trying to use a foreach loop to loop through each input curve. Each curve generates a new set of curves that are merged on each iteration, but I also want these curves to update the mesh on each iteration.
So the first curve generates new curves using the original input mesh, then these new curves updates the mesh topology and then we go to the next curve, it generates new curves using that updated mesh topology, then these new curves updates the mesh topology again, and so forth until we looped through all the curves and then I want to return the new curves and the last updated mesh.
The foreach nodes gives us a choice of Merge Each Iteration or Feedback Each Iteration where I'm trying to do both. Also the foreach loop outputs just one object, where I need it to output two (the new curves and the updated mesh).
Any recommendations on how I can set this up?
Technical Discussion » Texture from attribute
- MathieuLeclaire
- 79 posts
- Offline
jparker
The material SOP can also create material overrides for shader parameters if your attribute has a local variable associated with it.
That one works. I guess I can create the attributes material_override in VEX to assign the proper texture… Thanks for that.
Technical Discussion » Texture from attribute
- MathieuLeclaire
- 79 posts
- Offline
tamte
Parameter VOP or Bind VOP should work assuming your path attribute is primitive string attribute (can be also detail if it's not varying)
you can even just use plain Principled Shader and name your attribute s@basecolor_texture which will automatically override that map since internally it's just Parameter VOP as well
That's what I'm trying, but it's not working. I created a Principled Shader and named it proxy. I assign these primitive attributes on my object with a wrangle :
s@basecolor_texture = ‘F:/tests/tex/proxy/meshA_midres_proxy.jpg’;
s@shop_materialpath = “/mat/proxy”;
I tried with the Princippled Shader and nothing plugged into it… it doesn't work.
I tried plugging a “bind” to the basecolor_texture port and setting name to basecolor_texture as Type string… it doesn't work.
I tried plugging a “Parameter” to the basecolor_texture port and setting name to basecolor_texture as Type string… it doesn't work.
The only thing that works is when I write the full texture path directly inside the Principle Shader or put an expression on it… but that means I can only assign one texture per shader. I don't understand why it's not working.
-
- Quick Links