Announcement

Collapse
No announcement yet.

Simple change to the export vrmesh

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

  • Simple change to the export vrmesh

    Hey Vlado,
    One simple change request... In MaxScript, when I execute the vrayMeshExport command, I would prefer it to return a handle to the new vrmesh object instead of "OK". Right now, I have to iterate through all scene objects looking for vrmeshes and make assumptions based on object name as to which one was just created. As a lower priority, it would also be nice to also be able to optionally supply a name for the newly created object.

    Thanks!!!

    -Ray
    =======================
    Ray Collett - Design Visualization Specialist
    WSP USA - Visualization and Data Intelligence
    Visualization & Data Intelligence Portfolio (vizportfolio.com)
    =======================

  • #2
    good idea, was about to post the same request..! and also the option to supply a node instead of using the current selection..!

    simple workaround script (raw 5 minute version ):

    ----------------------------------------------

    fn vraymeshexport2 meshFile2: =
    (
    foo_material=selection[1].material
    foo_name=selection[1].name
    foo_wire=selection[1].wirecolor
    centerpivot proxyobject
    foo_pos=selection[1].pos

    vrayMeshExport meshFile:meshFile2 autoCreateProxies:false

    new_proxy=VrayProxy name: ("VrayProxy_"+foo_name) material:foo_material filename:meshFile2 wirecolor:foo_wire
    centerpivot new_proxy
    new_proxy.pos=foo_pos
    delete selection[1]

    return new_proxy
    )

    new_proxies=#()
    for m in objs do
    (
    select m
    append new_proxies (vraymeshexport2 m meshfile2: ("proxypath"+m.name) )
    )

    ----------------------------------------------------

    basicly a second function to do a meshexport without creating the proxy itself. function creates own proxy, and copies relevant settings (name, material, position etc) to it. then deletes the original mesh and returns the new proxyobject.

    the position part might be buggy, i did not test it very well.

    Comment


    • #3
      That would be quite helpful! theres a few workarounds but nothing thats great.

      I do the same, but you have to take into account for collapsed materials also, ie: if you vraymesh multiple objects with separate materials into 1 object, the creation of the multisub material isn't taken into account with the separated way, so i added a collapse step to the above before storing the material

      something sort of like

      Code:
      	fn convertSelectedToVrmesh =
      	(
                      --filename crap set while importing the asset in another script
      		fnameNoType=getFilenameFile file
      		fpath = getFilenamePath file
      		uncfpath = pathConfig.convertPathToUnc fpath
      		
      		--req: Struct_RelinkBitmaps.ms a set of funcs to search a library tree for maps associated with the selection objects..
      		RelinkBitmaps.selectedOnly=true
      		RelinkBitmaps.logging=true
      		RelinkBitmaps.pathsToSearch=#(uncfpath)
      		RelinkBitmaps.Run()
      
      		collapseSelected()
                      --pretty much an if selection.count >1 then meshop.attach with condensemat:true
      
      		postCollapseMat=selection[1].material
      		vrmeshfile = uncfpath+"\\"+fnameNoType+".vrmesh"
      		vrayMeshExport meshFile:vrmeshfile autoCreateProxies:false exportMultiple:false animation:off
      		proxyObj = vrayProxy()
      		proxyObj.filename = vrmeshfile
      		proxyObj.name=(fnameNoType+"_")
      		proxyObj.material = postCollapseMat
      		proxyObj.material.name = (fnameNoType+"_Mat")		
      		
      		delete selection
      		select proxyObj
      	),
      i don't think i dealt with the position stuff as i have the user set the position after the fact

      (Ray, I'd love to hear about what you're building, We had met at DMVC in boston sitting at the same table for a while~)
      Dave Buchhofer. // Vsaiwrk

      Comment


      • #4
        Thanks for the suggestion guys, I've logged them as feature requests.

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

        Comment

        Working...
        X