mestela
May 19, 2020 07:11:41
I can see that I can manually delete instances with a modify point instances lop. Select stuff, turn on the ‘prune’ option, they delete.
I can also see that I can procedurally move instances by enabling ‘edit transform’, set the prims to /instancer1, set source to ‘internal sop’, move things inside the sop network, they move.
I can't see a way to procedurally delete instances. If I blast things in the sop network, they re-appear when I get back to lops. I tried using a collection lop to grab instances in a bounding box, but it doesn't appear to select anything. Had a peek in the hda, can see that the deletion stuff is separate from the transform stuff, but didn't delve much deeper than that, as I figure there must be an easier way I'm missing.
To be clear, this is about editing an existing instancer. Can't go the lazy way and edit at the source, these might be instancers setup earlier in the pipe, or from another app.
-matt
jsmack
May 19, 2020 13:53:23
If it's a point instancer, can you edit the points[]
et al arrays using an attribute vop/wrangle?
Hamilton Meathouse
March 30, 2021 21:54:31
The following worked for me, but wasn't exactly as procedural as I'd like.
Modify Point Instances LOP, and in the Point Instances field, put
`lopinputprims('.', 0)`[0-100]
Tim Crowson
April 7, 2021 22:26:23
I'm curious about this too. Specifically, I'm interested in leveraging camera frustum bounds (e.g. %bound:/camera/mycamera
) to remove point instances outside my field of view.
npetit
April 12, 2021 19:00:29
If you select "Internal SOP" as the method for pruning, dive in and delete the instances you want to be deleted or use a visibility SOP to hide the instances you want to be hidden.
Please let me know if that doesn't work for you.
Tim Crowson
April 12, 2021 20:00:56
Thanks, I'll give that a shot.
Dan_Andersen
May 25, 2021 04:14:35
Matt, I'm curious - what solution did you end up going with?
Cheers,
Dan
mestela
May 25, 2021 08:17:33
I don't remember! Eep!
Dan_Andersen
May 25, 2021 15:02:20
Ok, no worries
And, to make my comments not completely superfluous, we ended up hiding the points like this, which works for our needs (vex credit goes to a coworker):
int nums = usd_attriblen(0, @primpath, "positions");
int invisible[];
resize(invisible, nums);
for (int i = 0; i < nums; ++i){
if (rand(i + ch("seed")) < ch("prune_amt"))
invisible[i] = i;
else
invisible[i] = -1;
}
for (int i = nums-1; i >= 0; --i){
if (invisible[i] == -1) removeindex(invisible, i);
}
i[]@invisibleIds = invisible;
Tim Crowson
Aug. 14, 2021 17:51:31
Revisiting this now. I wanted to try using the Internal SOP to delete points outside camera frustum, but I'm not quite wrapping my head around it. Anyone have an example file maybe?
npetit
Aug. 21, 2021 22:47:37
Hi Tim,
here's a quick example to get you going. If you dive inside the modify point instancers LOP you can toggle the switch between 0 to delete the instances outside the camera frustrum or 1 to hide them.
Hope that helps!
Tim Crowson
Aug. 30, 2021 21:56:23
That's a super helpful example! Thank you!
Tim Crowson
Sept. 1, 2021 11:22:00
I'm sure there is a simple adjustment I can make to fix this, but it's eluding me.... If I switch to operating on Points rather than Primitives and place the camera "in" the point cloud, the camuv bounds seem to extend past the back of the camera. How can I correct this to cull points behind the camera?
EDIT: Nevermind, I got it... just had to add @camuv.z>0 to the group list in my blast node.
Tim Crowson
Sept. 1, 2021 11:45:27
Sorry to triple post, but I consistently get this warning with the ModifyPointInstances LOP, whether I'm working in the test scene provided above, or in a new scene entirely. Using 18.5.596. The node works, but keeps throwing this warning.
jsmack
Sept. 1, 2021 11:48:48
Tim Crowson
The node works, but keeps throwing this warning.
The warnings look like version synchronization warnings. The file above was saved with version 18.5.672
The file gives me an idea for an RFE though. Could we get a usd/lops camera signature for toNDC/fromNDC?
Tim Crowson
Sept. 1, 2021 11:49:51
Right, but I get this warning in a new scene built from scratch, with my local version.
jsmack
Sept. 1, 2021 11:58:37
Tim Crowson
Right, but I get this warning in a new scene built from scratch, with my local version.
I don't have 596 installed, so I don't know if that's normal or not.
Edit:
I see it if I 'match definition' of the modify point instances node after unlocking. You can ignore it. I think it means the node was probably created in an earlier version of Houdini, and the nodes inside have changed since it was created.
Tim Crowson
Sept. 1, 2021 21:57:43
Thanks, I logged a bug for this.
npetit
Sept. 2, 2021 01:44:13
Hi Tim,
Build 18.5.680 should address this issue, as well as adding support for duplicating instances.
Tim Crowson
Sept. 2, 2021 01:59:58
Nice, thanks so much!