[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1818] trunk/py/scripts/addons/ light_field_tools: light field tools, fixes for 2.57 release

Aurel W aurel.w at gmail.com
Mon Apr 11 21:55:35 CEST 2011


Revision: 1818
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1818
Author:   aurel
Date:     2011-04-11 19:55:35 +0000 (Mon, 11 Apr 2011)
Log Message:
-----------
light field tools, fixes for 2.57 release

Modified Paths:
--------------
    trunk/py/scripts/addons/light_field_tools/__init__.py
    trunk/py/scripts/addons/light_field_tools/light_field_tools.py

Modified: trunk/py/scripts/addons/light_field_tools/__init__.py
===================================================================
--- trunk/py/scripts/addons/light_field_tools/__init__.py	2011-04-11 10:37:27 UTC (rev 1817)
+++ trunk/py/scripts/addons/light_field_tools/__init__.py	2011-04-11 19:55:35 UTC (rev 1818)
@@ -20,11 +20,12 @@
 bl_info = {
     'name': 'Light Field Tools',
     'author': 'Aurel Wildfellner',
+    'description': 'Tools to create a light field camera and projector',
     'version': (0, 2, 1),
-    "blender": (2, 5, 7),
-    "api": 35622,
+    'blender': (2, 5, 7),
+    'api': 36103,
     'location': 'View3D > Tool Shelf > Light Field Tools',
-    'description': 'Tools to create a light field camera and projector',
+    'url': 'http://www.jku.at/cg/',
     "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Render/Light_Field_Tools",
     "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=25719",
     'category': 'Render'

Modified: trunk/py/scripts/addons/light_field_tools/light_field_tools.py
===================================================================
--- trunk/py/scripts/addons/light_field_tools/light_field_tools.py	2011-04-11 10:37:27 UTC (rev 1817)
+++ trunk/py/scripts/addons/light_field_tools/light_field_tools.py	2011-04-11 19:55:35 UTC (rev 1818)
@@ -102,9 +102,9 @@
 
     def arrangeVerts(self):
         """Sorts the vertices as described in the usage part of the doc."""
-        # get mesh with applied modifer stack
+        #FIXME get mesh with applied modifer stack
         scene = bpy.context.scene
-        mesh = self.baseObject.to_mesh(scene, True, "PREVIEW")
+        mesh = self.baseObject.data
         verts = []
         row_length = scene.lightfield.row_length
 
@@ -213,13 +213,11 @@
 
     def createTexture(self, index):
         name = "light_field_spot_tex_" + str(index)
-        tex = bpy.data.textures.new(name)
-        # change type
-        tex.type = 'IMAGE'
-        tex = tex.recast_type()
+        tex = bpy.data.textures.new(name, type='IMAGE')
 
         # load and set the image
-        img = bpy.data.images.new("lfe_str_" + str(index))
+        #FIXME width, height. not necessary to set in the past.
+        img = bpy.data.images.new("lfe_str_" + str(index), width=5, height=5)
         img.filepath = self.imagePaths[index]
         img.source = 'FILE'
         tex.image = img
@@ -252,7 +250,7 @@
         if textured:
             spot.data.active_texture = self.createTexture(index)
             # texture mapping
-            spot.data.texture_slots[0].texture_coordinates = 'VIEW'
+            spot.data.texture_slots[0].texture_coords = 'VIEW'
 
         # handler parent
         if scene.lightfield.create_handler:
@@ -337,7 +335,7 @@
         scene.objects.link(nobj)
         nobj.select = True 
                 
-        if scene.objects.active is None or scene.objects.active.mode == 'OBJECT':
+        if scene.objects.active == None or scene.objects.active.mode == 'OBJECT':
             scene.objects.active = nobj
 
 
@@ -417,12 +415,12 @@
         col.prop(scene.lightfield, "animate_camera")
         col.prop(scene.lightfield, "do_projection")
 
-        if (scene.lightfield.do_projection):
-            sub = layout.row()
-            subcol = sub.column(align=True)
-            subcol.prop(scene.lightfield, "texture_path")
-            subcol.prop(scene.lightfield, "light_intensity")
-            subcol.prop(scene.lightfield, "light_spot_blend")
+        sub = layout.row()
+        sub.enabled = scene.lightfield.do_projection
+        subcol = sub.column(align=True)
+        subcol.prop(scene.lightfield, "texture_path")
+        subcol.prop(scene.lightfield, "light_intensity")
+        subcol.prop(scene.lightfield, "light_spot_blend")
 
         # create a basemesh
         sub = layout.row()



More information about the Bf-extensions-cvs mailing list