Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

Maxscript question - weird request/idea
show user profile  Dr. Jim
So I've got a scene. It is a curved cyc studio enviro with a spotlight that projects a bitmap onto it.
I render that still and use it as a BG in After Effects as part of a larger project.

I have a lot of these stills to do and I wonder if there is a way to automate it?

1 Point to folder of Jpegs (all same size/aspect already. Prepped and identical)
2 Max loads image (or next image) into the material bitmap slot for the "SPOTLIGHT MATERIAL"
3 Max RENDERS a frame
4 Go to step 2 and repeat until all images in folder have been done

(Not sure if images would need naming convention with sequential numbers? not ideal.....or if it could just "do all images in a folder until done")

Thoughts?

Thanks!

read 283 times
6/23/2016 12:18:46 PM (last edit: 6/23/2016 12:18:46 PM)
show user profile  ScotlandDave
Do you mean, assign the image to a spotlights Projector Map slot?


Website | Blog | Contact | Vimeo

read 266 times
6/23/2016 12:54:55 PM (last edit: 6/23/2016 12:54:55 PM)
show user profile  ScotlandDave
I've been doing quite a lot of Maxscript for a job recently so had a bash at this:


It loops through the jpg files in the 'imageFolder' path and renders to the 'outputFolder' path using the filename "BG_sourcefilename.jpg".


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

fn doIt =
(

        imageFolder = "C:\Users\MyWorkstation\Desktop\images"
        outputFolder = "C:\Users\MyWorkstation\Desktop\\renders"
        
        -- Make Sure the Selected Object is a Spot Light

        if ( (findstring (classof $ as string) "spot") != undefined ) then
        (

                -- Step Through All JPG Files in Folder

                for filename in (getFiles (imageFolder+"\\*.jpg")) do
                (
                        
                        -- Assign the Motherfucker

                        $.projectorMap = Bitmaptexture fileName:filename
                        
                        -- Set New Output Filename for Render

                        renderFileName = getFilenameFile filename

                        rendOutputFilename = outputFolder+"\BG_"+renderFileName+".jpg"
                        
                        -- Render To File

                        render outputfile:rendOutputFilename

                )
        )
)

doIt()

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


Maxcript file here

Website | Blog | Contact | Vimeo

read 260 times
6/23/2016 1:55:54 PM (last edit: 6/23/2016 2:03:15 PM)
show user profile  Dr. Jim
SD - yes!
That is what I mean....I basically have a MAP in a material slot that is instanced to the spot light bitmap projection field. SO yes.

Awesome bro.....let me take a look at this....sounds like it would do exactly what I want.

Thank you!
read 244 times
6/23/2016 3:59:12 PM (last edit: 6/23/2016 3:59:12 PM)
show user profile  Dr. Jim
Also SD.....I am curious if Motherfucker is a function name? or a variable?
Oh wait....it's a comment! Got it.
read 243 times
6/23/2016 4:00:20 PM (last edit: 6/23/2016 4:00:20 PM)
show user profile  soontekk
thats right biaaatschj
:o

melting ur brainz!
/ FOS4 / FO2 / Blurb / Twitter / Facebook / Vimeo /


read 238 times
6/23/2016 4:22:56 PM (last edit: 6/23/2016 4:22:56 PM)
show user profile  ScotlandDave
Yeah motherfucker is coders shorthand for 'thing in question', applies in almost any situation..


Website | Blog | Contact | Vimeo

read 231 times
6/23/2016 6:55:55 PM (last edit: 6/23/2016 6:55:55 PM)
#Maxforums IRC
Open chat window


Support Maxforums.org