Extensions:2.6/Py/Scripts/Add Mesh/Planes from Images

提供: wiki
< Extensions:2.6‎ | Py‎ | Scripts‎ | Add Mesh
2018年6月29日 (金) 03:47時点におけるYamyam (トーク | 投稿記録)による版 (1版 をインポートしました)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索
Planes from Images
Imports images and creates planes with the appropiate aspect ratio
UI location Group: Add Mesh
Version 1.0 Author(s) tstscr
Blender 2.5 Rev:#27981 License GPL


Executable information
File name io_import_images_as_planes.py
Current version download https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons/io_import_images_as_planes.py



Description

This script imports images and creates planes with them as textures. At the moment the naming for objects, materials, textures and meshes is derived from the image name.

One can either import a single image, or all images in one directory. When importing a directory one can either check the check-box or leave the filename empty.

As a bonus one can choose to import images of only one type. Atm this is the list of possible extensions: extList =

   ('jpeg', 'jpg', 'png', 'tga', 'tiff', 'tif', 'exr',
   'hdr', 'avi', 'mov', 'mp4', 'ogg', 'bmp', 'cin', 'dpx', 'psd')

If someone knows a better way of telling if a file is an image which Blender can read, please tell so ;)

when importing images that are already referenced they are not re-imported but the old ones reused as not to clutter the materials, textures and image lists. Instead the plane gets linked against an existing material.

If one re-imports images but chooses different material/texture mappings, new materials are created.

Has an option to translate pixel dimensions into Blender units.

Usage

This script gets called through the File->Import Menu.


Manual-scripts-imagetoplanesoptions.jpg

Options:

  • All in directory: Import all images in the directory (this is used automatically if the filename is not set)
  • Extension: Filter image files with this extension

Material options

Blender Render

  • Shadeless: The material is set to shadeless
  • Use Alpha: The alpha channel of the image is used for transparency
  • Premultiply: Premultiply the image
  • transMethod: Sets the Method used for transparency rendering

Cycles Render

  • Four different node trees (Diffuse, Emission, (Transparency for both))
  • Option to overwrite existing node trees based on the image(material) name

Dimensions options:

  • use Image dimensions: use pixel count to determine the planes size in Blender-units
  • pixels/BU: sets the mapping of pixels to Blender-units

Hint:

  • For materials that receive shadows that are cast from Planes generated this way, the option Shadow -> Receive transparent should be set.

Installation

  • This script is in Blender 2.5 Add-Ons menu.

History

  • see svn:

https://projects.blender.org/tracker/index.php?func=detail&aid=21751