Jump to content

Silly question about the Group and Duplicate OPs


Recommended Posts

I am new at Houdini but I am betting once you read my nifty and straightforward description you'll be able to point me in the right direction.

Essentially I have created a tower of duplicated NURBS Circles. That works fine. What I want to do now though is to have this other geometry SOP, let's pretend its a sphere, and I want to duplicate that Sphere and have it driven by the duplication of the circles. I can easily link the $CN variable so that when I increase the duplication of the Circles the Spheres duplicate and transform in Y along with it.

However, how can I create an expression or relationship so that if I individually do an edit on an arbitrary NURBS Circle in the group the same numbered sphere will translate with it? Is there a way to express a parenting of the Circle over the Spheres?

Example, I do an edit and then select the 5th duplicated NURBS Circle and translate it in X. I want the 5th duplicated Sphere to translate with it.

Hope this makes sense :)

Link to comment
Share on other sites

Not so straightforward is this question is. I would rather you translate with attributes but first for a hacky solution.

You will have to calculate your own local bounding box if you want your approach to stay the same. The distance() function fits nicely. I assume you have two separate chains side by side, one with default poly circles (10 points) and whatever spheres. Append a primitive SOP to the spheres and try these expressions in Scale X Y Z:

2*distance(point("../add1",0+$PR*10,"P",0),0,0,point("../add1",5+$PR*10,"P",0),0,0)
(ch(sx)+ch(sz))/2
2*distance(0,0,point("../add1",2+$PR*10,"P",2),0,0,point("../add1",7+$PR*10,"P",2))

This obviously ties you down to the point numbers of the circle but works just dandy. Note the $PR indexing which gets you the correct behaviour. You can scale the circles non-uniformly and the spheres scale appropriately. I am not taking in to consideration arbitrary translations, rotates and scales in combination though.

A second approach would be not to directly scale the primitives but to use attributes to scale the first series of circles and inherit those attributes directly with a prim function. Now if there was an easy way to affect prim attributes. I just locked one of the sops and edited the attributes directly in the spreadsheet.

See this attached hip file for both methods (Houdini6).

prim_ref_scale.hip.zip

Link to comment
Share on other sites

old school, thanks for the advice, I will give your two solutions a go in a bit.

Sorry to confuse this thread but having two Houdini forums messed me up, I wasn't sure where to post stuff.

I just wanted to add that the suggestion made by cpb over at the sidefx forum did work, which of the 3 techniques do you think is best? I am a neophyte at this so I am trying to understand why one way is preferred over the other.

Also, I just wanted to add one other spin on this that I forgot to mention in the original thread. Once I have gotten the spheres to increase and translate as I do the same with the circles, I want to have the spheres tranlsated a little outwards from the center and then progressively rotate around the stack of circles, sort of like a staircase. I couldn't figure out a way to do that with cbp's technique, I must be missing something.

Link to comment
Share on other sites

old school, i went through your two techniques.. i'm not really clear though what they provide that is better than the technique described by bcp? i guess because i'm new at houdini and the copy/template technique described by bcp ( http://www.sidefx.com/forum/viewtopic.php?t=1231 ) since it seems more straightforward i am hoping to understand the benefits of your methods.

thanks a lot for taking the time..

Link to comment
Share on other sites

Actually now that I go through your second technique a little closer I see why it is preferred over the Copy SOP.. Still working with it, thanks for getting me started though..

I do see what you mean about there not being any nice way to edit the primitive attributes..

Link to comment
Share on other sites

Jeff and cpb, I am still having trouble tying this all together.

I just wanted to clarify what it is I am trying to do here, hopefully you'll be kind enough to try one more time to explain this.

I am not interested in scaling at all, just dupe/copy and translation. I am basically trying to create a poll using a skin on a bunch of NURBS Circles. At the same time I want to have an equal number of NURBS Spheres (or whatever really) that are spiralling up and around the poll.

Additionally, I want to create a binding so that when one of the profile circles is translated, both the skin is affected as well as the appropriate NURBS Sphere, i.e., if I translate the 4th duplicated profile circle, the skin should change as well as 4th duped NURBS Sphere.

Make sense right?

I can currently do this no problem using the 2nd technique that Jeff described (driving the primitives with the attribute) but the problem is the Skin, once Jeff's nodes use the primitive I can't seem to use the Skin anymore. If I put the Skin in before hand then it doesn't get effected by the translation of the profile Circles.

With cpb's solution I am able to get the skinning and the "bound" translation to work, however I cannot for the life of me get the NURBS Spheres to rotate in a spiral fashion up and around the skinned poll.

So I feel like I'm almost there with both of those techniques but each is missing that final part. Maybe I don't know enough SOPs yet to figure it out, surely there's a way to get a skinning done even after a primitive node in the network. And likewise there must be a way in cpb's technique to get the proper spiral rotation.

I can't figure it out however. Btw, I agree that the first hack solution that Jeff provided is not the best way so I haven't been experimenting with it.

Anyway, hopefully I haven't annoyed everyone with this one, I'm sure its obvious to the pros here.

Link to comment
Share on other sites

Thank you very much, despite solving my problem I have a learned a lot from your file. I am new at this so these concepts seem really unreal at times and it never occurred to me I could do things the way you did them.

Much thanks again, this will go a long way in helping me understand Houdini in the future!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...