Jump to content

Orient instanced geo thru the copy SOP


Recommended Posts

Hi all,

I've put together a pretty simple demo of what I'm trying to do. In the picture you'll see a top-down view of a wireframe grid and a bunch of instanced grids that were created using a popnet to copy SOP from the wireframe grid as it rotated around a pivot.

In a nutshell I want the instanced grids to inherit the master grid's orientation. Is there a way to do this *other* than sorting the points and using $TX2-$TX/$TY2-$TY/$TZ2-$TZ in a point SOP to set the normals? In this example I know it would work, but if the number of emitting faces is changing every frame then the points would be less orderly and not line up.

As always, any suggestions would be greatly appreciated!

Thanks!

post-6043-133964643015_thumb.jpg

orient_copiedGeo.hip

Edited by etudenc
Link to comment
Share on other sites

Hi all,

I've put together a pretty simple demo of what I'm trying to do. In the picture you'll see a top-down view of a wireframe grid and a bunch of instanced grids that were created using a popnet to copy SOP from the wireframe grid as it rotated around a pivot.

In a nutshell I want the instanced grids to inherit the master grid's orientation. Is there a way to do this *other* than sorting the points and using $TX2-$TX/$TY2-$TY/$TZ2-$TZ in a point SOP to set the normals? In this example I know it would work, but if the number of emitting faces is changing every frame then the points would be less orderly and not line up.

As always, any suggestions would be greatly appreciated!

Thanks!

Hi.

Do you mean copy, not instance?

Possible solution:

3ak_orient_copiedGeo.hip

Link to comment
Share on other sites

Thanks so much for the help, guys. I realize my example was too simple so I've made some adjustments.

This time the master grid is being moved along a path so I don't think I can query actual rotation values coming from the xform. I still want the copied geo to get its orientation from the face it's essentially being copied from.

Is there some way I could set the normal of a point based on where it was in the previous frame? Or is it possible to transfer the normal of the "emitting" primitive to the point inside the forEach?

Hope that's clearer. What I'm actually trying to do is lay down tire tracks from tires that were translated/rotated in Maya. I'm grouping faces on any tire tread that enters into the boundary of a cube, finding their centers and emitting particles to copy to, like what you see in the attached example.

Thanks again!

post-6043-133968501761_thumb.jpg

orient_copiedGeo.hip

Link to comment
Share on other sites

Something like this?

Thanks, yeah that's much closer. I tried a different solution by subtracting point 0's position from point 1's position on each primitive inside the forEach, then setting an "up" vector based on the result. An attrCopy SOP copies that normal back to the final fused point of each primitive that gets sent to the POP SOP (way easier to see in the file than to explain in words). For my purposes this seems to work better for cases where the number of "emitting" primitives changes from frame to frame.

Thanks for looking and for all the help, folks.

orient_copiedGeo2.hip

Link to comment
Share on other sites

How about not using particles at all but just using a sopsolver, like in this example.

Thanks for uploading the example. Haven't used the sop solver at all so between your file and the Peter Quint videos I should be better informed very soon. Thanks again!

Link to comment
Share on other sites

  • 3 weeks later...
...I still want the copied geo to get its orientation from the face it's essentially being copied from. ...

it there a reason why you don't precompute N and up values on your source mesh? then it will be transformed automatically with object merge

or

if you don't want to do that you can do something like this to get orientations of faces from arbitrary poly geo

also better way to detect center points of faces may be to use divide sop instead of forEach

orient_copiedGeo_to_faces.hip

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...