Jump to content

Images As Planes (Mantra & Redshift Supported)


Atom

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.

 

Mantra:

Untitled-2.jpg

Redshift:

Untitled-1.jpg

 

images_as_planes_092116.zip

Edited by Atom
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...