Atom Posted September 21, 2016 Share Posted September 21, 2016 (edited) 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: Redshift: images_as_planes_092116.zip Edited October 3, 2016 by Atom 2 Quote Link to comment Share on other sites More sharing options...
Juraj Posted September 22, 2016 Share Posted September 22, 2016 Hi, thanks for sharing, great learning resource! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.