Hi, the attached example should do this.
The general idea is that you measure the area with a measure SOP, then feed that into a VOPSOP. In the VOPSOP you use (area+gap)/numPoints as a multiplier to set your range on the random number output. Gap is a parameter on the VOPSOP, so you can change the value there.
The result is that you get a combined pscale < area+gap. There is no guarantee that the combined pscale is close to area+gap, but it will always be less than.
Let me know if you have any questions
Found 93 posts.
Search results Show results as topic list.
Technical Discussion » Distribute Random Pscale
- KMcNamara
- 228 posts
- Offline
Technical Discussion » Parsing selection strings in Python
- KMcNamara
- 228 posts
- Offline
Technical Discussion » Parsing selection strings in Python
- KMcNamara
- 228 posts
- Offline
Hey,
Sorry if this has been asked but I can't find an answer -
I'm writing some Python code inside of a Python SOP and I want to get the current point/prim selection. When querying the sceneViewer to see what primitives or points are selected, the only option I see is to use the function mergedSelectionString(). I then need to convert this into a list of selected prims or points by writing the following code:
def parseSelectionString(str):
# Separate the string at each space
a = str.split(' ')
# Parse the list of strings into list of integers
b = [range(int(x.split('-')), int(x.split('-'))+1) if ‘-’ in x else for x in a]
# Flatten the list
c =
return c
Then I would need to loop through the geo's prims/points and grab the right ones based on this converted list.
This seems archaic. Is there an easier way to do this?
Sorry if this has been asked but I can't find an answer -
I'm writing some Python code inside of a Python SOP and I want to get the current point/prim selection. When querying the sceneViewer to see what primitives or points are selected, the only option I see is to use the function mergedSelectionString(). I then need to convert this into a list of selected prims or points by writing the following code:
def parseSelectionString(str):
# Separate the string at each space
a = str.split(' ')
# Parse the list of strings into list of integers
b = [range(int(x.split('-')), int(x.split('-'))+1) if ‘-’ in x else for x in a]
# Flatten the list
c =
return c
Then I would need to loop through the geo's prims/points and grab the right ones based on this converted list.
This seems archaic. Is there an easier way to do this?
Technical Discussion » Curve creation node with live preview?
- KMcNamara
- 228 posts
- Offline
Hey,
I'm wondering how to approach this problem:
I would like to create a custom node that allows users to create a handful of curves. Each time the user places a CV, I would like to run a bit of my own custom code (snapping CVs, checking distances, etc). Essentially I want the user to have a live preview how how the curves will look after my code is run.
Any ideas on how to approach this? I am pretty familiar with Python in Houdini and can jump into the HDK if necessary but I would prefer to stay in python if possible.
I'm wondering how to approach this problem:
I would like to create a custom node that allows users to create a handful of curves. Each time the user places a CV, I would like to run a bit of my own custom code (snapping CVs, checking distances, etc). Essentially I want the user to have a live preview how how the curves will look after my code is run.
Any ideas on how to approach this? I am pretty familiar with Python in Houdini and can jump into the HDK if necessary but I would prefer to stay in python if possible.
Technical Discussion » How would you rectangulate a polygon?
- KMcNamara
- 228 posts
- Offline
Given a closed curve (or polygon), how would you break it up into rectangles? I don't need to fill the entire space, I just want the rectangles to each touch the edge of the original polygon. (see first image)
Further, it would be great if this could work with some more difficult shapes and create some more interesting quads other than just rectangles. (see second image)
Does anyone have some ideas on how to approach this?
Thanks!
Further, it would be great if this could work with some more difficult shapes and create some more interesting quads other than just rectangles. (see second image)
Does anyone have some ideas on how to approach this?
Thanks!
Technical Discussion » How to sort points on a circle?
- KMcNamara
- 228 posts
- Offline
now that's the elegant solution I was looking for! Thanks Pusat
Thanks to you as well tjeeds! Looks like the atan2 solution will be more efficient
I appreciate the help
Thanks to you as well tjeeds! Looks like the atan2 solution will be more efficient
I appreciate the help
Technical Discussion » How to sort points on a circle?
- KMcNamara
- 228 posts
- Offline
Hey, thanks for the reply. Unfortunately I need to keep my points exactly where they are - as you can see they are not evenly spaced and that approach would alter the position of my points. Further, since this is part of a procedural system, they may be very unevenly spaced. They will always, however, lie on a circle and I will always have the center point and radius of that circle.
Any other ideas? Thanks again for the reply
Any other ideas? Thanks again for the reply
Technical Discussion » How to sort points on a circle?
- KMcNamara
- 228 posts
- Offline
I'm having trouble sorting a group of randomly ordered points that lie on a circle. I don't care if they're ordered clockwise/counter clockwise or which point is 0 - I just need the point numbers to increase as you walk around the circle (without changing their positions).
I've tried a handful of approaches using some math (dot product, etc), but my main issue is that the sort SOP can't actually access the point number or point position in its expression fields.
Any ideas? Attached is a screen of the points I need to sort
I've tried a handful of approaches using some math (dot product, etc), but my main issue is that the sort SOP can't actually access the point number or point position in its expression fields.
Any ideas? Attached is a screen of the points I need to sort
Technical Discussion » Ridiculous GUI issue
- KMcNamara
- 228 posts
- Offline
You should be able to download builds here:
http://www.sidefx.com/index.php?option=com_download&Itemid=208 [sidefx.com]
http://www.sidefx.com/index.php?option=com_download&Itemid=208 [sidefx.com]
Technical Discussion » Attribute exists in detail view but can't use in expression?
- KMcNamara
- 228 posts
- Offline
Thanks guys - I always thought each attribute automatically got it's own variable.
That clears it up!
That clears it up!
Technical Discussion » Attribute exists in detail view but can't use in expression?
- KMcNamara
- 228 posts
- Offline
Beautiful, thank you! That fixed the issue.
So that I understand - I thought that the area node created attributes? Why do I need to re-map them to attributes again?
So that I understand - I thought that the area node created attributes? Why do I need to re-map them to attributes again?
Technical Discussion » Houdini 12 issues
- KMcNamara
- 228 posts
- Offline
Have you tried different graphics card drivers? Either updating or rolling back? Sometimes that fixes issues like that for me.
Technical Discussion » Attribute exists in detail view but can't use in expression?
- KMcNamara
- 228 posts
- Offline
Hi,
I'm having some odd issues with attributes. I use the measure SOP to measure the primitive area, using the ‘override name’ option, setting the name to ‘original’. I then use an attribute transfer SOP to transfer this attribute to new geometry. This seems to work, as I can see ‘original’ in the details view on the new geo.
Then I measure area again, overriding name to ‘new’. I now see ‘new’ and ‘original’ in the details view. Now, I would like to use a Delete SOP and delete ‘$NEW < $ORIGINAL’. However, neither of those attributes are accessible in the expression. Further, $AREA exists in the expression, but shouldn't exist at all and is not present in the detail view.
What is going on? :?
I'm having some odd issues with attributes. I use the measure SOP to measure the primitive area, using the ‘override name’ option, setting the name to ‘original’. I then use an attribute transfer SOP to transfer this attribute to new geometry. This seems to work, as I can see ‘original’ in the details view on the new geo.
Then I measure area again, overriding name to ‘new’. I now see ‘new’ and ‘original’ in the details view. Now, I would like to use a Delete SOP and delete ‘$NEW < $ORIGINAL’. However, neither of those attributes are accessible in the expression. Further, $AREA exists in the expression, but shouldn't exist at all and is not present in the detail view.
What is going on? :?
-
- Quick Links