How to group primitives by comparison?
Posted 01 July 2012 - 11:37 AM
Basically I have a geometry object where each primitive has an attribute called "area". I also have a primitive group that has a few primitives.
What I am trying to do is to go through all primitives and group ones that have the same area as the ones in my group.
Since these are primitives, I thought I can't use VOPs. I was thinking of foreach but then do I have to use 2 foreach nested inside one another? I know VEX has add to group, but outside it, not sure how I can add to an existing group continuously?
Any ideas on how to solve this problem?
Posted 01 July 2012 - 12:42 PM
- Charles Darwin
Posted 01 July 2012 - 01:27 PM
Posted 01 July 2012 - 03:10 PM
Template Group = your grouped primitives that you want to use as a template
Found Group Name = new group name to which add primitives if they are found
Attribute Name = attribute to use as comparision
In attached scene just replace red node with compiled version of this code. As group = "template", as found group name = "thesame" and as attribute = "area_clamped".
I haven't tested this to extensively so there may be some errors. But it should be enough to play with. There is also VOP way in the file too.
WATCH AND DOWNLOAD CODE ON VIMEO
Edited by mantragora, 23 October 2013 - 06:08 AM.
Posted 01 July 2012 - 03:18 PM
Looks like you came to the grips with the HDK, NIIICE
Posted 01 July 2012 - 03:29 PM
It's my second today . First was this LINK. I still don't know how to interact in viewport with HDK so I made selections with Python.
Got RF .bin exporter in works next. Hooking into Houdini with GEO_IOTranslator is really nice and easy. If only there was better documentation for it. There are so many functions that you really don't know why you should use them in some situations. More examples would be nice.
Edited by mantragora, 01 July 2012 - 03:43 PM.
Posted 01 July 2012 - 03:43 PM
Posted 01 July 2012 - 03:59 PM
While you are at it, you should also implement Edge Loops and Rings as operators
Posted 02 July 2012 - 08:27 AM
I cleaned code a little. Fixed crash problem, for "Attribute Name" and "Found Group Name" fields, if you specified more than one name and/or there is a space in the name. Now it will just report "wrong group"/"wrong attribute" error on the operator.
"Template Group" field can use more than one group, so you can for example add group with Area = 10, and second with Area = 20 and it will find prims just like if there was one template group specified.
I just updated code in this post.
WTF are Rings ?
Magneto. You are expert Max TD. I don't even work in 3d. It could put you in a bad light if some company looked here and found out that simple amateur implements tools for you. So I will leave it to you .
Edited by mantragora, 02 July 2012 - 11:30 AM.
Posted 02 July 2012 - 01:54 PM
Rings are basically series of opposing edges of adjacent quads. It's much useful to select rings than loops IMO.
You can see it here:
lol they wouldn't think that, they would think a pro getting help from another pro
Besides are you not trying to get into the industry? I certainly think you deserve to work if you aren't already.
Posted 02 July 2012 - 03:11 PM
Nope. I just started with SOP_BlindData example and wiped out every method and variable there that I didn't needed. I just made my own Template Solution for SOP. And the same for ROP and GEO.
After that I started first with figuring out different parameters, so I got one solution with parameters I used and found useful, like different menus, ramps, paths etc. and what flags I have to use to make them. Thats my Template solution for Parameters. There are some parameters things I haven't figured yet. If I will I will put it there. Next was how to build polygons. Than how to hook into Houdini and save data from it. And now how to get attributes and make groups.
I don't know any other way. VisualStudio "Visual Assist X" plugin is helpful. It's not on pair with C# Resharper but for C++ it's the best out there for VisualStudio..
I tried in couple places. In two I was recommended. No one wanted to hire me. I couldn't get even introductory job in my country. Half of the knowledge I got thru last couple years would be sufficient easily in any other industry to get really good paid job.
Besides, right now I'm to old and I'm doing this solely myself for too long to go and work in a group. And I'm also more interested in making things you will not find in this industry. Making effects for some shity films with bad scripts is not how I would like to spend my life anymore.
Like Macha said in some post I read here: If you are smart enough to learn Houdini and couple other things yourself (or something like this ), you are really better if you find job in other industry. And it's true.
Edited by mantragora, 23 October 2013 - 05:51 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users