script to delete off-camera stuff?
This will probably be unsolvable except with a script. I'm so-so at understanding already written code, but unfortunately I can't make heads or tails of writing it from scratch (so I'm not much of a Developer, here *wince*). I don't know if this would be a lot of work or not, but I guess it doesn't hurt to ask.
I have a landscape full of instanced plants (TangoAlpha's Hemlock Folly, specifically), and I want to use it in Poser. I have Code66's wonderful "Instances to Objects" script, but I'd like to pare it down first.
1. My other questions will probably depend on this one: is there a way to delete any object that's not visible in the camera viewport? If I have a bunch of plants, and I don't need the ones off-camera for this one shot, can I find a good way to automate getting rid of them?
2. The next is more of what I'm looking at: what if the objects are instanced, but ungrouped?
3. What would be nice, but might be too much to ask for (?): what if the objects are instanced, and grouped (using the "Group Like Sibling Instances")?
I'm ignoring the problem of giant Ultrascatter groups at the moment, which this scene does have. I already spent probably more time than I should have dividing up the huge instance groups (involving a lot of cutting and re-pasting in a text editor X| ), to allow "Break Instance Group" to finish in my lifetime, which is why my second question is more relevant at this point. If I have to do it again for other projects, I'll live. So I'm just looking at nice, manageable, humanly-possible instance groups ATM. And if I have to de-instance them first, I can do that. Unless someone would like to ponder that problem (breaking giant instance groups) also/instead.
I was determined to get this done by hand (selecting what's onscreen, inverting, deleting what's left), but I've finally gotten to the groups where there's what looks like 500+ plants onscreen in the viewport. I'm not that patient. XD
Thank you in advance for any contemplating or coding that might happen. :) If it can't be done, I'll find something else to do. XD
Comments
This seems to be a product suggestion thread, rather than a thread on developing a script yourself, so I've moved it to that forum.
Well... I would have been interested to know, at least, if there's any snippets of script that deals with camera-to-object relationships. I didn't see anything remotely referring to that (as far as I can see/understand!) in the sample scripts. But I was hoping there was some kind of documentation I could read about it, somewhere?
For alternate solutions, if there was something that could automatically select everything in the viewport (and only in the viewport) en masse... Or if I could marquee select entire objects/nodes like you can with polys and vertices in the geometry editor, that would be great instead. Just about anything related to looking through a camera, deciding whether an object is in view or not, and doing something with it, or allowing me to do something with a bunch of things at a time, instead of dealing with props individually.
I wasn't imagining this as a product suggestion, because so many different things could work for this, and personally, at least, I don't care if it's messy and cobbled together and barely functional (as it is when I grab a bunch of script snippets I can understand and string them together) - it doesn't have to be all shiny and ready for the store. I mean, if there's enough demand for a utility that deletes off-camera nodes (or even just marks them somehow, so I can delete them myself), or selects a specific, but case-by-case set of nodes in a scene, or allows the user to select many at a time without endless clicking... and of course, all of this that might, hopefully, but not necessarily, work on instances... that's wonderful, but I wasn't sure that was in much demand.
Just to show you the file I'm looking at right now (below, plants changed to spheres just so I can see/click them better):
There's 5,378 plants in this file, and I've pooped out after marking maybe 500 of the ones in the viewport. It looks like it's only about half of the on-camera group. o.0 I could certainly get by without all of the on-camera ones, but I already know I won't need any of the off-camera ones, and it'd be nice to get them out of my scene tab before I worry about what I can see.
Hmm... I don't own Ultrascatter now, but I may pick it up if it's ever on sale. I do have some scattering scripts though, both for DS and Poser. They're not as sophisticated, but they'd work well enough for this. The vendor included the distribution maps. That might work...! I'll try it out. Hey, thanks for the suggestion, good idea!
mCasual has a cool script that will hide everything in the scene except the objects you've selected.
that plus the node selection tool might do what you're asking for pretty handily.
not sure how the script handles instances, though.
j
Wow, I looked over his stuff and didn't see that. It doesn't seem to work on instances (bummer) but still pretty handy for this kind of thing if I use the "Instances to Objects" script. Thanks for the tip!