Hi!
I've got a tree with 150 000 leaves. I need to pack them while placing their pivot points at the root of each leaves. I can do it with a for-each loop that places the root at the origin, packs it (with the Pack sop) and moves it back to its original position. This works but it's mega slow in the viewport.
...yet, when I use the Assemble sop (without the for-each loop), I get the same amount of packed primitives but it's not laggy in the viewport. What's the technical difference?
Assemble vs Pack per connectivity: super slow!
1256 9 1- olivierth
- Member
- 1010 posts
- Joined: April 2017
- Offline
- raincole
- Member
- 447 posts
- Joined: Aug. 2019
- Offline
- tamte
- Member
- 8573 posts
- Joined: July 2007
- Online
olivierthSounds like you may be creating unique Packed Geometry primitives while Assemble by default produces Packed Fragments primitives which is more optimized way to pack unique pieces
What's the technical difference?
Also if your leaves are the same topology and shape you may want to instance them rather than keeping each unique
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- olivierth
- Member
- 1010 posts
- Joined: April 2017
- Offline
- npetit
- Staff
- 360 posts
- Joined: Feb. 2008
- Offline
- tamte
- Member
- 8573 posts
- Joined: July 2007
- Online
npetithow would you make sure that the resulting instances have pivot at the correct place?
If your leaves are all a single piece of geo to start with, you may want to try the Find Instances SOP in H20.0
I assume that you should be able to plug in custom clean packed prototypes to second input, however I was not able to make it work yet
Edited by tamte - Nov. 30, 2023 16:23:19
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- npetit
- Staff
- 360 posts
- Joined: Feb. 2008
- Offline
At the moment when packing the prototypes which get instanced onto the extracted points, the pivot location isn't promoted and is set to "Centroid" by default. I'll add that as an option.
Replacing a prototype however should be pretty simple. You can either replace the prototype entirely or unpack the prototype, offset it to place the desired pivot at the world origin, repack it and set the pivot location to "Origin" and reset the transform (apply the inverse transform of whatever transform you did to set the desired pivot before packing).
Here's an example.
Replacing a prototype however should be pretty simple. You can either replace the prototype entirely or unpack the prototype, offset it to place the desired pivot at the world origin, repack it and set the pivot location to "Origin" and reset the transform (apply the inverse transform of whatever transform you did to set the desired pivot before packing).
Here's an example.
- tamte
- Member
- 8573 posts
- Joined: July 2007
- Online
thanks Nick, I was trying to use Packed primitives in Prototypes input
in your example the geometry is unpacked, which seems to create a lot of ambiguity especially if we need multiple prototypes
I think it would be the most convenient if we could provide custom prototypes as already packed primitives with correct pivot etc.
and the node would just use those as they are to replace any geo that matches
that would also ensure that each prototype can have completely different attributes packed inside without any cross-contamination, which is inevitable if they are unpacked
in your example the geometry is unpacked, which seems to create a lot of ambiguity especially if we need multiple prototypes
I think it would be the most convenient if we could provide custom prototypes as already packed primitives with correct pivot etc.
and the node would just use those as they are to replace any geo that matches
that would also ensure that each prototype can have completely different attributes packed inside without any cross-contamination, which is inevitable if they are unpacked
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- npetit
- Staff
- 360 posts
- Joined: Feb. 2008
- Offline
- npetit
- Staff
- 360 posts
- Joined: Feb. 2008
- Offline
Tomorrow's build has packing options for the prototypes (create packed fragments and pivot location) as well as supporting user supplied prototypes as packed geo.
The comparisons still happen using the unpacked prototypes, however attributes that are not used for the comparisons are sanitized beforehand to avoid attrib pollution.
The comparisons still happen using the unpacked prototypes, however attributes that are not used for the comparisons are sanitized beforehand to avoid attrib pollution.
-
- Quick Links