Announcement

Collapse
No announcement yet.

MAXScript add or replace extension during filesave

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

  • MAXScript add or replace extension during filesave

    Hi all

    Using maxscript, I'm having the user type in the name of the vrimg file to save and then I'm setting that in the Raw Image save path etc.
    I'm not sure how to set the extension if the user does not type it. Also if the user types an extension, how can I ignore it and use a specific extension?

    Currently I have:

    Code:
        on test pressed do
            (
                f = getSaveFileName caption: "save A Test File:" \
                filename: "C:/_VRay RAW Renders/" \
                types:"V-Ray image files (*.vrimg)"
    
                if f!=undefined then
                    (
                        renderers.current.output_rawFileName = f
                    )
            )
    Kind Regards,
    Morne

  • #2
    this seems to work:
    Code:
    g = (getFilenamePath f) +  (getFilenameFile f) + (getFilenameType "*.vrimg")
    Kind Regards,
    Morne

    Comment


    • #3
      You forgot the | for GetSaveFileName

      So it would be this:

      Code:
      f = getSaveFileName caption:"Save a test file" filename:"C:/_VRay RAW Renders/" types:"V-Ray image files (*.vrimg)|*.vrimg"
      Colin Senner

      Comment


      • #4
        Originally posted by MoonDoggie View Post
        You forgot the | for GetSaveFileName

        So it would be this:

        Code:
        f = getSaveFileName caption:"Save a test file" filename:"C:/_VRay RAW Renders/" types:"V-Ray image files (*.vrimg)|*.vrimg"
        Aha, that's it. Thanks Colin that did the trick
        Kind Regards,
        Morne

        Comment

        Working...
        X