Script to find the dimensions of an image

Is this even possible?

Browse to a folder, find the one jpg image inside the folder, and set the render output size to match the photo dimensions.

Then assign that jpg image to material slot #23 and # 24.

Thanks

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
scottparris's picture

Thank you! Works perfectly.

Thank you! Works perfectly.

scottparris's picture

That's awesome! Thank you,

That's awesome!

Thank you, but is there any way to assign the jpg as a bitmap texture and not assigned to the diffuse slot inside a standard material? I'm using the bitmap as an environment background and not a scene material.

Thank you!

miauu's picture

.

Run the script.
Select the jpg file.

(
	jpgFilePath = getOpenFileName types:"JPG(*.jpg)|*.jpg|All|*.*|"
	jpgInfo = getBitmapInfo jpgFilePath
 
	renderWidth = jpgInfo[3]
	renderHeight = jpgInfo[4]
 
	mat = standard diffuseMap:(Bitmaptexture fileName:jpgFilePath) showInViewport:true
	meditmaterials[23] = meditmaterials[24] = mat
)
barigazy's picture

...

Yes U can

meditmaterials[23] = meditmaterials[24] = environmentmap = (Bitmaptexture fileName:jpgFilePath)

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.