Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

magneto

How to group primitives by comparison?

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? :)

Share this post


Link to post
Share on other sites

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 person likes this

Share this post


Link to post
Share on other sites

Thanks kgoossens, that's an interesting trick. I will give that a try :)

Share this post


Link to post
Share on other sites

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 by mantragora
2 people like this

Share this post


Link to post
Share on other sites

Thanks man, I will have to take some time to ingest it all.

Looks like you came to the grips with the HDK, NIIICE :)

Share this post


Link to post
Share on other sites

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 by mantragora
1 person likes this

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 by mantragora
1 person likes this

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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 by mantragora
1 person likes this

Share this post


Link to post
Share on other sites

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:

GUID-3756136E-CF58-4A11-930F-862D54B4B74B-low.png

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.

Share this post


Link to post
Share on other sites

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 wink.gif), you are really better if you find job in other industry. And it's true.

Edited by mantragora
1 person likes this

Share this post


Link to post
Share on other sites

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 :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now