Home Technical Talk

Scene Crop?

polycounter lvl 11
Offline / Send Message
leechdemon polycounter lvl 11
I'm working with some data from a customer which contains a strip of road that is 25 Miles long. I'm working on the entire road in a single file, but when I export it I only want to look at a small section at a time; say a quarter mile. The file has multiple objects and props in it, otherwise I'd just ProBoolean-Intersect the chunk I want to export; when I try that with multiple objects, I just get the intersection of the result and the next object, and eventually I'm left with nothing. I tried to script doing a union of everything, then intersecting in the end, but it keeps giving me errors.

I basically want something like a Clipping Mask in Illustrator, only for geometry. Is there an easy way to do this?

Replies

  • Eric Chadwick
    Export to what, from what? Sounds like you're in Max. Geographic data is often a triangle soup, not easy to boolean or deal with in an automated way.

    You might be able to script a method of selecting a chunk of faces with a Volume Select, detaching to a new object, then moving the gizmo another X units, and repeating. Then maybe you could use Export Selected to isolate the chunks.
  • leechdemon
    Offline / Send Message
    leechdemon polycounter lvl 11
    Sorry, I usually put "in max..." at the front of the question. forgot. >_< From max, to FBX. Or anything, really, but FBX is where I'm going, currently.

    I'm using Export Selected currently, but the entire road section is a single piece... basically, I've got the concrete, the jersey barrier, the grassy berms, the terrain... and the whole thing is 8 objects.

    I'll play with Volume Select... a rough setup seems to be doing something useful. ProBoolean was just taking FOREVER, and was hugely buggy. This is much faster, maybe I can script something out of it. Thanks for the point!
  • leechdemon
    Offline / Send Message
    leechdemon polycounter lvl 11
    Hey, I got it!
    Undo On
    (
    modPanel.addModToSelection (VolumeSelect())
    ThisSet = (Selection as Array)
    Select ThisSet [1]
    $.Vol__select.level = 2
    $.Vol__Select.type = 1
    $.Vol__Select.volume = 3
    $.Vol__Select.node = $CropArea

    select ThisSet
    for obj in ThisSet do
    (
    converttopoly obj
    DetachList = polyop.getfaceselection obj
    polyop.detachFaces obj DetachList asNode: true name: ("CropArea_" + obj.name)
    )
    ThisSet = $CropArea_*
    for obj in ThisSet do ConvertToMesh $
    Select ThisSet
    exportFile "C:\Documents and Settings\Jason\Desktop\\test.fbx" #noprompt selectedOnly:true
    )
    Max undo
    Took some playing around with, but it works like a charm. Even got it to undo the changes once it was done, so it's non-destructive. Thanks!
  • Eric Chadwick
Sign In or Register to comment.