Jump to content

Images As Planes (Mantra & Redshift Supported)

Recommended Posts

Hi All,

I have written a short script that is similar to the Blender script with the same name. Basically it will scan a folder looking for files with a specific file extension. If the file is located it will create a UV mapped grid and a material linked to each file in the folder. This is just a quick way to import a bunch of images into your scene as planes. The image size detection code only supports JPG, GIF and PNG. The grid for those types of images will be sized in the correct aspect ratio of the image that is applied to that grid. Other image types, such as TIF, TGA, EXR, will just be set to a default size of 1024x1024. If anyone knows how to detect those file types width and height I can integrate that code in to this tool. I did not want to bind this code directly to the PIL library because it is not part of the default python install.

The code supports two material types. Mantra and Redshift. The code defaults to generating Mantra materials but you can change the variable named shader_type = 1 and the code will generate redshift vop networks instead. For Redshift materials the generator looks at the file extension to see if that file type can contain an alpha channel. If so it will connect the output color from the rsTextureSampler to the opacity color as well to enable initial transparency support.

Specify your path to the image folder in the last line of the script.

imagesToPlanes ("/obj/","C:/Users/Admin/Desktop",".jpg")


Here are some JPG images that were laying around on my desktop.








Edited by Atom
  • Like 2

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now