Announcement

Collapse
No announcement yet.

Multisubtex load multiple files

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

  • Multisubtex load multiple files

    Not a big deal or anything, but the ability to load a folder or multiple files at once into the multisubtex might be cool. Found myself loading in 80 textures 1 by 1 and I thought it might be nice.

    (Loving 3.3 anyways, very awesome work here.)

  • #2
    Vizpark crossmaps
    Mstan
    3LP Team

    Comment


    • #3
      Originally posted by Deflaminis View Post
      Not a big deal or anything, but the ability to load a folder or multiple files at once into the multisubtex might be cool. Found myself loading in 80 textures 1 by 1 and I thought it might be nice.
      It is doable... that would create the respective Bitmap or VRayHDRI textures and assign the files from the folder to these?

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

      Comment


      • #4
        Here's a really quick sketch:

        Code:
        theDialog = dotNetObject "System.Windows.Forms.OpenFileDialog" --create a OpenFileDialog
        theDialog.title = "PLEASE Select One Or More Files" --set the title
        theDialog.Multiselect = true --allow multiple files to be selected
        theDialog.Filter = "All Files (*.*)|*.*" --specify the filter
        -- theDialog.FilterIndex = 2 --set the filter drop-down list to All Files
        result = theDialog.showDialog() --display the dialog, get result into variable
        result.ToString() --when closed, convert the result to string
        result.Equals result.OK --returns TRUE if OK was pressed, FALSE otherwise
        result.Equals result.Cancel --returns TRUE if Cancel was pressed, FALSE otherwise
        theFilenames = theDialog.fileNames --the selected filenames will be returned as an array
        
        if (result.Equals result.OK) then 
        (
        	print "files were picked:"
        	print theFilenames
        ) else (
        	print "bugger off"
        )
        
        theMap = VRayMultiSubTex texmap_num:theFilenames.count
        
        for i = 1 to (theFilenames.count) do
        (
        	print i
        	theMap.texmap[i] = VRayHDRI HDRIMapName:theFilenames[i]
        )
        
        setMeditMaterial activeMeditSlot theMap
        If you drag and drop this code onto a toolbar, open your material editor and pick a slot that you want your multisubtex to go into - bear in mind you'll be left with only the multisubtex in here so use a blank slot. It'll currently make a vray hdri loader for each bitmap, I'll tidy it up and add some options like random rotation, flipping and what type of gamma and filtering options you want for the hdri loaders. Currently the maxscript access doesn't work to set the number of maps in the texture so you've to set that manually yourself afterwards to clean it up if you use less than 20, I'll lodge a bug for that.

        Comment


        • #5
          You guys are amazing.

          Yes Vlado, I was thinking it might be neat to autoload up the textures by dragging a folder or a group of files onto the map. Or, however it works.

          JConnell, you the man. If I ever find myself in Dublin beers are on me.

          Comment


          • #6
            Better one here - http://forums.chaosgroup.com/showthr...iation-options

            Comment

            Working...
            X