Home Technical Talk

Maxscript texture gathering

I'm making a quick script because we're going through a lot of old models and extracting parts of meshes to use in a model library.
HiddenDOSCommand ("xcopy " + oldtexturename + " " + newtexturename + " /E /D /Y") startpath:"C:\\" prompt:"Copying textures..." donotwait:false

I've got most of the script working except the part where I'm grabbing the old textures and copying them to a new folder. It's breaking because there are spaces in the folders which unfortunately I can't change.

I know you can put and extra set of quotation marks around the path to tell Dos to ignore the spaces but I can't figure out how to do that using variables? I'm probably overlooking something simple here but don't have a clue!

Replies

  • arshlevon
    Options
    Offline / Send Message
    arshlevon polycounter lvl 18
    dosent max do this already? the resource collector, under utilities.
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    to insert a double quote into a string you need to use a string literal, you probably allready know \n for end line. \" gives you a double quote

    so:
    x = "the following is in quotation marks: \"I am a quote\" "
  • eddybrown
    Options
    Offline / Send Message
    r_fletch_r wrote: »
    to insert a double quote into a string you need to use a string literal, you probably allready know \n for end line. \" gives you a double quote

    so:
    x = "the following is in quotation marks: \"I am a quote\" "

    Thanks that's perfect!

    We could use the resource collector but I'm trying to automate the process so we can select an object to send to the library and run the script. It would then prompts you where to save the new library object and creates a new max file, collapses and condenses any multi materials and then copies over the textures.
Sign In or Register to comment.