Edge Grouping?

   23159   15   0
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
Fourth Wall has an Edge Group utility but it will not work on my machine since I have 64-bit and the utility only runs on certain 32-bit Windows Houdini setups.
http://www.fourthwall.ndo.co.uk/HT_HDK_GroupEdges.html [fourthwall.ndo.co.uk]

Does anyone off hand know of a way I can type a set of edges in the polyextrude parameter to specify what it is I want to extrude, if not extruding an entire edge loop? (Also, why isn't edge grouping/ edge extruding easier in Houdini? I find that with the tradeoff of the copy sop and some other modeling tools such as sweep, other 3D packages make polygonal modeling more intuitive, or am I missing something that someone can point out to me?)

Sincerely,
markerline
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
I had a vision from my memory which was from another sop where you can specify Primitive Number and then edge number as such: Pe0 where e0 is edge 0 and P is the primitive/face number. If anyone has any insight, how would I write a script that uses viewport-selected edges and converts them into this syntax that I can copy and paste into a polyextrude sop's group parameter? Better yet, is there a viewport display which allows me to view edge numbers? In simple geometry edge 0 will appear in similar/congruent places but once geometry has gone through several edit sops and blast and dissolve sops this congruence might change so I would need a procedural way to select edges. If I can visualize the edges the same way I can visualize points and primitive numbers then that would get me started. I could then probably write a batch script in DOS or bash that would print out a string (sorry I said DOS, I'm on Windows, guess I should be using cygwin).
User Avatar
Member
67 posts
Joined: Jan. 2009
Offline
You need to specify points. Like p6-7. The way I've done it the last time was grouping points, and then use the strreplace function to place the ‘-’ inbetween. Off the top of my head it goes like this:

p`strreplace(pointlist(), “ ”, “-”)

I recall someone made an operator for edge selection, but I couldn't find the topic.
IMHO
Lorenz
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
string replace sounds like an appropriate solution but to specify points is inappropriate as it will select all shared edges of those points, which is not what I want. for example if you select a single point on a grid you get a selection of edges in the form of a “+” where as if you select two points what you really want is an edge between those two points in the form of a “-” or a “|” instead of ++ so you have to specify 5e0 for example where 5 is primitive/face number 5 and e0 is edge 0 out of a possible range in a four-sided face of 0-3. Well, if the group sop doesn't create a selection pattern of 1e0 2e0 3e0 and so forth to use with string replace then I suppose I would have to create my own string replace pattern in a shell using a for loop. I started on experimenting with this in a DOS command shell but I think a bash shell will produce better results as I was getting carriage returns where I didn't want carriage returns in DOS. Thank you for your help.

-markerline

P.S. the edge selection tool is found at the top of this post in a link but it has limitations on the platform it works on and the version number of Houdini it works with.
User Avatar
Member
2199 posts
Joined: July 2005
Offline
Is there a reason why you don't just pick the edges to extrude in the viewport interactively?
The trick is finding just the right hammer for every screw
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
Have you ever tried modeling anything? The reason there is the edge-loop selection tool is so that you don't have to choose edges one at a time. Similar to the Group SOP which allows you to choose multiple ranges of points without having to click on each one of them as you would in Maya (unless you wrote a mel script to select them, although in Maya you cannot visualize point/cv numbers). When I hit f to select the next part of the loop it chooses the wrong part, even if I manually select two in sequence as such “_ _ ” it decides to go off on a perpendicular tangent on the next loop if I hit f. If I hit l or Shift+L I get undesireable results as well. The interactivity tools should be no excuse not to have a procedural node-based way of selecting objects in the group sop. (If the group sop is called “Group Geometry” and it is lacking true edge selection I think that is a major misstep on the part of the programmers who could implement the functionality but choose not to do so, in my humble opinion)
User Avatar
Member
678 posts
Joined: July 2005
Offline
Simon
Is there a reason why you don't just pick the edges to extrude in the viewport interactively?

Strange question from person who done GroupEdges tool himself
User Avatar
Member
2199 posts
Joined: July 2005
Offline
I just wanted to be sure that the procedural approach was actually going to be of any benefit. Sometimes people miss the obvious because they get too stuck in the mind set that Houdini only works in a procedural way.

As for the group sop not supporting edge selections I agree it is a major missing element and one that my edge group node only partially addresses.
The reason edge groups are not supported is historical, sops that manipulate edges were introduced quite late in the history of Houdini and sadly when they were I'm guessing it involved too much work to properly include them with the procedurally tools.

I still have hopes that one day this will be rectified along with a number of other missing modeling tools. Maybe H11 but not so sure, one day though, one day.

Keep submitting requests for this people and eventually Sesi will add it.

@markerline:
Have you ever tried modeling anything?
Yes, I spend about 70% of my working life modelling in houdini 8)
The trick is finding just the right hammer for every screw
User Avatar
Member
2199 posts
Joined: July 2005
Offline
…also

The way my sop works is simply to take a point group and convert it to the form p0-1-2-3.. etc as suggest earlier in this thread using strreplace, you then paste a reference to that formatted string where-ever you want it.

It would probably be possible to write a similar tool to mine as a python sop these days, you could then easily extend it to work with the “Prim num” “Edge num” format or any other format you liked. For example mimicking the range and pattern options of the group sop. No need then for shell scripts.
The trick is finding just the right hammer for every screw
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
@Simon, Thank you very much for your thoughtful input and I didn't mean to offend if I did by asking if you ever model. I should have restated to say have you ever modeled in other packages because the workflow can be a little different. You're right to say Houdini is missing some tools, off the top of my head this edge selection is the one that comes to mind first though at one point houdini didn't even have edgelooping as one of their tools, so maybe they'll implement it in the next release which I heard was scheduled before the upcoming Siggraph conference. But that is not a guaranteed delivery date, it's just something I heard they were trying to get done since that conference is a really large venue for showcasing.

-markerline
User Avatar
Member
32 posts
Joined: Feb. 2009
Offline
Well, on Fourth Wall they do have the source code for that, and most of their other tools available. You could compile it in the HDK for your o/s and version of Houdini.

some of their other tools for modeling that i would suggest would be their poly crease, point slide, and poly cusp bevel.

I also suggest you look on the exchange for the stuff uploaded by Swann, or check his full list of tools here:
http://www.forum3d.pl/f3dbb/index.php?md=topic&tid=124040#first_unread_post [forum3d.pl]

The ones on forum3d are non commercial, but the few that are on the exchange are commercial versions I believe.

I would love to see SESI include some tools similar to these one day, as well as a few other things which would make modeling a little easier. The Fourth Wall ones make procedural work a lot easier, and Swann's bridge, extrude by line, flatten, and polycreate are all awesome and can create some cool stuff

I definitely agree about getting stuck in an only procedural mindset. It is very difficult to merge the two methods though. I am just starting to figure out how to use both procedural and non procedural methods together without it causing everything to freakout when you change something
User Avatar
Member
897 posts
Joined: July 2018
Offline
Ive always felt that modeling will stay virtualy useless until some semi procedural interface is developed. Switching between different tools such as brushes and softmodification needs to run seemlessly to be able to model in a artistic mindset. UI is far more urgent then adding more mesh functions.

That said, there's already linear modeling packages but only one real procedural modeler so Im not sure it would be worth it. Maby support the I/O for geo instead and keep ruling the procedual kingdom.

But please make it possible to edit groups of curve points at the same time on the curve node
B.Henriksson, DICE
User Avatar
Member
678 posts
Joined: July 2005
Offline
clown
I also suggest you look on the exchange for the stuff uploaded by Swann, or check his full list of tools here:
http://www.forum3d.pl/f3dbb/index.php?md=topic&tid=124040#first_unread_post [forum3d.pl]

Hehe, they are a little old and need some little TWEEEAKS.At the time I was doing them I didn't knew Python and now it with it under my belt I can manage points in a way I couldnt before. I'm preparing to remade them from scratch but I just heavn't had time yet. But this time will come… some day… be patient .
User Avatar
Member
678 posts
Joined: July 2005
Offline
I played a little with this idea in python.

This is what i have so far. Maybe some of you will have better ideas how to expand this. Code below is main part that manages selection that other function not listed here, but added in the attached file, places in Selection slot.


# This code is called when instances of this SOP cook.
geo = hou.pwd().geometry()
this = hou.pwd()
group = this.evalParm('group')
# Add code to modify the contents of geo.


def CreateMissingRange(selection):
“”“
This function expands point selections of type
”num0-numX“ to ”num0 num1 num2… and returns as a integer list"

EXAMPLE:

>>>group = ‘45-35’
>>>CreateMissingRange(group)


>>>group = ‘5-9’
>>>CreateMissingRange(group)


“”"


separateNumbers = selection.split('-')
value1 = int(separateNumbers)
value2 = int(separateNumbers)

# generate sequence
switch = 0
if(value1 < value2):
switch = 1
else:
switch = -1

# test for python version compatibility
from sys import version
if(int(version) < 3):
sequence = xrange(value1,value2, switch)
else:
sequence = range(value1,value2, switch)

# create point list
list =
for val in sequence:
list.append(val)

# test for value1
if(value1 in list):
pass
else:
list.append(value1)

# test for value2
if(value2 in list):
pass
else:
list.append(value2)


return list

def FindRangesAndExpand(pointGroup):
“”“
This function finds point ranges of type ”num0-numX“,
sends them to CreateMissingRange() function and then creates
string list containg all points in specified group
with expanded range.

EXAMPLE:

>>>group = ‘43 75 74 33-38 24’
>>>print FindRangesToExpand(group)
‘43 75 74 33 35 36 37 38 24’
”“”

string = “”
list =

separateNumbers = pointGroup.split(' ‘)
for num in separateNumbers:
if (num.find(’-') < 0):
list.append(num)
#string += num + ‘ ’
else:
numRange = CreateMissingRange(num)
for numR in numRange:
list.append(str(numR))
#string += str(numR) + ‘ ’
for l in list:
if(l.isdigit() == False):
list.remove(l)

return list


def CreateEdgeGroup(pointList, groupType):
“”“” This function creates string representation of edge group “”“

string = ”"

sequence = range(0, len(pointList)-1)


num1 = 0
num2 = 1
for num in sequence:
string += ‘p’ + pointList + ‘-’ + pointList + ‘ ’
num1 = num1 + 1
num2 = num2 + 1

if(groupType == 0):
return string
elif(groupType == 1):
string += ‘p’ + pointList + ‘-’ + pointList
return string


this.parm('edgegrp').set(CreateEdgeGroup(FindRangesAndExpand(group), this.evalParm('selectiontype')))


It works good when you specify edges manually. A little worse if you just select one edge and press L to get loop because it very often does not return points in order how loop continues, even when you specify to ordered in selectGeometry (). For closed loops switch selection type to closed.

Ofcourse it will not work with some fancy selection that cross itself.

Anyway, today my imagination stops here. I can't think of anything better right now.


Just remember that selection must follow the same direction, so if you specify edge and it's follows right and then you specify edge on the left first reverse selection by SHIFT+R and then select edge. It's Fu****g Important.

Attachments:
edgeGroup.otl (6.3 KB)

User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
You can actually replace most of that code (the two range creating functions) with like 3 lines. Since you are dealing with points, you can just use hou.Geometry.globPoints() to unpack it all for you. It will take your selection string and return all the hou.Point objects corresponding to what you select and you don't even have to worry about ranges; Houdini does it for you. Then you can just convert it to a list of point numbers.
points = geo.globPoints(group)
point_numbers = map(hou.Point.number, points)
point_list_string = map(str, point_numbers)

Globbing for points and primitives was added for in Houdini 9.5 and is incredibly useful. I did have something similar to this in some of my own tools before hand but thankfully I was able to get rid of that mess. Globbing for vertices is available in Houdini 11.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
678 posts
Joined: July 2005
Offline
graham
You can actually replace most of that code (the two range creating functions) with like 3 lines..

Yeah, I knew it this. I was just testing are you active in sunday ;].

Definetely much better solution, thank you Graham.


So, this is the code now. If anybody got some ideas feel free to join in. Just replace code in operator attached to my previous code with this one below.


geo = hou.pwd().geometry()
this = hou.pwd()
group = this.evalParm('group')
# Add code to modify the contents of geo.


def ExpandPointGroup(pointGroup, geometry):
“”“
This function expands point groups.

EXAMPLE:

>>>group = ‘43 75 74 33-38 24’
>>>print ExpandPointGroup(group, geo)
‘43 75 74 33 35 36 37 38 24’
”“”
points = geometry.globPoints(pointGroup)
point_numbers = map(hou.Point.number, points)
point_list_string = map(str, point_numbers)

return point_list_string

def CreateEdgeGroup(pointList, groupType):
“”“ This fubction creates string representation of edge group. ”“”

string = “”

sequence = range(0, len(pointList)-1)


num1 = 0
num2 = 1
for num in sequence:
string += ‘p’ + pointList + ‘-’ + pointList + ‘ ’
num1 += 1
num2 += 1

if(groupType == 0):
return string
elif(groupType == 1):
string += ‘p’ + pointList + ‘-’ + pointList
return string

“”“——–EXECUTE——–”“”
# expand point list
pointList = ExpandPointGroup(group, geo)
# create edge string
edgeGroup = CreateEdgeGroup(pointList, this.evalParm('selectiontype'))
# set edge group field
this.parm('edgegrp').set(edgeGroup)
  • Quick Links