[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4442] trunk/py/scripts/addons/ io_import_images_as_planes.py: Fix import image as plane addon, broken by recent pynodes changes (thx to Iggy B [rexxxus] for reporting the bug).

Bastien Montagne montagne29 at wanadoo.fr
Fri Mar 29 15:01:00 CET 2013


Revision: 4442
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4442
Author:   mont29
Date:     2013-03-29 14:01:00 +0000 (Fri, 29 Mar 2013)
Log Message:
-----------
Fix import image as plane addon, broken by recent pynodes changes (thx to Iggy B [rexxxus] for reporting the bug).

Modified Paths:
--------------
    trunk/py/scripts/addons/io_import_images_as_planes.py

Modified: trunk/py/scripts/addons/io_import_images_as_planes.py
===================================================================
--- trunk/py/scripts/addons/io_import_images_as_planes.py	2013-03-29 13:55:09 UTC (rev 4441)
+++ trunk/py/scripts/addons/io_import_images_as_planes.py	2013-03-29 14:01:00 UTC (rev 4442)
@@ -19,8 +19,8 @@
 bl_info = {
     "name": "Import Images as Planes",
     "author": "Florian Meyer (tstscr), mont29, matali",
-    "version": (1, 7),
-    "blender": (2, 65, 0),
+    "version": (1, 8),
+    "blender": (2, 66, 4),
     "location": "File > Import > Images as Planes or Add > Mesh > Images as Planes",
     "description": "Imports images and creates planes with the appropriate aspect ratio. "
                    "The images are mapped to the planes.",
@@ -499,17 +499,17 @@
         out_node = clean_node_tree(node_tree)
 
         if self.shader == 'BSDF_DIFFUSE':
-            bsdf_diffuse = node_tree.nodes.new('BSDF_DIFFUSE')
-            tex_image = node_tree.nodes.new('TEX_IMAGE')
+            bsdf_diffuse = node_tree.nodes.new('ShaderNodeBsdfDiffuse')
+            tex_image = node_tree.nodes.new('ShaderNodeTexImage')
             tex_image.image = image
             tex_image.show_texture = True
             node_tree.links.new(out_node.inputs[0], bsdf_diffuse.outputs[0])
             node_tree.links.new(bsdf_diffuse.inputs[0], tex_image.outputs[0])
 
         elif self.shader == 'EMISSION':
-            emission = node_tree.nodes.new('EMISSION')
-            lightpath = node_tree.nodes.new('LIGHT_PATH')
-            tex_image = node_tree.nodes.new('TEX_IMAGE')
+            emission = node_tree.nodes.new('ShaderNodeEmission')
+            lightpath = node_tree.nodes.new('ShaderNodeLightPath')
+            tex_image = node_tree.nodes.new('ShaderNodeTexImage')
             tex_image.image = image
             tex_image.show_texture = True
             node_tree.links.new(out_node.inputs[0], emission.outputs[0])
@@ -517,10 +517,10 @@
             node_tree.links.new(emission.inputs[1], lightpath.outputs[0])
 
         elif self.shader == 'BSDF_DIFFUSE_BSDF_TRANSPARENT':
-            bsdf_diffuse = node_tree.nodes.new('BSDF_DIFFUSE')
-            bsdf_transparent = node_tree.nodes.new('BSDF_TRANSPARENT')
-            mix_shader = node_tree.nodes.new('MIX_SHADER')
-            tex_image = node_tree.nodes.new('TEX_IMAGE')
+            bsdf_diffuse = node_tree.nodes.new('ShaderNodeBsdfDiffuse')
+            bsdf_transparent = node_tree.nodes.new('ShaderNodeBsdfTransparent')
+            mix_shader = node_tree.nodes.new('ShaderNodeMixShader')
+            tex_image = node_tree.nodes.new('ShaderNodeTexImage')
             tex_image.image = image
             tex_image.show_texture = True
             node_tree.links.new(out_node.inputs[0], mix_shader.outputs[0])
@@ -530,11 +530,11 @@
             node_tree.links.new(bsdf_diffuse.inputs[0], tex_image.outputs[0])
 
         elif self.shader == 'EMISSION_BSDF_TRANSPARENT':
-            emission = node_tree.nodes.new('EMISSION')
-            lightpath = node_tree.nodes.new('LIGHT_PATH')
-            bsdf_transparent = node_tree.nodes.new('BSDF_TRANSPARENT')
-            mix_shader = node_tree.nodes.new('MIX_SHADER')
-            tex_image = node_tree.nodes.new('TEX_IMAGE')
+            emission = node_tree.nodes.new('ShaderNodeEmission')
+            lightpath = node_tree.nodes.new('ShaderNodeLightPath')
+            bsdf_transparent = node_tree.nodes.new('ShaderNodeBsdfTransparent')
+            mix_shader = node_tree.nodes.new('ShaderNodeMixShader')
+            tex_image = node_tree.nodes.new('ShaderNodeTexImage')
             tex_image.image = image
             tex_image.show_texture = True
             node_tree.links.new(out_node.inputs[0], mix_shader.outputs[0])



More information about the Bf-extensions-cvs mailing list