Procedurally move / align objects in Lop

   1404   2   1
User Avatar
Member
21 posts
Joined: May 2015
Offline
Hi guys,

I'm learning Solaris and USD at the moment. Let's say I have a sphere and a box at origin. And I'd like to procedurally align the box next to the sphere.

In Sop, I can use transform with bbox expression. So what's the approach in Lop? bbox expression in transform seems no longer working. Thanks!
User Avatar
Member
1737 posts
Joined: May 2006
Offline
AFAIK there's no quick native lops equivalent.

That said here's two alternatives. One is to use a sopmodify, use whatever sops tricks you want, those changes will be propegated back to lops. Here I've used the labs align and distribute to put many boxes and spheres in a row, but you can play with the options to put them in a grid if you want.

The other options is to directly modify the transforms with vex. I've done a very brute force hack in this example, just setting the x position to the prims element number, but it works.

Both methods have pros and cons. Sops is good because you can use all your sops knowledge, but can get slow if need to process lots of things. Lops wrangles use a same-but-different syntax to sops vex, takes some getting used to, but performance scales better.

Attachments:
lops_align.hip (170.9 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
21 posts
Joined: May 2015
Offline
mestela
AFAIK there's no quick native lops equivalent.

That said here's two alternatives. One is to use a sopmodify, use whatever sops tricks you want, those changes will be propegated back to lops. Here I've used the labs align and distribute to put many boxes and spheres in a row, but you can play with the options to put them in a grid if you want.

The other options is to directly modify the transforms with vex. I've done a very brute force hack in this example, just setting the x position to the prims element number, but it works.

Both methods have pros and cons. Sops is good because you can use all your sops knowledge, but can get slow if need to process lots of things. Lops wrangles use a same-but-different syntax to sops vex, takes some getting used to, but performance scales better.

Hi Matt, thanks for your reply. This is very helpful as I'm reading cgwiki to learn USD and lop.
Much appreciated!
  • Quick Links