magneto Posted July 1, 2012 Share Posted July 1, 2012 This seems like an interesting problem. 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? Quote Link to comment Share on other sites More sharing options...
kgoossens Posted July 1, 2012 Share Posted July 1, 2012 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? What about making unique primitives with a facet or fuse and promoting the area attrib to points? Then you could run this through a vopsop. 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted July 1, 2012 Author Share Posted July 1, 2012 Thanks kgoossens, that's an interesting trick. I will give that a try Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted July 1, 2012 Share Posted July 1, 2012 (edited) Small fun with HDK. 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 October 23, 2013 by mantragora 2 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted July 1, 2012 Author Share Posted July 1, 2012 Thanks man, I will have to take some time to ingest it all. Looks like you came to the grips with the HDK, NIIICE 1 Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted July 1, 2012 Share Posted July 1, 2012 (edited) I found one error. I create newPrmitive group even if you specify existing one. And I don't check if there are more than one group specified too. So it may break here if you add more than one name. Looks like you came to the grips with the HDK, NIIICE 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 July 1, 2012 by mantragora 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted July 1, 2012 Author Share Posted July 1, 2012 Dude that's amazing How do you get the edge selection in python? I am not sure how you pass the viewport selection into an operator. Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted July 1, 2012 Share Posted July 1, 2012 (edited) You don't have Edge Selections. It's Point selection. It just translates edges into points. Ordered. I got this in OnCreated part of DA. DOWNLOAD CODE Edited July 4, 2012 by mantragora 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted July 1, 2012 Author Share Posted July 1, 2012 Thanks man, that's what I was assuming. I just never transferred scene selections. Will try your code tomorrow. While you are at it, you should also implement Edge Loops and Rings as operators 1 Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted July 2, 2012 Share Posted July 2, 2012 (edited) Thanks man, that's what I was assuming. I just never transferred scene selections. Will try your code tomorrow. 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. While you are at it, you should also implement Edge Loops and Rings as operators 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 July 2, 2012 by mantragora 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted July 2, 2012 Author Share Posted July 2, 2012 Thanks man, I will try out your code. It looks good. Do you know if the HDK has a sample that has most common errors handled so you can use it as a template? I feel like there are a lot of checks that has to be done, would be good if they were available like wrong group name, invalid group name, etc. 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. 1 Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted July 2, 2012 Share Posted July 2, 2012 (edited) Thanks man, I will try out your code. It looks good. Do you know if the HDK has a sample that has most common errors handled so you can use it as a template? I feel like there are a lot of checks that has to be done, would be good if they were available like wrong group name, invalid group name, etc. 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.. Besides are you not trying to get into the industry? I certainly think you deserve to work if you aren't already. 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 October 23, 2013 by mantragora 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted July 3, 2012 Author Share Posted July 3, 2012 I will get into HDK too but I don't want to diverge too much from doing vfx right now, because I think HDK is not a simple undertaking. So I will leave when I am at a level in Houdini where I am content but want to step up the game If you are from a different country, it's certainly harder to get it if you were local. Even the most locals wouldn't agree, the visa issues are very real. But don't get discouraged. If you make a video showing everything you did, I am sure it would attract a lot of attention. There are a lot of ways you can extract money in this business IMO Why not make some tool development series for Houdini for sale. There aren't many resources right now, and this way not only you would be doing what you are doing now, but also make money. I agree with doing your own stuff though. No matter what company you are working for, nothing is better than living wherever you want, doing whatever you want just for fun, whether it's 3d or something else. No obligations just wild experiments 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.