Announcement

Collapse
No announcement yet.

script access to "Import as mesh"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • script access to "Import as mesh"

    Hi,
    I wondered if there's access to the "Import as mesh" function of a vrmesh object by maxscript? I can access all the properties, but don't know how to perform that specific function.

  • #2
    Anyone? Or just confirmation if it doesn't exist?
    Maybe someone has other suggestions to either import many proxies into max (import as mesh that is, the proxy-objects already exist) or optimize the meshes within the vrayproxy-files. I'm dealing with a lidar-scan which i've split up in smaller tiles (about 200k faces each) and converted to obj-files. Then I use the ply2vrmesh commandline tool to convert the obj-files to vrmeshes, which it does with incredible speed. After that I can import the 4000 tiles as vrayproxies. This works fine but renders rather slowly when the entire terrain is visible. That's about 500 bln points. These meshes can be reduced to about 10% of their original size. So I'd like to optimize them.
    Does anyone have a suggestion to go about this? Keep in mind that we're dealing with 4000 files.
    thanks.

    Comment


    • #3
      There is currently no way to invoke this function from MaxScript, but I've made a note to add it.

      Best regards,
      Vlado
      I only act like I know everything, Rogers.

      Comment


      • #4
        Why don't you optimize the .obj files and convert them to vrmesh afterwards?

        Comment


        • #5
          Here's a script to optimize an .OBJ folder:
          Code:
          if checkForSave() do (
              undo off (    
                  inPath = @"e:\3D\Proves\OptFolder\OBJ Files\"
                  outPath = @"e:\3D\Proves\OptFolder\OBJ Files - Optimized\"
          
                  resetMaxFile #noPrompt 
                  
                  for o in getFiles (inPath + @"*.obj") do (
                      importFile o #noPrompt
                      for p in geometry do meshop.optimize p 4.0 1.0 0.1 0.0 autoEdge:false
                      exportFile (outPath + (filenameFromPath  o)) #noPrompt
                      max select all
                      delete selection
                  )
              )    
          )
          change inPath and outPath according to your needs, you can adjust optimize options changing the values on this line:
          Code:
          meshop.optimize obj 4.0 1.0 0.1 0.0 autoEdge:false
          Face Threshold (4.0), Edge Threshold (1.0), Bias(0.1) and Max Edge Length (0.0) respectively.

          Comment


          • #6
            Hi Codi,
            thanks for the elaborate reply. Indeed I can just optimize within max, but that takes a lot of time. I've made a similar script which uses an optimize-modifier. I didn't know you could call an optimize method directly on the mesh. Looks more efficient.
            The beauty with these commandline tools is that usually they're pretty fast. Importing and optimizing 4000 obj's is quite time consuming. Besides that, after i've created and optimized all meshes and converted them to vrmeshes, it would be very convenient to just be able to select a bunch, import their meshes and edit them. A scriptable "import as mesh" function would come in handy. For the moment your suggestion is the next best thing. Thanks!

            Klaas

            Comment


            • #7
              You are welcome, now I see why you'd prefer to optimize the vrmeshes directly.

              Well, hope it helps anyway

              Comment


              • #8
                I just found a nice tool within max 2010. I've been using the proOptimizer modifier because I like the quality of the meshes. I can optimize to about 12% of the original size with adequate quality. So I'd import an obj, apply the modifier, collapse it. there's already a utility built into max which does this, on max-files and obj-files directly. It even saves back to obj. It's called "Batch proOptimizer". It's running now, not necessarily faster, but definitely more convenient than my own script. Just wanted to let you know.
                Klaas

                Comment


                • #9
                  Cool, didn't know about that

                  Comment

                  Working...
                  X