Forum Groups
  All forums
    Help & Feedback
      Work in progress
      Finished Art
      Non-Max related

Maxunderground news unavailable

maxscript - select objects in viewport
show user profile  digs
Im trying to select all objects within an active viewport

ie, you have a scene set up with objects scattered all around... go into any given camera and "select all objects within view"

any ideas? I fell like this should be a simple thing

read 358 times
6/11/2016 7:08:03 PM (last edit: 6/11/2016 7:08:03 PM)
show user profile  ccampbell
Check out Jeff's response (6th down) for a possible solution.

$Entrepreneur = if((Designer + Engineer)*Programmer){Problem Solver};

read 326 times
6/13/2016 8:24:55 AM (last edit: 6/13/2016 8:24:55 AM)
show user profile  digs
thanks ccampbell

guess its tougher than i though
read 320 times
6/13/2016 3:03:24 PM (last edit: 6/13/2016 3:03:24 PM)
show user profile  Garp
There are many things to consider: object/subobject level, camera/perspective/other viewport, window/crossing marquee selection, modifier(s) apply to the camera (like Skew), etc.
This would lead to code with lots of tests and loops, pretty slow and likely to be buggy.

Thinking out of the box, I'd say it would be much simpler to use the Windows API through maxscript's dotNET binding to simulate a marquee selection using the current settings.
Inside a macro:
- save the cursor's current screen position,
- get the active viewport's upper left and bottom right corners,
- generate click-drag-release mouse events (winAPI's SendInput),
- restore the cursor's position.
The code should be short and easy to get right.

read 316 times
6/13/2016 7:10:00 PM (last edit: 6/13/2016 7:10:11 PM)
show user profile  digs
haha, very clever..

I guess now that i think about it it is a bit more complicated, ie - if we are in a room with a window, objects that are behind a wall but not visible should not be selected, if u can see an object through a window (or opening), it should be selected, etc. basically we select visible objects in a camera for LPM setup

I will come back to this when I have more time, but in the meantime, thanks!
read 306 times
6/14/2016 3:50:33 AM (last edit: 6/14/2016 3:50:44 AM)
show user profile  digs
so we're still talking about this at work... question

how feasible would it be to use the cameras frustum as a sort of volume select 'area of effect'?

read 291 times
6/15/2016 4:01:25 PM (last edit: 6/15/2016 4:01:25 PM)
show user profile  FX
This any good ?

CameraFaceCounter 0.2 BETA

I used it years ago when making F1 tracks to count polys in view.
read 288 times
6/15/2016 4:08:08 PM (last edit: 6/15/2016 4:08:08 PM)
#Maxforums IRC
Open chat window